Spokes.wiki Search About
Blog Posting T2 stable source ↗ source url
Published
Created
Updated

What every programmer needs to know about game networking

Glenn Fiedler, Gaffer On Games. A practitioner history of how multiplayer architecture arrived where it is, and the reason it is graded T2 rather than T3: it compares four approaches across four generations of shipped games rather than describing one product.

The lineage

Doom (1993) — peer-to-peer lockstep. Every machine runs the same simulation and exchanges inputs; nobody advances until the slowest peer's input arrives. Fine on a LAN, catastrophic over a modem, where connections ranged from "unplayable (e.g. a 14.4Kbps PPP connection) to the marginally playable (e.g. a 28.8Kbps modem)."

Quake (1996) — client-server. Clients send inputs to one authoritative server which returns state. That removes the dependency on the slowest peer and lets players join mid-game. The design assumed latency under 200 ms; Carmack's own account is that modem users saw "300+ ms latencies, minimum" once the path through an ISP was counted.

QuakeWorld — client-side prediction. The client simulates its own movement immediately instead of waiting, which means the client now has to know about solidity, friction and gravity. The server stays authoritative; when it disagrees, the client rewinds to the corrected state and replays the inputs it has buffered since. Same rewind-and-replay shape as ggpo, applied to one player's own character rather than to the whole simulation.

Unreal and Halo — state synchronization. The server sends state rather than inputs, and clients interpolate between snapshots.

The part that decides an engine choice

Fiedler's genre argument is the useful takeaway. RTS games keep lockstep because "the game state consists of many thousands of units and is simply too large to exchange between players" — sending commands is the only affordable option. Action games went the other way: client-server with prediction, accepting the server's authority in exchange for input that responds now.

So the two families are not competing implementations of one idea. They are answers to different questions about how much state there is and who is allowed to be wrong about it. See netcode.