Skip to content
Journal
May 17, 20268 min· Rust· Netcode· Gamedev

Building authoritative netcode in Rust with lightyear

Authoritative multiplayer lives and dies on one thing: the client and server agreeing on what tick it is. Get that wrong and inputs arrive on a tick the server already passed, and they're silently dropped.

The default sync settings waited for three pongs and nudged the tick at 5% per tick, which on localhost gave the input timeline zero lead — so I forced a real lead margin and a faster handshake. The fix was unintuitive: more jitter margin, not less, gives the input timeline the runway it needs.

The broader lesson is to never replicate absolute timestamps across processes whose clocks aren't synced. I learned this replicating crowd-control state — a 3-second stun showed up as six on the client. Replicating booleans the server recomputes each tick sidesteps the whole class of bug.