1
\$\begingroup\$
  • You are playing as Lucio in Overwatch. You boop another player and they immediately get booped away. It feels really responsive. But the server hasn't actually registered the boop yet. By the time your command reaches the server, that player might be in a different location and the result of your boop might be completely different. If we needed to wait for a server confirmation, we wouldn't see our boop for, say, 200ms. (assuming 200ms RTT.)

  • You are driving around in PUBG and see another player. You drive your car in to a player who is running around on foot. They appear to immediately die or at least get bumped away by the impact. You hit the player where you saw him but he is actually somewhere else on the server (you may have actually missed him!). If our game does not respond immediately, we would see the other player clip in to your car as they continue running, then, say, 200ms later they would die or get knocked around (again assuming a RTT of 200ms)

How are situations like these resolved? It seems like the result is simulated locally (prediction) but the outcomes could be so drastic that an incorrect prediction could result in a lot of confusion. (Running over a player who isn't actually in your way, booping a player to your left off a cliff, but they are actually in front of you and won't fall down the cliff)

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

The usual solution is for the client to assume at first that the server will agree with it and correct afterwards when it does not.

So when you "boop" another player, both tell the server you are "booping" it and calculate their trajectory according to the client's currently assumed world-state. When the server then says 200ms later: "uhm, actually, you did not boop actor 1703 to 100.0002:23.00124 but to 100.0003:23.00126", you have the client correct that afterwards. Either immediately (with a notable jump) or have the actor "rubber-band" slowly to their intended position over multiple frames.

\$\endgroup\$
1
  • \$\begingroup\$ The concept is easy to understand but the implementation is a nightmare. So, when I tell the server I have booped someone, I might still receive further positional updates of the person I have booped (before the server acknowledges my boop). ie with an update rate of 30Hz, and RTT of 200, I can receive 3 positional updates for the player I booped - none of these updates would consider the 'boop', even if my boop was valid. So I can 'boop' them locally for the first frame (making the assumption the 'boop is valid'), but before the server confirms I will receive up to 3 updates saying otherwise. \$\endgroup\$
    – Prodigga
    Oct 1, 2017 at 4:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .