Multiplayer & game networking
Real-time state sync, latency hiding, bandwidth and matchmaking.
Sync models
Who simulates what.
Authoritative server
mediumOne process owns the state and steps it at a fixed tick; clients send inputs and show returned snapshots, so a lying client only affects its own inputs.
Deterministic lockstep
mediumEvery peer runs the same deterministic simulation and exchanges only inputs; bandwidth ignores unit count, at the cost of input delay.
Deterministic fixed-point math
lowBit-identical simulation math across CPUs, compilers and builds: integer fixed-point formats, the float traps (FMA, x87, fast-math, libm), deterministic trig, sqrt and RNG.
spatial shard handoff
Planned.
simulation time dilation
Planned.
server side cheat detection
Planned.
Latency hiding
Making a laggy network feel instant.
Client-side prediction
mediumThe client applies its own inputs immediately, then on each server state rewinds to it and replays unacknowledged inputs (reconciliation).
Entity interpolation
lowRender remote entities a fixed delay in the past, blending the two buffered snapshots around that time: ~2 snapshot intervals of latency buy smooth motion.
Lag compensation
mediumThe server rewinds other players' hitboxes to the moment the shooter saw them, so hits land where the shooter aimed despite latency and interpolation delay.
Rollback netcode
mediumRun the game immediately on predicted remote inputs; when real inputs arrive and differ, restore a saved state and re-simulate to the present (GGPO).
Bandwidth
Sending less per tick.
Snapshot delta compression
lowEncode each client's snapshot as the difference from the last snapshot that client acknowledged, so unchanged entities and fields cost zero to a few bits.
State quantization
lowStore floats as small fixed-point integers sized to the precision needed (bounded positions, smallest-three quaternions), cutting size 2-4x before any delta coding.
Interest management
mediumSend each client only the entities relevant to it (spatial area of interest, visibility, team), ordered by priority accumulators to fit a per-packet byte budget.
Bitstream serialization
lowA bit writer and reader over a byte buffer that stores each field in exactly the bits its range needs: booleans in 1 bit, bounded integers in ceil(log2(span+1)) bits.
network update prioritization
Planned.
Game transport
Reliability on top of UDP.
Rating & matchmaking
Skill estimation and pairing.
Elo rating
lowOne number per competitor, moved by K × (actual − expected score) after each pairwise result; expected score is logistic in the rating difference.
Glicko-2
lowRating plus rating deviation (RD) and volatility per player, so new or inactive players move fast and established ones move slowly.
Matchmaking queue
mediumPair waiting participants into fair matches by rating and latency, widening tolerances the longer each ticket waits, so queues stay short at the edges of the skill curve.
Swiss-system pairing
mediumEach round pairs competitors with equal scores, never twice and with balanced sides; a bye covers odd counts, and about log2(N) rounds expose a winner.