#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    196
    Rep Power
    10

    What Should the Server Handle for a Flash Game?


    Hey, I'm creating a tile-based game in Flash where basically the players move around and shoot each other. I'm adding scrolling right now, and later I'm going to be adding multilayer functionality.

    Doing scrolling got me thinking because tiles are appearing/disappearing and as soon as a bullet leaves the stage, it won't know if there are any wall tiles it should stop at -- it'll just keep going.

    I could render ALL of the tiles, but I don't want to as it would definitely slow down the game.

    So what should the server handle? I'm thinking:

    Bullet is shot by user->Client alerts server->Server creates a new bullet->Client sees new bullet and puts it on the stage->Server moves bullet and sends message to all clients about bullet->Clients move bullet to where server tells them it is

    I would probably use that for all moving objects. That seems like a LOT of sending/receiving information, though, as there may be hundreds of objects at a time. Flash would have to contact the server 30 times a second (frame rate) just for one object.

    So how much should the server deal with and how much should clients deal with?

    Thanks,
    Tucker
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    62
    Rep Power
    13
    The messages number should be minimized. The server should receive only the client actions and re transmit them to the other client instance.

IMN logo majestic logo threadwatch logo seochat tools logo