Jump to content
  • Advertisement
Sign in to follow this  

client side prediction

This topic is 2535 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

So I've read and decided to go with the valve way of doing networked FPS games. I know RakNet pretty well and have worked with it before but at this point it's more about getting the idea of certain techniques. I get server side lag compensation along with remote client interpolation from the valve article in the FAQ section on this forum.

I was reading client side prediction and I get what it's about, but the article itself didn't seem to address the lag differences in button presses vs releases. It states the server is always right, but if when I pressed the button my lag was 150 and when I release the button my lag was 200 that would mean the server is 50ms to far than the client. Does that mean the server is still "correct" and the client should adjust to the server when it gets a snapshot update from the server? The article didn't really address that but I would assume the server could compare the lag times from the press vs the release and compensate itself accordingly by either moving "back" or moving "forward" more depending on the difference.

I was also trying to wrap my head around how the client would know when to correct itself when it got server updates. If I press the 'W' key to start moving forward and it took 150ms to get to the server the server data it's sending me will always be 150ms old so when I get these updates for my local client I don't want to adjust to it because it'll always be 150ms old, but my client doesn't really know how long it took to get my msg to the server. The server knows once it got there since RakNet stores that info, but my client that sent the message doesn't know (afaik) so not sure how much in the past it would know to check the difference from it's previous position locally to what the server said it was. Even if I knew the lag I had on my press msg I sent it's all old data to me (150ms old in this case) as the local client so what would I do with it? Given that, when would the client really ever correct itself from the server? Only on release?


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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!