Good Netcode on High Latency Network

5 March, 2009

The optus 3G network has 1000ms latency.  That means Steroids will need some clever code to deliver a smooth multiplayer game experience.

My basic idea is to only send the clients events that change the game. If no one clicked a button in the game then the clients would only get a start and game over message.

As long as all the clients and the server share the same physics code they will all see the same game.

The challenge comes when the client receives a message about an event that occoured in tha past.

For example at tick 1 client A made a oid explode.

That message gets sent to the server and arrives at tick 25 ( 1 second later )

The server forwards the message to client B which arrives at tick 50 ( another second later)

Client B now has to change the game around an event that happened 2 seconds ago.

Every event in the game you will store in a list. That means you could theoretically replay the whole game from the start just using the list of actions provided by players. I reakon you could probably replay the physics for the whole game in memory during a single frame.  So for a past event you would insert into the list at the right point and then replay the whole game in memory.

If that takes too much processing power then I plan to save the game state in memory once every couple of seconds.  My calculations say it will likely take less then a meg of ram over the life of a game. Then you only have to roll back then forward a small number of ticks.

Entry Filed under: Uncategorized. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Blogroll

Blog Stats

RSS US Forums