Lesson 1 of 9 · 27m
Client-Server Authority Is the Game
Establish the server as the owner of consequential state, define what clients may propose, and design authority boundaries that survive hostile input.
The first multiplayer prototype I inherited let clients send their positions directly to the server. It felt smooth in the office demo and collapsed the week players discovered memory editors. Nobody needed a sophisticated cheat; they just wrote the number they wanted. Netcode starts with a colder rule: the client is a remote control with a screen attached, not a peer you trust.
Authority means ownership of consequences
An authoritative server decides the outcomes that matter: positions after collision, health, hits, inventory, money, match state, and whether an action was legal at a particular tick. The client can propose input — move forward, aim here, press use — but the server decides what happened.
client input -> server validation -> simulation -> snapshot -> clients
local prediction -> immediate feel -> correction if server disagreesThis is not just a security architecture. It is how multiple players share one reality. Without a single owner of state, lagging clients stop being imperfect observers and become competing authors.
Divide state by authority, not by convenience
Make the authority boundary explicit in design documents and message schemas:
server-owned health, ammo, inventory, positions after physics, match score
client-owned camera yaw, local UI, cosmetic particles, input device state
client-proposed movement input, ability activation, target selection
server-adjudicated hit registration, purchases, trades, pickups, objective captureSome games deliberately delegate limited authority. A co-op PvE game may trust clients more than a ranked shooter. The important part is writing down the risk you accepted. "The client owns this because implementation was easier" is not a trust model; it is future incident response.
Input messages should look like intentions
Do not accept a desired final state when an input would do:
{
"type": "input",
"seq": 10492,
"tick": 88410,
"move": [0.71, -0.71],
"buttons": 9,
"view_yaw": 182.4,
"view_pitch": -7.5
}Compare that with "position": {"x": 931.2, "y": 4.0, "z": -88.9}. The first can be validated against acceleration, collision, cooldowns, and state. The second is just a claim.
Server authority is a spectrum
Physics objects, chat, spectators, replays, and cosmetics do not all deserve the same control cost. Server authority is strongest where one player can affect another: damage, movement collision, resources, objectives, and persistent inventory. You may simulate ragdolls or debris locally because their disagreement does not change competitive truth.
The minimum viable control loop
A robust server loop receives ordered inputs, validates them in context, simulates the world at a tick, and emits state updates:
for msg in transport.drain_inputs():
player = world.player(msg.player_id)
if player is None or msg.seq <= player.last_input_seq:
continue
cmd = sanitize_input(msg)
player.queue_input(cmd)
world.tick()
transport.broadcast_snapshot(world.snapshot())The details change by engine. The order does not: input first, validation in server context, simulation second, publication last.
Field notes
- "Server authoritative" means nothing if a debug message, admin command, or replication shortcut can overwrite the same state.
- Do not use authority as an excuse for awful feel; prediction exists precisely because the server remains authoritative.
- Spectators and replays must consume server truth, not the cheating client's rendering of events.
- The most dangerous sentence in netcode review is "the client already checked that." The server checks because the client may be modified.
Was this lesson helpful?