3 ms·
The important two points are that the client must react immediately to a user's input, but at the same time the server has to have the authoritative game state.
by Mirioron 6y ago
The important two points are that the client must react immediately to a user's input, but at the same time the server has to have the authoritative game state.
One way of doing that is that the server runs the authoritative simulation and the clients send input to the server, but the clients also run their own simulations. In some games the client will try to predict what the server will do. If there's a conflict with what the client simulates compared to the server then the client gets rolled back to the server's state. This usually happens when there's a second player that interferes in some way.
Here is a talk by Timothy Ford about Overwatch's netcode (it's really fascinating): https://www.youtube.com/watch?v=W3aieHjyNvw https://www.youtube.com/watch?v=W3aieHjyNvw