Jump to content
  • Advertisement
Sign in to follow this  
AgentC

Scene consistency when using client-side prediction

This topic is 2805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
Presentation is different from simulation. Extrapolation is often done as a presentation delta, not as a simulation delta.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!