July 15th, 2009, 04:25 PM
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?
July 17th, 2009, 07:13 PM
The messages number should be minimized. The server should receive only the client actions and re transmit them to the other client instance.