Page 1 of 2

The Time Warp (MySQL & PHP MMO)

Posted: Sat Aug 01, 2009 10:51 pm
by neronix17
Wasnt entirely sure where to put this but this seemed like the best area. Following a TUT by halls I have began work on a MMO browser game, currently its still the single person you control with an arena and store, I am wanting to have it based on Doctor Who in a strategy style MMO in the end (mainly so I can have the TARDIS as an ADMIN only ship :D). The basics of what I want to have in the end is something like bigpoints Space Invasion (not sure on the link, just use google its in the 1st results). Where you start off as your chosen Civilisation (one thing SI doesnt have is that feature, different looking Civs) on a planet of your choice, which is essentially a number (like a phone number galaxy:system:planet (12:38:2)) each system has 5 planets, 25 systems in a galaxy and 100 galaxies (shouldnt need nearly that much but better having more than less).
You begin by building buildings that produce resources so that you can build more buildings like a shipyard etc, these resources need to be produced on a timer (say 10 metal for each mine every 15 minutes). Id like to have technology researching but its not needed. When you build a shipyard you need to pay to level it up so you unlock better ships, this way you wont start off with the power of a god within a couple days of playing.

The ships need an attack power and shield, which would be easy to set up. (and while im on that subject I will be using MySQL and PHP for this). The main part will be the abiltiy to colonise other planets which are empty and build on them like with the homeworld, and if someone else is on a targeted planet you would have to destroy them to take over their world.

I can easily make the look of the entire site, Im not too bad with MySQL so the making the database itself wouldnt be too hard for me, but the php and just coding in general im pretty bad with :( Thats the bit I mainly need help with.

The site is in my http://thetimewarp.bounceme.net website collection, its just had the banner changed so im not sure if it will be right yet, its the one with "Clone Wars Arena" on it, quickly made that in Photoshop so there was a banner for it. Any help much appreatiated :)

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sat Aug 01, 2009 11:28 pm
by SpiritWebb
I'm doing the same thing with mine...You can colonize/invade worlds form alliances and factions, etc.

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sat Aug 01, 2009 11:29 pm
by neronix17
oh crap i forgot about alliances :D

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sat Aug 01, 2009 11:53 pm
by hallsofvallhalla
your galaxies can be much like my last game

make a table called galaxies, then each galaxy is a number like you suggested, each planet would be named

fields
galaxy = number
system = number
planet = name

then in the player table you put the fields galaxy and system to mark where the player is located..maybe even planet

then when you do the query you query planet where system = player system and galaxy = player galaxy. you can have a unlimited # of system and galaxies this way.

then for the resources makes a new table called resources and have a field called playerid and planet id.... then you can store the players resources per planet and query the resources by player id and planetid.

Your tech research can be done by a player field and a cron. the cron queries the players research number every day or hour maybe and adds to a research pool or something.

play forsakensanctum at http://forsakensanctum.com/login.php and see if this is what you mean for building and I can share some code with you.

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sat Aug 01, 2009 11:59 pm
by neronix17
yes actually thats exactly what im looking for lol that map is pretty cool too, hows that done?

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sun Aug 02, 2009 12:08 am
by SpiritWebb
Halls:

After you login on the forsakensanctum site for the game, how did you setup the re-direct instead of clicking a link to continue?

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sun Aug 02, 2009 1:20 am
by neronix17
im just going to guess but instead of echo'ing the html for a link at the end it would probably be just a bit of php instead, telling it just to go to index.php if the login is successful right?

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sun Aug 02, 2009 1:55 pm
by neronix17
Ok halls, I made the table, the code on the other hand is a different story. Ideally I want pretty much a copy of the Space Invasion http://spaceinvasion.bigpoint.com, with my own style to it. If you have register and have a look you can see what its like.

Re: The Time Warp (MySQL & PHP MMO)

Posted: Sun Aug 02, 2009 2:47 pm
by hallsofvallhalla
fixed your link to that game...


Halls:

After you login on the forsakensanctum site for the game, how did you setup the re-direct instead of clicking a link to continue?
header refresh

http://us2.php.net/manual/en/function.header.php


the map was a little bit of work but it s really simple and limitless on size, well almost. You could have 80,000 buildable spots with very little pressure on your db. I did it much like my example above. Each zone has a name, within each zone is multiple maps(1600+) and each map, which is what you see on the screen has 40 squares..what you build on. when you open the map page it queries your location and builds the map accordingly putting each square together using div tags.

Its done with c = column and r = row...so everything is stored with a zone, r, and c. lets say player is located at zone 1, c4 r 6
query maps where zone = 1, r = 6, c=4 then you make a while statement that places everything found into an array and runs through that array turning each one into a image. This is done by tags. lets say I own a armor shop on this map and its located in the top left corner..that tag 1...so it places the image in a div marked tag1 on the map....


I played the game you mentioned and that should be very very easy to do. Everything is simple tables and fields and quering for the info. Feel fre to ask how things are done if you get stuck. One of us will be able to answer.

Re: The Time Warp (MySQL & PHP MMO)

Posted: Wed Aug 05, 2009 12:38 am
by Torniquet
hallsofvallhalla wrote:fixed your link to that game...


Halls:

After you login on the forsakensanctum site for the game, how did you setup the re-direct instead of clicking a link to continue?
header refresh

http://us2.php.net/manual/en/function.header.php
Ok i could do with some help on this one :p

I have got one page refreshing to another....

but how did you get it to say "please wait while being redirected" or what ever it said?