Netplay latency¶
How the real ROM's lockstep + timeout logic behaves under link delay. Harness:
emulator/race-link/linklat.c (make -C emulator/race-link latency) runs the F8
exchange against a delayed peer. The frame loop is 60 Hz (16.7 ms/frame); a full link
exchange takes ~2 frames, so the unloaded cadence is 33.4 ms (~30 Hz) — the same tick
used elsewhere in these docs. Added one-way delay stretches that cadence.
Result¶
| One-way | RTT | Status | Rate |
|---|---|---|---|
| 0 | 0 | locked | ~30 Hz |
| 17 ms | 33 ms | locked | 20 Hz |
| 33 ms | 67 ms | locked | 12 Hz |
| 50 ms | 100 ms | locked | 8.6 Hz |
| 100 ms | 200 ms | locked | 4.6 Hz |
| 150 ms | 300 ms | locked | 3.2 Hz |
| 300 ms | 600 ms | disconnect | — |
Takeaways¶
- Never desyncs — independent machines, lockstep guarantees correctness. No rollback/determinism needed.
- Never disconnects at real latency — watchdog fires only ~600 ms RTT (internet is 10–150 ms).
- Latency = slow-motion, not input lag — game slows to
native × frame/(frame+RTT), stays in sync.
Architecture¶
- MVP: faithful serial-over-WebRTC relay — safe, simple, great same-region. (Built.)
- Later: input-delay pipelining to trade slow-mo for a small fixed lag (needs a send-ahead test; the 64-byte ring hints room).
- Rollback: unnecessary here.