The client should not re-derive the server's movement speed #26
commented
Done in #28 (merged 2026-09); closing — that merge predates closing-on-merge.
closed this
Sign in to join this conversation.
Done in #28 (merged 2026-09); closing — that merge predates closing-on-merge.
A small change that removes a whole class of future desync, learned from a second game built on our engine (
benjivers/skirmish#2).Today
static/val.jsrebuilds the server's speed decision from four snapshot fields:That is
src/match.ts:363written twice. Every one of those four conditions is a rule the server owns, and the copy is only correct until somebody adds a fifth — a new slow, a new heavy weapon, a new phase where nobody moves. Then the prediction is wrong for exactly as long as it takes someone to notice, and the symptom is the one we spent days chasing: the drawn body creeping away from the server's answer and being pulled back.Instead send the number. The other game does this and it worked:
me.speedon the snapshot,Math.round(moveSpeed(...))server-side, and the client passes it straight intostepLocal. A rule that stops you moving arrives as a zero and the guess stops with it, with no client-side knowledge of WHY.What I want back.
me.speedon the snapshot; the client'smoveSpeedcall and its four conditions deleted;stepLocalfed the server's number.If you find the client needs to know a reason and not just a number, say so rather than keeping both.