A small arena for a hard-to-see problem.
Lag Arena lets you replay one action through different versions of a networked world.
What you can do
Watch a seeded example or record a 2.8-second dodge with arrow keys, W/S or the touch controls. Replay it from the local client, remote client and authoritative server. Pause, scrub, change connection settings, and compare the same inputs against a clean connection.
The model, precisely
- Input advances in fixed 60 Hz steps. The player moves vertically at 240 world pixels per second and stays inside the arena bounds.
- Round-trip latency is split equally between the uplink and downlink. Each packet receives independent uniform one-way jitter, clamped to a non-negative delay.
- A seeded pseudo-random generator drives independent packet loss and jitter. Reported loss counts are actual counts in that simulated run.
- Input packets carry cumulative commands not yet processed by the server. Sequence numbers prevent double application. New commands can be applied in a burst when a delayed packet arrives.
- The server sends authoritative position and acknowledgement snapshots at the selected rate. Stale snapshots are rejected.
- Prediction applies local input immediately. Reconciliation starts at the last snapshot and reapplies unacknowledged movement. With identical unobstructed movement rules, prediction-only and reconciliation may look similar.
- The opponent pane is a second receiving client with the same downlink. Interpolation uses available snapshots and adds one snapshot interval plus the jitter allowance behind nominal downlink delay.
- The projectile fires at 0.65 s on a shared world clock. The server checks its overlap with the player at the first 60 Hz step at which it crosses the player’s x-coordinate. The collision threshold is 20 world pixels.
What this leaves out
No real network test, lag compensation, bandwidth congestion, clock synchronization, collision obstacles, anti-cheat, matchmaking, server load or game-specific rules. Arena cover is scenery. The server’s processing strategy is deliberately simplified. Results do not diagnose a real connection or establish who should have won a real match.
Built to be inspected
No sign-up, AI service or remote replay database is needed. A replay link contains settings and movement in its URL fragment. The same seed, settings and inputs produce the same simulation. Text findings and event timings supplement the visual views.
Inspired by the educational approach of Gabriel Gambetta’s netcode demo. Lag Arena’s source, arena artwork and lessons are independently implemented.
Open the playground