Skip to content
Techniques & Technology

Client-Side Prediction

Making lag invisible

The networking technique pioneered in QuakeWorld (1996) that makes online games playable on high-latency connections by predicting movement locally before server confirmation.

cross-platform networkingmultiplayerquakelatency 1996–present

Overview

Client-side prediction is the networking technique that makes online action games playable on high-latency connections. Pioneered by John Carmack in QuakeWorld (1996), it predicts player movement locally without waiting for server confirmation, hiding latency from players who would otherwise feel a 200 ms delay between every input. Without it, the modern internet-multiplayer FPS, MOBA, and battle-royale genres are simply not possible.

The technique reverses the trust model of the original Quake: the server is now authoritative, but the client is allowed to predict where it'll end up while waiting for confirmation. The server later corrects the client when prediction was wrong — usually invisibly, sometimes with the dreaded "rubber-banding".

Fast facts

  • Pioneered: QuakeWorld (1996, John Carmack at id Software).
  • Problem solved: High-latency play is unbearable without prediction.
  • Solution: Predict locally, reconcile with server later.
  • Status: Industry standard for action games; every modern shooter, MOBA, fighting game, and battle royale uses it or a variant.

The problem

Without prediction, the round-trip latency hits every input:

ScenarioResult
Press forwardClient sends to server
Server processesUpdates authoritative state
Server sends backPosition update
200 ms ping200 ms delay between input and visible movement
Player experienceUnplayable sluggishness

The original Quake (June 1996) shipped with this naive networking and was famously hard to play across the internet. Carmack rewrote the netcode for QuakeWorld (December 1996) with prediction.

How it works

The prediction loop:

StepProcess
1Player presses forward
2Client predicts movement locally — applies physics immediately
3Input + sequence number sent to server
4Server processes input authoritatively
5Server broadcasts authoritative state to all clients
6Client receives server state with sequence acknowledgement
7Client compares predicted state at that sequence to server state
8If they differ, client reconciles — re-runs prediction from server's authoritative state

The crucial step 8 is reconciliation — the client doesn't snap to the server's old state, but re-applies its more recent inputs starting from the server's confirmed position. The result: the player sees their character move smoothly even when the server corrects.

Reconciliation

When prediction differs from server (network packet loss, mispredicted physics, hostile player input you didn't see):

SituationResponse
Minor differenceSmoothly interpolate over a few frames — invisible to player
Major differenceSnap to server position — visible "rubber-banding"
Consistent errorAdjust prediction model (recalibrate timing, account for high ping)
Lost packetsRe-send last input + buffered inputs

The client keeps a buffer of recent inputs and predicted states, so when the server says "at sequence 42 you were at position X", the client can replay sequences 43, 44, 45... from X to compute the new "now".

QuakeWorld impact

Before QuakeWorld, internet Quake was:

AspectOriginal Quake (June 1996)QuakeWorld (December 1996)
Playability100 ms+ unplayablePlayable at 200 ms+
Server modelPeer-to-peer (each client also ran simulation)Client-server (server authoritative)
Player baseLAN-quality onlyInternet viable; ushered in mass online FPS

This was the enabling technique for internet multiplayer gaming. Every successful online action game since (Counter-Strike, Quake III, Halo 2, Call of Duty, Fortnite, Apex Legends) descends from QuakeWorld's netcode pattern.

Client-side prediction is one piece of a larger netcode toolkit:

TechniquePurpose
Lag compensationServer rewinds time when validating shots; "shoot where you saw, not where they are now"
Client interpolationOther players are rendered slightly behind real time, smoothly interpolating between received states
Server reconciliationResolve conflicts between predicted and actual outcomes
Delta compressionSend only state changes since last ack, not full state
Snapshot interpolationContinuous smoothing of remote-player positions
Rollback netcodeFighting-game variant — locally simulate inputs, roll back and replay if remote inputs disagree

Implementation challenges

ChallengeSolution
CheatingServer is authoritative — clients can't decide they "really hit"
Physics divergenceUse deterministic simulation so client and server reach same answer
Visual glitchesSmoothly interpolate corrections; only snap on big errors
BandwidthSend state deltas, not full state
Packet lossRe-send recent inputs; buffer state on both ends
Adversarial latency"Lag switching" exploits — players intentionally inducing lag

Variants

The 28-year evolution:

Game / engineYearVariation
QuakeWorld1996Original prediction + reconciliation
Half-Life (GoldSrc)1998Quake-derived; lag compensation added
Counter-Strike 1.62003Refined lag compensation; "favour the shooter"
Halo 22004First console FPS with serious netcode
Source engine2004Mature client-server prediction
Quake III Arena1999Smoother snapshot interpolation
Battlefield series2002+Larger player counts, more state
GGPO / rollback netcode2006Fighting-game alternative — rollback rather than predict
Modern engines2010s+All major engines (Unreal, Unity, Source 2) ship with prediction by default

Rollback netcode (fighting games)

Fighting games have a different latency profile — every frame matters; a 100 ms ping is half a second of input lag in 60 fps gameplay. GGPO (2006, Tony Cannon) introduced rollback netcode for fighters: locally simulate as if remote inputs were "no input"; when remote inputs arrive, rollback and replay. The result: zero perceived input latency, with visual stutter only on bad connections. Now standard in Street Fighter 6, Tekken 8, Guilty Gear Strive, Mortal Kombat 11+.

Rollback is conceptually similar to client-side prediction but differs in detail — both clients are "predictors" rather than one client predicting against an authoritative server.

Legacy

Client-side prediction enabled internet gaming. Every modern online game uses this technique or its descendants — from Counter-Strike to Fortnite to Marvel Snap — making Carmack's QuakeWorld code perhaps the most influential networking innovation in gaming history. The QuakeWorld source release (1999, GPL) made the technique studyable; the techniques propagated through every subsequent engine.

Modern netcode discussion (Glenn Fiedler's blog, Gaffer on Games series, Valve's Source engine documentation) all trace back to the QuakeWorld foundation.

See also