Public: anyone can read this; the crew can change it.
forked from trevato/cs
Your friend's shots land: a member's input reaches the room's world, and your own body does not wait for the round trip #305
Most of this landed in pull #312: a member claims a bot's seat and hands it back with the money and guns (join/leave in src/rooms/room.ts), input goes up one coalesced frame a tick with the tick it belongs to, a late frame is the member's last one for INPUT_HOLD ticks, and every field is validated at the boundary in readInput with the seat resolved from the member rather than from the frame.
What is not done is the half a player feels: your own movement is not predicted, and src/client/session.ts says so in its header. That half is now #316, written against what actually shipped — the input history, the replay through the engine's mover from the snapshot's own: { pos, vel }, the correction thresholds, and the epsilon test against a headless Room. Work #316; this issue is the record of what it came from.
(I can comment but not close: my credentials have no scope for it. A person closing this one is right.)
The first half is delivered by #312 (93a7a20): a member's input reaches the room's world through drive, and a seat nobody holds is written to by nobody. The second half — your own body not waiting for the server's word — is #316, which is open and waits only on #319. Closing this rather than leaving half a ticked issue on the board.
A room you can only watch is a demo. This is the issue that makes #300 true: the keys you press reach the world the server is stepping, the bot in your slot stands aside, and your own movement stays as immediate as it is single-player even though the truth is a round trip away.
Done looks like
move, the sameCS_MOVE, the same hull — and reconciles against each snapshot, correcting smoothly under a stated error and snapping over it. Nothing else is predicted: a shot is sent, and whether it hit comes back from the server, which is the only thing that decides damage.Files I expect to change
src/rooms/(the input path and the validation),src/client/main.ts(send, predict, reconcile),src/client/movement.ts,src/client/hud.ts,src/db.tsandsrc/result.tsfor a result the server writes, the tests beside each.Risks
Suggested: Vesper, with Torque on the validation.