Original Post
Hi everyone,
I'm making a top-down 2D space shooter (a la Asteroids, or more accurately, Subspace/Continuum) and am trying to implement the Valve server model for state synchronization. I've got state interpolation in, and just implemented server-side rollbacks, but am having a little trouble with the corrections caused by rolling back (see here: video).
As you can see, ships will start turning, overshoot where I let go of the key, and then snap back. I can smooth the snapping, but even with a degree of interpolation, that's undesirable behavior. Note that I haven't implemented client-side prediction yet, but that won't solve this since it appears on other players as well.
A little about my server architecture: The client captures input every 33ms, and the server sends out a snapshot every 33ms. Clients are buffered by 100ms for interpolation. Whenever the server receives input from a client, the server rolls back to the point at which the input was sent, incorporating latency and the flat 100ms buffer delay (with a maximum rollback of 500ms), applies that input, and re-simulates the world accounting for all other input it received after the rollback point. Each state is immutable, and generated from the previous immutable state plus any commands/events either received from clients or generated from the last update. The actual state simulation architecture is described in greater detail, with diagrams, here: http://www.gamedev.n...arallelization/
I know the Valve model rolls back just to apply rays from instant-hit weapons. Most of my projectiles in my game won't be instant, but rather missiles/rockets. Should I only roll back for certain commands? If so, how do I keep the controls feeling responsive while still being accurate? If I didn't rollback, the ships in that video would just plain overshoot the point at which the player let go of the keyboard (and that's with very little latency).
Thanks!
I'm making a top-down 2D space shooter (a la Asteroids, or more accurately, Subspace/Continuum) and am trying to implement the Valve server model for state synchronization. I've got state interpolation in, and just implemented server-side rollbacks, but am having a little trouble with the corrections caused by rolling back (see here: video).
As you can see, ships will start turning, overshoot where I let go of the key, and then snap back. I can smooth the snapping, but even with a degree of interpolation, that's undesirable behavior. Note that I haven't implemented client-side prediction yet, but that won't solve this since it appears on other players as well.
A little about my server architecture: The client captures input every 33ms, and the server sends out a snapshot every 33ms. Clients are buffered by 100ms for interpolation. Whenever the server receives input from a client, the server rolls back to the point at which the input was sent, incorporating latency and the flat 100ms buffer delay (with a maximum rollback of 500ms), applies that input, and re-simulates the world accounting for all other input it received after the rollback point. Each state is immutable, and generated from the previous immutable state plus any commands/events either received from clients or generated from the last update. The actual state simulation architecture is described in greater detail, with diagrams, here: http://www.gamedev.n...arallelization/
I know the Valve model rolls back just to apply rays from instant-hit weapons. Most of my projectiles in my game won't be instant, but rather missiles/rockets. Should I only roll back for certain commands? If so, how do I keep the controls feeling responsive while still being accurate? If I didn't rollback, the ships in that video would just plain overshoot the point at which the player let go of the keyboard (and that's with very little latency).
Thanks!








