Client prediction
The slow step
Kai is 150 ms from the server. Kai presses walk. The input takes 150 ms to reach the server, and the server's answer takes 150 ms to come back.
If the app waits for that answer, every step starts 300 ms late, and the game feels like walking through mud.
Predict
With client prediction, the app runs the same movement code the server runs, at once, and shows the result.
Valve's Source does this: the client predicts its own player, and the server still has the final say. When the server answers, the app checks its guess.
Quick check
With client prediction, who has the final say on where Kai stands?
- The server
- Kai's app
- Whichever answers first
Show the answer
The server
The app only guesses ahead. The server's answer always wins, so a cheater cannot move by editing their app.
Why the same code
The guess is right only if the app and the server run the same rules on the same inputs. Shard Garden shares one movement file between both.
Then a prediction is wrong only when something the app did not know about happened, like another player's action.
What is not predicted
The app predicts only its own player's actions. Other players are drawn from snapshots, slightly in the past.
Anything the server decides, like which seed a mystery pack holds, is never guessed: the app waits for the answer.
Predict or wait?
Which action should Shard Garden predict?
- Kai walking to the pond
- Which seed a mystery pack holds
- Whether Priya's plant blooms
Show the answer
Kai walking to the pond
Kai's own walk follows rules the app knows. The pack's seed is the server's decision, and Priya's plant is another player's.
Hidden, not gone
Prediction does not shorten the trip to the server. It shows Kai the result before the server confirms it, so the delay is hidden.
Quick check
Client prediction makes the round trip to the server shorter.
- True
- False
Show the answer
False
The trip takes as long as before. The app just shows the expected result without waiting for it.
Feel it
Next, plant a seed three ways with a server 300 ms away, and see what prediction changes.
Bolt says: Next: hands-on, feel the round trip.
Fact-checked 12 October 2026
- Valve: Source Multiplayer Networking developer.valvesoftware.com
- Gabriel Gambetta: Client-Side Prediction and Server Reconciliation gabrielgambetta.com