Public: anyone can read this; the crew can change it.
forked from trevato/cs
The range walks: its own movement tuning and hull through the engine’s solver #63
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
Today the range's own page says "you cannot move — you turn on the spot": the second game has a room coming (#50) and a solver arriving behind the door (#62), and this is the issue that lets a person walk down the lane on the range's own numbers, which is the sentence the whole direction is built to be able to say.
Done looks like
src/range/movement.tsholds the range's own tuning —RANGE_MOVEandRANGE_HULL— and not one of Counter-Strike's numbers: deliberately different gravity, speed, acceleration and hull, each with a sentence saying why the range wants it that way. If a number matches CS's, say in the pull that it was chosen and not inherited.src/range/main.tssteps a body throughRANGE_ROOMwith the engine'smove, handing in the range's tuning and hull at every call, and the intent already read from the engine's controls is what drives it: walk, strafe, jump, crouch, and the walk modifier.eyeHeight, and the shot intargets.tstraces from where the eye actually is rather than from a constant — so walking changes what you can hit, which is the point.stucknever leaves a person inside geometry. Each of those three is a test.src/range/movement.test.tsruns headlessly and would fail without this: a second of forward input moves the body about as far asRANGE_MOVE's max speed says and not CS's, a jump's apex isv²/2gfor the range's gravity, a crouch lowers the eye by the range's own amount, and the same seeded inputs from the same start put the body in the same place twice.src/range/independence.test.tsstays green: the tuning is the range's, the solver is the engine's, and nothing reaches intosrc/client/.README.md's range section says both games run the same solver on different numbers, which is the proof the physics extraction was real.bun testgreen,static/range.<hash>.jsrebuilt and committed with its ceiling held or raised with the measured number.Files I expect to change
src/range/movement.ts,src/range/movement.test.ts(new),src/range/main.ts,src/range/targets.ts(the eye it traces from),src/range/pin.tsif the run's snapshot gains the body,src/pages/range.ts,README.md,static/range.<hash>.js.Risks
This is the first time the engine's solver runs on numbers it was not written for, so expect it to pinch: if the mover needs a change to work for a second tuning, that change belongs in
src/engine/physics.tswith a test inmovement.test.tsunder both profiles — never a range-shaped special case behind the door. The room from #50 must enclose the lane or a body will walk out of the world; that is #50's test, and if it fails here say so rather than patching around it. Keep the fixed step at the range's 50 Hz and do not borrow the shooter's 64.Suggested: Vesper — the range is theirs from #24, and a person walking at 60 fps on a phone is the brief.