Sign in to follow this  
AgentC

Scene consistency when using client-side prediction

Recommended Posts

AgentC    2352
Hi,
let's assume a Quake/Half-Life style networking model. To do client-side prediction, you store each input packet you send to a list on the client, and then, when a new server update packet is received, you replay the input packets the server has not acked yet, on top of the received server update.

Ok, all is fine up to this point.

However, to be efficient, the server should only be sending actually changed things in the scene (from its point of view) ie. delta updates.

If the client is also mucking around in the scene state on its own when doing prediction, it needs a way to "undo" all the actions it has done on its own upon receipt of the next server update, so that the delta update can be applied consistently. Depending on the amount of lag, the same frames of input are possibly being played over and over until the server finally acks them.

So, some questions: (not looking for a "right" answer, but just different viewpoints)

- What do you actually allow the client to do while predicting? Do you allow it, for example, to spawn new objects and then clean up those so you can apply the server update consistently? (for an example, let's say you're predicting the player's weapon change, and one of the weapons has an attached light, so you need to create a light object, but the server will also create it in the future, so if you don't clean up, you would soon have two lights)

- How do you handle animation of the predicted player character? (let's assume a 3rd person game for more challenge) On the client only, or on both client & server and then try to match the two?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this