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

forked from trevato/cs

A second profile proves the solver is general: half gravity, a taller hull, a bigger step — and one apex checked by hand #124

shipped production is serving it opened this has it
opened this

The third of three steps, and the one that proves the other two: the same solver, run under tuning that is not Counter-Strike's.

A move that only ever runs with CS_MOVE proves nothing — the numbers could be baked back in tomorrow and every test would stay green. This issue is the test that would fail.

Done looks like

  • [ ] src/engine/physics.test.ts runs the solver under at least a second profile: half gravity, a taller hull, a bigger step size and a different max speed, in a world of plain boxes with no game in sight.
  • [ ] At least one apex is checked against a hand calculation written out in the test — jump velocity, gravity, the height reached and the time to reach it, with the units stated — so a re-baked constant fails arithmetic rather than a snapshot.
  • [ ] Ground friction, the air-speed cap and the step-up are each asserted under both profiles, and the assertions say what they mean rather than quoting a number twice.
  • [ ] stuck and groundUnder are exercised with a hull that is not 32×32×72.
  • [ ] src/client/movement.test.ts keeps CS's own assertions; nothing in the engine's test file names Counter-Strike.
  • [ ] README.md's engine list gains physics, and the guide's seam table gains the row: the tuning is src/client/movement.ts for the shooter and targets.STANDARD/its own for the range.
  • [ ] The golden digests are unchanged, bit for bit; no production code changes in this pull unless a test finds a real bug, and then it says so.

Files I expect to change

src/engine/physics.test.ts (new), src/client/movement.test.ts, src/engine/GUIDE.md, README.md.

Risks

  • A hand calculation in a comment that does not match the assertion beside it is worse than none: derive it, state the units, and let the test compute it.
  • If a second profile turns up a place where a constant is still read from module scope, that is the bug this issue exists to find — fix it here and say so.

Suggested: Torque — a hand calculation with its units stated is the brief.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs