[Flash/AS 3.0] Multiplayer Platform Creation

seph ir oth

Mod'n Dat News Jon
Reaction score
262
Hello,

I'm in the works of my own flash tower defense, and to spice it up upon completion, I'd like to try and make a multiplayer mode where the game would resemble something like Tower Wars or Wintermaul Wars from Warcraft III. However, the player would only see HIS base, and thus all the game programming for both players would be client-sided. Therefore, I need to make a server that can simply link two players together, and can take packets of files from one player and chuck it at the other. I've done a bit of research and I'm considering using Smart Fox Server, but I would really like to try to make it myself to get a feel for it. What languages could I code this in (SQL perhaps)?

To be more specific, I would be sending creep information back and forth at the rate of one time a second. How it would work: Player A jams on the Rat and Dog hotkeys and manages to summon 5 Rats and 4 Dogs in one second. That second's time is up. The Actionscript coding would save that information in an XML file and send it to the server, which would then send it to the opposing client. The same will be done with winning/losing as well as gold/income/lives count.
 

Conal

Member
Reaction score
12
Well, I know you could do this with sql. Throw the user's data into the database like you mentioned and have the flash update it at your interval. To read the data, query the database with php or something and throw it into a string. From the flash, read that string and parse it (you might have to throw in a rand() to prevent an ie bug).

Server delay might be an issue as well as hacking. Since you're using a fairly large update interval there might be syncing issues somewhere in there.
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
Well, I know you could do this with sql. Throw the user's data into the database like you mentioned and have the flash update it at your interval. To read the data, query the database with php or something and throw it into a string. From the flash, read that string and parse it (you might have to throw in a rand() to prevent an ie bug).

Server delay might be an issue as well as hacking. Since you're using a fairly large update interval there might be syncing issues somewhere in there.

The only sync issues would be for winning/losing, and I would fix that by keeping a second-long timer going that would record the exact millisecond the player loses at. If they lose at the same second interval, they will be sent & compared (on BOTH client sides) to decide the victor.

Hacking? Bleh, this is a personal project ;)

Yeh, I guess I'll have to read into how SQL servers run then. I've only dabbled with it when I hosted a Trackmania server. I'm partially familiar with PHP, I have people that are better at it than me that could help out.

Thanks :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top