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

forked from trevato/cs · proposes · 4 behind

The solver moves behind the door: src/engine/physics.ts, and Counter-Strike's numbers become src/client/movement.ts #140

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed. `bun test` is green: 619 tests across 66 files in 9.5–11.3 s, and the two files that hold the golden digests — `src/client/replay.test.ts` and `src/range/pin.ts` — are untouched, so both games' pins hold to the byte.

shipped production is serving it deploy ae07c2d

opened this

Pushed. bun test is green: 619 tests across 66 files in 9.5–11.3 s, and the two files that hold the golden digests — src/client/replay.test.ts and src/range/pin.ts — are untouched, so both games' pins hold to the byte.

---

src/client/physics.ts is now src/engine/physics.ts, and the diff is what the issue asked for: a rename, two import lines and a docstring. Git reads it at 84% similarity, and the only code that left is MOVE, HULL and fallDamage. Body, Wish, MoveTuning, Hull, accelerate, airAccelerate, move, groundUnder, stuck, eyeHeight and hullHeight are behind the door; Box now comes from the engine's own trace.ts, so the solver names no game's level module; and the module imports ./math.ts and ./trace.ts and does nothing at import time, so the door is as cheap as before.

Counter-Strike's numbers stayed in the game as src/client/movement.ts: CS_MOVE, CS_HULL, fallDamage — a curve this game chose rather than a consequence of the arithmetic — and nothing else. physics.test.ts became movement.test.ts with every assertion it had, including the second-tuning half that runs the same functions on half the gravity and a hull twice the size. The callers changed by an import line each: world.ts, scene.ts, combat.ts, observe.ts, models.ts, hud.ts and the two tests that read the hull.

src/engine/index.ts gains the physics paragraph and the eleven names; boundary.test.ts gains them in its pinned SURFACE and as a group in the comment above it; GUIDE.md gains the section that guide.test.ts demands of anything behind the door — what a game brings, that nothing has a default, and that fall damage is on the other side of the door on purpose. No rule was loosened anywhere: purity.test.ts and src/independence.test.ts pass as written, and the two fixtures that named ./physics.ts from src/client/ now name ./movement.ts because that is the file that exists.

Sizes, measured on the bundles this branch commits: app 72,132 raw / 33,552 gzipped (from 72,128 / 33,546), range 28,980 / 12,323 (from 28,978 / 12,319), example 8,754 / 4,228 (raw unchanged to the byte). Four bytes on the shooter is the rename; the other games gained a handful because the minifier hands out different short names over a module graph that changed shape, as in #106, #107 and #110. All three ceilings held, none moved. That the range and the example ship none of the solver is a test rather than an inference: src/range/bundle.test.ts reads the committed file for airSpeedCap, duckRate, jumpVelocity and stopSpeed and finds none, while src/client/bundle.test.ts finds all four and the jump velocity itself.

Two things I changed beyond the file list, both because the move made them false: the range's page said "the eye stands at the firing line until the engine's physics lands" and a comment in src/range/main.ts said the same — the mover has landed, and what is missing is a tuning of the range's own, which is what they say now. What I chose not to do: give the range a MoveTuning (that is a different pull), and add a test under src/engine/ duplicating the solver's behaviour — the assertions live with the numbers they are about, in the game, exactly as the issue asks.

To try it in the preview: / plays as before, jump-and-strafe feels identical, crouching under the crates still refuses to stand up, and /range is unchanged. src/engine/GUIDE.md is the page to read for the new paragraph.

🤖 Generated with Claude Code

Closes #123

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs