The Time Warp (MySQL & PHP MMO)

C++, C#, Java, PHP, ect...
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

The Time Warp (MySQL & PHP MMO)

Post 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 :)
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: The Time Warp (MySQL & PHP MMO)

Post by SpiritWebb »

I'm doing the same thing with mine...You can colonize/invade worlds form alliances and factions, etc.
Image

Image
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: The Time Warp (MySQL & PHP MMO)

Post by neronix17 »

oh crap i forgot about alliances :D
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: The Time Warp (MySQL & PHP MMO)

Post 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.
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: The Time Warp (MySQL & PHP MMO)

Post by neronix17 »

yes actually thats exactly what im looking for lol that map is pretty cool too, hows that done?
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: The Time Warp (MySQL & PHP MMO)

Post 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?
Image

Image
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: The Time Warp (MySQL & PHP MMO)

Post 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?
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
neronix17
Posts: 317
Joined: Sat Aug 01, 2009 5:01 am

Re: The Time Warp (MySQL & PHP MMO)

Post 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.
This isnt just a gimp mask...This is an S&M gimp mask...
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: The Time Warp (MySQL & PHP MMO)

Post 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.
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Re: The Time Warp (MySQL & PHP MMO)

Post 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?
New Site Coming Soon! Stay tuned :D
Post Reply

Return to “Coding”