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

The gun says what it is doing: a muzzle flash, a reload you can see, and a raise when you switch #106

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed. Preview builds from the branch. The gun in your hands and every gun on the map now show what they are doing.

Notes

shipped merged

opened this

Pushed. Preview builds from the branch.

The gun in your hands and every gun on the map now show what they are doing. A muzzle flash is six additive spokes out of a bright core, alive for 0.06 s (three frames at 60 Hz) and sized by weapon kind: it is drawn on the held model at the muzzle models.ts declares, and in the world at every other shooter's gun off the { kind: "shot" } effect, so a firefight across the site reads as people firing instead of lines appearing in the air. It costs no new GL object — the vertices go in the existing line buffer, 12 per shooter, 120 of 4096 with ten people firing at once — so the context-restore path in build has nothing extra to rebuild, and the flashes are split off the opaque lines into their own blendFunc(ONE, ONE) draw, leaving tracers and sparks looking exactly as they did. A reload is sin(π · progress) through the weapon's own reload time, so the model drops away, rolls, and is level again exactly when reloadUntil passes; a weapon you switch to rises over a fixed 0.24 s that the renderer owns. Both are animation only — no nextShotAt, no deploy rule, nothing observe.ts or the arena can see, and a test asserts the player is structurally unchanged by a frame.

One thing outside the file list: { kind: "shot" } gains a shooter id in world.ts. mine cannot answer "is this the gun the camera is behind", because a dead player watches a teammate shoot and would get that teammate's flash both in their hands and exploding at the camera's eye; the id gives the same rule the player mesh uses, and it is what lets the world flash sit at the end of the shooter's gun rather than in the middle of their face. It is data, not a rule: nothing in the simulation or the RL observation reads effects.

Frame time, same machine, renderer.draw against the recording context (this environment has no GPU, so this is the CPU half of a frame and not a GPU one) — median of five passes of 20 000 draws: a quiet frame 0.0050–0.0085 ms before, 0.0066–0.0072 ms after, which is inside the noise; the busiest frame I could build (all ten players firing, ten tracers, ten spark bursts, six bodies) 0.0057–0.0064 ms before, 0.0098–0.0110 ms after. Nothing new is allocated per frame: the per-kind muzzle answers are frozen and built once in models.ts, and the camera's right/up are six numbers rather than tuples.

bun test is green (384 pass). Worth looking at in the preview: fire a pistol and then the AWP to see the size change, hold reload and watch the gun come back level exactly as the HUD's "reloading" clears, press 1/2/3 for the raise, and watch a bot duel across mid — the flashes are what to check for placement while they duck and turn.

🤖 Generated with Claude Code

Closes #70

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs