Public: anyone can read this; the crew can change it.

forked from trevato/cs

Physics moves behind the door, replayed on today’s main: the solver in the engine, CS’s numbers in the game #70

Closed opened this
Closed without merging

`src/engine/physics.ts` is now the Quake-lineage mover with no Counter-Strike number in it: `Body`, `Wish`, `MoveTuning`, `Hull`, `accelerate`, `airAccelerate`, `move`, `groundUnder`, `stuck`, `eyeHeight` and `hullHeight`, with every tuned value a required argument in one order — subject, situation, tuning, hull: `move(body, wish, dt, boxes, tuning, hull)`, `eyeHeight(body, hull)`, `stuck(pos, hei…

stopped closed without shipping deploy 79cc5d9

opened this

src/engine/physics.ts is now the Quake-lineage mover with no Counter-Strike number in it: Body, Wish, MoveTuning, Hull, accelerate, airAccelerate, move, groundUnder, stuck, eyeHeight and hullHeight, with every tuned value a required argument in one order — subject, situation, tuning, hull: move(body, wish, dt, boxes, tuning, hull), eyeHeight(body, hull), stuck(pos, height, boxes, hull), groundUnder(pos, height, boxes, reach, hull), airAccelerate(vel, dir, speed, dt, tuning). Nothing has a default, so no call can substitute a tuning quietly. The two decisions #7 already made well are made the same way here: the duck rate of 5/s is MoveTuning.duckRate, and the two-unit floor contact stays in the solver as CONTACT, named and documented as the tolerance it is. Source's numbers are the new src/client/movement.ts — CS_MOVE, CS_HULL and fallDamage, CS's curve rather than physics.

The solver body is unchanged line for line apart from threading tuning and hull through it; the normalized diff against the old file is only those two words and the two renamed constants. Both golden digests in src/client/replay.test.ts are untouched, bit for bit — the ten-bot round and the arena duel both still pin. physics.test.ts becomes src/client/movement.test.ts with all twelve assertions it had, plus five that run the same solver under a second profile (gravity 400, a 144×48-unit hull, a 36-unit step, 500 u/s), including the hand-checked apex v²/2g = 301.993²/1600 ≈ 57.0 units under CS and ≈ 114.0 under half gravity with hang time doubling. I checked each of those bites by re-baking the constant back into the engine one at a time: gravity fails the apex test, hull.radius fails three, stepSize and wish.maxSpeed one each.

The door gains the physics paragraph and its eleven names, boundary.test.ts's pinned SURFACE gains them in the same review line, and GUIDE.md gains the physics section guide.test.ts has been asking for since it was written — with the seam table's tuning row and section 6 corrected, since the engine now holds one tolerance more than the loop's two. The six call sites follow mechanically (world.ts, combat.ts, observe.ts, hud.ts, scene.ts, scene.test.ts) and nothing else changed; src/rl/arena.ts needed nothing, since it moves only through world.applyInput. bun test is 435 pass / 0 fail in 4.24 s, and the rebuilt static/app.d819b38eea.js is 70,642 B raw against the 75,400 ceiling — 84 bytes more than before, so no ceiling moved. The range bundle's hash changed with no change in size or behaviour: physics is tree-shaken out of it, and only the minifier's identifier assignment shifted.

What I chose not to do: nothing touches torque/3-…, pull #7 is still a person's decision, and I left src/range/main.ts's "nothing to move until the engine's physics lands" comment alone for #13 to take with the walking. In the preview, movement should feel identical — run, strafe-jump, crouch under the low doorway and step the crates on de_forge.

🤖 Generated with Claude Code

Closes #62

commented

You've hit your weekly limit · resets Sep 20, 2am (UTC)

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs