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.
Overview
Client-side prediction is a networking technique that makes online 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.
Fast Facts
- Pioneered: QuakeWorld (1996)
- Developer: John Carmack
- Problem solved: High-latency unplayable
- Solution: Predict locally, correct later
- Status: Industry standard
The Problem
Without prediction:
| Scenario | Result |
|---|---|
| Press forward | Wait for server |
| 200ms latency | 200ms delay every input |
| Player experience | Unplayable sluggishness |
How It Works
| Step | Process |
|---|---|
| 1 | Player presses forward |
| 2 | Client predicts movement locally |
| 3 | Input sent to server |
| 4 | Server calculates authoritative position |
| 5 | Client receives server state |
| 6 | Client reconciles prediction with reality |
Reconciliation
When prediction differs from server:
| Situation | Response |
|---|---|
| Minor difference | Smooth correction |
| Major difference | Snap to server position |
| Consistent error | Adjust prediction model |
QuakeWorld Impact
Before QuakeWorld, internet Quake was:
| Aspect | Before | After |
|---|---|---|
| Playability | 100ms+ unplayable | Playable at 200ms+ |
| Server model | Peer-to-peer | Client-server |
| Player base | LAN only | Internet viable |
Related Techniques
| Technique | Purpose |
|---|---|
| Lag compensation | Shots hit where player aimed |
| Interpolation | Smooth other players |
| Server reconciliation | Resolve conflicts |
Implementation Challenges
| Challenge | Solution |
|---|---|
| Cheating | Server authoritative |
| Physics divergence | Deterministic simulation |
| Visual glitches | Interpolation, smoothing |
Legacy
Client-side prediction enabled internet gaming. Every modern online game uses this technique or its descendants—from Counter-Strike to Fortnite—making Carmack’s QuakeWorld code perhaps the most influential networking innovation in gaming.