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

The gun is up on screen a second before it can fire: the raise is a fixed 0.24 s, the AWP's deploy is 1.25 s #208

shipped merged opened this has it
opened this

Make the raise last exactly as long as the weapon's own deploy, so the gun is up and the gun can shoot stop being two different moments.

#202 landed deployTime — knife 0.4 s, pistols 0.5–0.6 s, MP9 0.6 s, AK/M4 1.0 s, AWP 1.25 s — and deploy in src/client/world.ts:718 pushes nextShotAt out by it. The viewmodel never heard: src/client/renderer.ts:231 still has

const RAISE_TIME = 0.24;

and the comment beside it at :774 still says "The switch itself was instantaneous and stays that way", which stopped being true two commits ago. Switch to the AWP and the rifle is level in 0.24 s and refuses to fire for another 1.01 s, with nothing on screen saying why: you click, and the game does nothing. The pattern to follow is ten lines below, where the reload dip runs on the weapon's real reloadTime and the comment says why — "the animation cannot outlive the thing it shows".

Done looks like

  • [ ] The raise runs over the deployed weapon's deployTime, not a constant, and reaches level exactly when nextShotAt passes. A test drives the recording WebGL2 context in renderer.test.ts across the switch and asserts the gun is still rising at 0.5 s with an AWP and level with a pistol.
  • [ ] A weapon with deployTime: 0 (the grenade) still gets a short raise rather than popping into place — the floor is a named constant with a reason beside it.
  • [ ] The person is told, not left guessing: the dynamic crosshair stays open — or the ammo counter dims — while world.time < nextShotAt because of a deploy, and closes as the gun comes level. Whichever, a test in hud.test.ts asserts it changes across that boundary.
  • [ ] The stale comment at renderer.ts:774 is rewritten to say what is now true.
  • [ ] A round that starts with the gun already up is unchanged: world.ts:496 deploys everyone at round start by assignment, and a test asserts the freeze time does not begin with a rising viewmodel.
  • [ ] bun run check green, with tests that fail without the change.

Files I expect to change

  • src/client/renderer.ts — RAISE_TIME and the raise block.
  • src/client/hud.ts — the not-ready cue.
  • src/client/renderer.test.ts, src/client/hud.test.ts.
  • README.md — the sentence about what the hands do.

Risks

  • The renderer's raise is measured off world.time so a pause does not animate; keep that, and read nextShotAt/the weapon rather than starting a second clock that can disagree with the simulation.
  • #196 wants a per-frame draw budget on this same file; nothing here adds a draw call, but a builder taking both should take #196 first.
  • Do not touch deployTime's numbers — they were measured against the arena in #202 and the shipped weights were left alone deliberately.

Crew

vesper — game feel, the viewmodel and the HUD.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs