Split The code is public; the app answers only to the crew.

On a phone every step is heard: footsteps go quiet on the Shift flag, not on how fast you are moving #224

open told opened this
opened this

Intent: whether you are heard depends on how fast you are moving, as it does in CS, so a thumb that pushes the stick halfway walks as quietly as a Shift key does.

What is true today (at 3118dc1)

  • footsteps (src/client/world.ts:1250) goes quiet only on p.ducking || wish.walk, so it checks the flag and never the speed.
  • A phone has no way to set that flag: pages/game.ts:402–419 has crouch, jump, use, reload, buy, radio, scope and fire, but no walk. Meanwhile move (physics.ts) already scales wish speed by how far the stick is pushed (Math.min(1, hypot(forward, side)) * maxSpeed). So a stick at half travel moves you at walking pace (~125 u/s) and every stride still sends a step sound.
  • Bots listen for those sounds (bots.ts:394, hearing.ts), so on a phone you can never sneak up on anyone, and the stick's analogue range buys you nothing.

Done looks like

  • [ ] One named constant, e.g. QUIET_SPEED in physics.ts next to MOVE (a few units above MOVE.walkSpeed, e.g. 135). A doc comment says what it is and why its value sits where it does.
  • [ ] footsteps stays silent when the player is ducking or their horizontal speed is at or below QUIET_SPEED. Whether the walk flag is set no longer matters for sound, because Shift-walking is ≤130 u/s and gets its silence from the speed.
  • [ ] world.test.ts covers four cases: (a) a stick-style input at forward: 0.5 on flat ground for 2 s makes no step effects; (b) forward: 1 makes steps; (c) Shift-walk at full stick is still silent; (d) a runner who releases the keys goes quiet as friction takes them under the threshold. (a) fails on main today.
  • [ ] The touch help text on the page, and the README's controls section, say that pushing the stick partway walks quietly. pages/game.test.ts asserts the sentence is there.
  • [ ] bun run check is green.

Files: src/client/physics.ts, src/client/world.ts, src/client/world.test.ts, src/pages/game.ts, src/pages/game.test.ts, README.md.

Risks

  • The bots hear the new rule too. A bot that slows down near a corner could now go quiet where it used to be heard. That is right, but the pull should say whether scripts/measure.ts (a short seeded run on each map) moved the round split, and #209's policy card should be treated as one more change out of date.
  • Keep observe.ts untouched: the shipped policy's inputs must not change shape.
  • Waits for #189 (tagging, in progress), which edits the wish speed in applyInput a few lines above footsteps.

Suggested brief: vesper (simulation rules and their tests).

commented

Unblocked: #189 landed as pull #226 (92c74d7), so this issue is ready. Read it against main at 56838f9; two things changed under it:

  • The wish speed is now Math.min(MOVE.maxSpeed, w.carrySpeed) * (1 - p.tag) (world.ts:1320), and a hit can take up to half of it for up to 0.5 s. Under the speed rule, a tagged runner briefly drops under QUIET_SPEED and goes quiet. That is intended: speed decides, whatever the cause. Add a fifth test that pins it: a runner tagged to half speed makes no step for the tagged stretch, and makes steps again once tag recovers. That way nobody later fixes it by exempting tags.
  • Line numbers have moved: footsteps is no longer at :1250, so find it by name. Nothing else in the acceptance criteria changes.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs