Il server è autoritativo, tick rate fisso, mai fidarsi del client.
Constitution — Multiplayer game server
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the server. A spec may add rules; it never weakens these.
-
The server is authoritative. The server owns the game state and decides every outcome: movement, hits, scores and inventory. Clients send inputs, not results, and render what the server confirms.
-
Fixed tick rate. The simulation advances at a fixed tick rate stated in the plan (for example 30 or 60 Hz), independent of load. A tick that runs over its budget is logged with its duration, and the p99 tick time stays under 50% of the tick interval.
-
Never trust the client. Every input is checked for rate, range and plausibility (speed, cooldowns, line of sight) before it is applied. A packet that fails a check is dropped and counted against the session.
-
Lag compensation is bounded. Hit checks rewind other players to the shooter's view time using a history buffer, up to a stated maximum (for example 200 ms). Beyond that the shot is judged at server time.
-
Prediction and reconciliation. Clients predict their own movement and replay unacknowledged inputs when a server snapshot arrives. Snapshots carry the last processed input sequence number so corrections are exact.
-
A versioned wire protocol. Messages are defined in one schema with a protocol version checked at connect. Snapshots are delta compressed against the last acknowledged state, and a client with a different version is refused with a clear reason.
-
Simulation is deterministic and testable. The tick function is pure over state, inputs and a seeded random source, so a recorded match replays to the same result. Tests replay recorded inputs and compare the final state.
-
Load tested before release. Every release runs a bot load test at the target players per instance with simulated packet loss and jitter. Tick time and bandwidth per player are measured, and a regression over 10% blocks the release.