processing gamestate with a window of commands across time?

Posted by rook2pawn on Game Development See other posts from Game Development or by rook2pawn
Published on 2012-11-26T15:16:05Z Indexed on 2012/11/26 17:28 UTC
Read the original article Hit count: 191

Filed under:
|

I have clients sending client updates at a 100ms intervals. i pool the command inputs and create a client command frame. the commands come into the server in these windows and i tag them across time as they come in. when i do a server tick i intend to process this list of commands i.e.

[ {command:'duck',timestamp:350,player:'a'}, {command:'shoot',timestamp:395,player:'b'}, {command:'move', timestamp:410,player:'c'} {command:'cover',timestamp:420,player:'a'} ]

how would i efficiently update the gamestate based on this list? the two solutions i see are

1) simulate time via direct equation to figure out how far everyone would move or change as if the real gameupdate was ticking on the worldtick..but then unforseen events that would normally trigger during real update would not get triggered such as powerups or collissions

2) prepare to run the worldupdate multiple times and figure out which commands get sent to which worldupdate. this seems better but a little more costly

is there a canonical way to do this?

© Game Development or respective owner

Related posts about multiplayer

Related posts about state