Lab · hands-on
A lag and prediction simulator
The same avatar, the same ping — but three netcode models hide the delay in different ways. The gray ring is where you are actually pressing (zero latency). The colored dot is what the chosen model shows. Watch the gap between them: the naive model trails by the full RTT, prediction stays right there (but twitches on packet loss), lockstep trails by a steady amount with no jerks (but freezes on loss).
How to use this
The avatar walks left and right on its own (or hit ◀ ▶ with "auto" turned off). Pick a model at the top. Raise the ping — under "naive" the gap grows by the full RTT, under "prediction" the avatar stays under the ring, under "lockstep" a steady offset appears (input delay). Raise the packet loss — "prediction" starts to twitch (rubber-banding: server and client have diverged), "lockstep" starts to freeze (waiting on an input retransmit), "naive" gives you both lag and jerks.
where you press (0 ms)
what the model shows
server (authority)
What to notice: 1) at 0% loss, switch "naive" → "prediction" at the same ping: the gap to the ring disappears (your own input applies immediately), but that isn't magic — the bill arrives in point 3. 2) "lockstep": the gap comes back, but it is steady and jerk-free — that is input delay, and you feel it all the time. 3) raise the loss to 15–25%: "prediction" twitches (rubber-banding — the server missed part of the input), "lockstep" stalls in bursts (the whole simulation waits for input), "naive" combines lag and jerks.
🏠 What's next
Go back to the lesson — the "three models side by side" table and the block "🔧 Run it and poke at it": bring up a real networking sample in Godot (MultiplayerSynchronizer) and a rollback plugin (GGRS), turn on artificial lag — and you'll see the same three signatures on a real engine. The third model in depth is in the rollback (GGPO) lesson.
Connections
from the lesson
Netcode taxonomy — the theory of the three models: what goes on the wire (state/commands/input), the cost in bandwidth and the cost in latency.
example
Client prediction — the first model in depth: prediction + reconciliation + lag comp in QuakeWorld/Source.
What to notice afterwards (observation checklist)
- At 300 ms ping "naive" trails by ~300 ms (the full RTT), "prediction" by ~0, "lockstep" by a fixed input delay (~one-way).
- 0% loss → "prediction" is smooth and lag-free; that is the price of "free" responsiveness — it only shows up on divergence.
- 20% loss → "prediction" = rubber-banding (the correction counter climbs), "lockstep" = freezes (the seconds counter climbs), "naive" = both.
- Lower tickrate (10 Hz) → "naive" also goes "steppy" (sparse snapshots), while prediction keeps your own input smooth regardless.