Server reconciliation
The rubber band
Kai taps right three times, fast. The app predicts each step: x goes from 10 to 13.
The server's first answer arrives. It has applied only the first tap, so it says x is 11. If the app simply jumped to 11, Kai would snap back two steps, then forward again.
Number the inputs
Gabriel Gambetta's well-known guide to netcode describes the fix. The client gives each input a sequence number.
The server's reply "includes the sequence number of the last input it processed". Now the app knows which of its inputs the server has already counted.
Quick check
What does the sequence number in the server's reply tell the app?
- Which inputs the server has already applied
- How many players are online
- The time of day
Show the answer
Which inputs the server has already applied
Inputs up to that number are in the server's answer. Later ones are still in flight.
Replay what is in flight
The app starts from the server's state, drops the inputs the server has counted, and applies the rest again. That is server reconciliation.
If nothing unexpected happened, the result matches what Kai already sees, and nothing moves.
Replay it
1server: x = 11, last #12in flight: #2 (+1), #3 (+1)
Where should the app draw Kai?
- x = 13
- x = 11
- x = 12
Show the answer
x = 13
Start at the server's 11, then replay #2 and #3: 12, then 13. Kai stays where they are.
When the server disagrees
Suppose Priya built a fence at x = 12 a moment ago. The server stops Kai at 11. Replaying the inputs from 11 now stops at the fence too.
The same replay that keeps Kai still when all is well corrects Kai when the world changed.
Quick check
With reconciliation, the app's prediction overrides the server.
- True
- False
Show the answer
False
The app always starts from the server's state. It only replays its own inputs on top.
Aiming at the past
Kai's own moves are now smooth. But Kai sees everyone else 100 ms in the past. What happens when Kai tries to catch something that moves?
Bolt says: Next: lag compensation.
Fact-checked 12 October 2026
- Gabriel Gambetta: Client-Side Prediction and Server Reconciliation gabrielgambetta.com