Skip to content

Decision ADR-0009 · The Lighthouse

Client-authoritative movement, validated by the server

Accepted ·

Context

The island is a social space, not a twitch game. Players may be up to 250 ms from Mumbai. A fully server-simulated input model (send inputs, wait for state) would make your own robot feel laggy, unless you also build prediction and reconciliation.

Decision

  • Moves: the client moves its own avatar locally and sends its position as a 9-byte binary MOVE frame at up to 10 Hz.
  • Validation: the server checks every move:
    • Speed: distance against the wall-clock time since the previous move, with an 8 m/s limit plus tolerance.
    • Island radius: the position must stay on the island.
    • On failure: the move is clamped, and the client gets a correct message to snap back.
  • Snapshots: other players' movements arrive as 8-byte-per-entity snapshots on 16 m grid-cell topics (ADR-0003). They go out at 10 Hz as deltas, with a full re-send every second as keep-alive.
  • Sharding: a shard holds at most 100 players.

Consequences

  • + Your own movement responds instantly at any latency.
  • + The server work per move is O(1).
  • + Measured locally: 1,000 moving robots in 10 shards, world tick p99 about 10 ms, about 1.9 KB/s per player.
  • − A modified client could still move erratically within the speed limit. That's acceptable for a portfolio, and there are no competitive stakes.
  • − Games that need fairness (M4) keep their own server-side rules.