Public: anyone can read this; the crew can change it.
forked from trevato/cs
The round is audible: footsteps, the bomb's beep, the plant and the defuse — through the effect that already exists #208
Check · Review · Land · Live done — Landed and live in production.
Pushed; branch is level with its remote and `bun test` is green (926 pass).
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
Pushed; branch is level with its remote and
bun testis green (926 pass).The round now makes noise.
src/client/world.tspushes five moresoundeffects through the path #157 built: a footstep when a foot lands, the bomb's beep, the plant, the defuse and a death. A stride clock on each body (STEP_DISTANCE85 Source units — a 1.5 m stride, so a foot lands every 0.34 s at the 250 u/s cap) is held at zero while a body walks, ducks, is in the air or is under 140 u/s, so walking with Shift is silent and banks nothing to spend when the key comes up. The fuse's cadence isbeepIntervalinsrc/client/bomb.ts: a straight line from 0.9 s between beeps at the plant to 0.12 s at zero, ticked once a tick for the one bomb rather than once per player. Thesoundeffect's name widened fromGrenadeSoundtoSoundand it now carriesby, the id of whoever made it (-1 for the bomb), which is how the frame decides that a footstep is yours:playSoundscompares it against the spectated eye, not against your own body.src/client/audio.tsgains a recipe per name, generated from the same two voices as everything else — no files. Distances, in Source units: a footstep is at full recipe gain inside 256 and falls as 256/d past it (a quarter at 1,024, a tenth at 2,560); the bomb's three noises carry to 600, a death to 400. Your own boots are 0.35 of somebody else's, so 0.105 against 0.3 at the same spot.audio.test.tschecks those gains against the hand calculation with the numbers written out rather than recomputed from the constants.On the digests: sound is not part of the simulation, so they did not move —
replay.tshashes players, grenades and the match, never effects; no emitter draws a random number; and the stride and the beep clocks are outputs nothing reads back.ROUNDandDUELare unchanged to the character, which is the real measurement here.Worth a look in review:
src/client/world.test.tsdrives one round through a plant and a defuse with the ring drained the way the frame drains it, asserting the names, the order and the times (the plant atplantTime, the first beep on the same tick, gaps that shrink, the cut wire last) and then plays the lot through a recorder device; and the ring test, which pushes a hit marker and then runs ten bodies for 1.9 s of footsteps to show it cannot be displaced — the loudest two seconds the round's own noises can make is 59 footsteps and 17 beeps against a 4,096 cap. The app bundle grew 1,516 raw / 467 gzipped to 95,230 / 43,006; it fits the 96,000 / 43,500 ceiling, so I held it, but with 770 raw and 494 gzipped to spare that is now the thinnest headroom insrc/games.tsand the next feature will want it raised. The mute path is untouched for #69, and nothing opens an audio device before Play is clicked —main.test.tsasserts the voice is asked for nothing while the menu is up.🤖 Generated with Claude Code
Closes #135