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 #62
Parked by the crew: the check stayed red through 2 automatic tries (pull #70 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.
Parked by the crew: the check failed and the decider saw no point in another try (pull #120 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.
Split, not rewritten. This is now the umbrella and waits for #122 → #123 → #124; it closes itself when they land, and nobody should pick this one up directly.
Why: two runs have died on it as one piece (pull #70, then pull #120), and as written it moves a file, re-signatures nine functions, follows six call sites, splits a test file, adds a second tuning profile, rebuilds the bundle and edits the README — every one of which has to be right for the digest to hold. The three steps are the same work in the order that keeps bun test green and the golden digests unchanged at each stop:
- #122 — the tuning becomes required arguments, in place. No file moves; this is where the design decisions are.
- #123 — the solver moves to
src/engine/physics.ts, CS's numbers becomesrc/client/movement.ts, the door gains the paragraph. - #124 — a second profile proves it is general: half gravity, a taller hull, a bigger step, one apex checked by hand.
Everything queued behind this issue — #3, #18, #63, #67, #113 — stays queued behind it and needs no re-pointing.
Delivered, by the split rather than by this issue: #131 made the tuning arguments in place and #140 moved the solver to src/engine/physics.ts with Counter-Strike's numbers in src/client/movement.ts. src/engine/index.ts exports the physics group and the golden digests did not move.
Closing it, so that what was queued behind it — #18, #63, #67, #113 — is ready rather than waiting on an issue whose work is already on main. #124 (a second tuning profile, the test that proves the solver is general) is still open and still worth doing; it stands on its own.
Physics is the last module the direction's headline names that is still in the game:
src/client/physics.tsholds a general solver and Counter-Strike's numbers in one file, so the range cannot walk and the shooter's tuning cannot be told apart from the mathematics. This issue is #3's work, replayed on today'smainrather than rebased.Why a new issue: pull #7 carries #3 and has not been touched in twenty hours; it does not merge, and its seven conflicting files are the import lines that #25's door, #47's scene split and #49's overlay rewrote underneath it. Its description is the best design note in this repository and worth reading first — but replaying it on
a024b3f+ is smaller work than rebasing it, and #18 and #13 have waited long enough. A person decides what happens to #7 itself; nothing here touches that branch.Done looks like
src/engine/physics.tsmoves any body through any set of boxes and holds no Counter-Strike number:Body,Wish,MoveTuning,Hull,accelerate,airAccelerate,move,groundUnder,stuck,eyeHeight,hullHeight, with every tuned value a required argument in one boring 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). No parameter has a default, so nothing can substitute a tuning quietly.src/client/movement.tsasCS_MOVEandCS_HULL, withfallDamage— CS's curve, not physics — beside them. The duck rate of 5/s becomesCS_MOVE.duckRate; the two-unit floor contact stays in the engine as the solver tolerance it is, named and documented as one rather than dressed up as tuning.src/engine/index.tsgains the physics paragraph and exports it;boundary.test.tsandpurity.test.tsstay green with no rule loosened, and the door stays cheap to import.world.ts,combat.ts,observe.ts,hud.ts,scene.tsandphysics.test.ts— which becomessrc/client/movement.test.ts, because a test that knows CS's numbers belongs to the game.src/client/replay.test.tsare unchanged: both pins, bit for bit. An extraction that moves a digest has changed the game, and the pull says so instead of moving the constant.bun testgreen with its total time stated, the bundle rebuilt withbun run scripts/build.tsand the newstatic/app.<hash>.jscommitted with its ceiling from #39 held, andREADME.md's engine list gains physics.Files I expect to change
src/engine/physics.ts(moved fromsrc/client/physics.ts),src/engine/index.ts,src/client/movement.tsandsrc/client/movement.test.ts(new, fromphysics.test.ts),src/client/world.ts,src/client/combat.ts,src/client/observe.ts,src/client/hud.ts,src/client/scene.ts,src/client/scene.test.ts,README.md,static/app.<hash>.js.Risks
The digest is the whole safety net: run it before touching anything, keep the argument order identical at every call site, and do not tidy the solver while moving it — a reordered clamp is a different game. Read pull #7's description for the two decisions already made well (the duck rate as tuning, the contact tolerance as a solver constant) and make the same ones.
hud.tsis also #18's file andscene.tsis #47's: takemainfirst, land this, and let those rebase on it rather than the other way round.Suggested: Torque — #3 is theirs, the design is already written, and this is the replay.