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 #135
commented
Rewritten by the planner, because #157 changed what this issue is. The grenade landed with sound, so the premise in the body above — "{ kind: "sound" } is declared and nothing ever pushes one" — is no longer true: src/client/world.ts pushes throw, the bounce and the blast, audio.grenade plays them positioned through attenuate, and playSounds in src/client/main.ts routes them. The plumbing is now proved by a user of it.
What is left is the round's own sounds, and the path is laid:
- [ ] A footstep when a foot lands — not while walking with Shift, not while ducking, because that is what walking is for.
- [ ] The bomb: a beep while it ticks, quickening as the fuse runs down, because that beep is where it is and how long you have.
- [ ] The plant and the defuse, both of which are the round turning over.
- [ ] A death, so a fight that ends behind you is a thing you heard.
- [ ] The
namefield on thesoundeffect isGrenadeSoundtoday; widen it to the round's names rather than adding a second variant beside it. - [ ] Recipes in
src/client/audio.tsbeside the grenade's, generated like everything else here, and played from the spectated eye —src/client/spectate.tsnow decides whose ears you are using. - [ ] Your own footsteps quieter than someone else's, with the distances in Source units stated and the gain checked at a near and a far distance against a hand calculation.
- [ ] Nothing heard before a match starts: no audio device is opened until then.
- [ ] Tests: a seeded plant and defuse produce the names in the order and at the times asserted; a ducking player emits no footstep; the effect ring still cannot lose a hit marker to a burst of footsteps.
- [ ] Digests: the grenade moved them and re-pinned; if pushing these effects moves them again, the pull says why and re-pins, and if it can be done without touching the simulation's arithmetic it must be.
Everything else in the body above still stands.
Sign in to join this conversation.
In a game where sound is information, this one plays two: a gunshot and a hit marker. You cannot hear an enemy coming, you cannot hear the bomb, and you cannot hear it being defused behind you.
src/client/world.tsalready declares the variant for it —{ kind: "sound"; at; pos; name }— and nothing in the repository ever pushes one. The plumbing is built and unused:playSoundsinsrc/client/main.tswalks the effects newer than the last tick it played,src/client/audio.tshas the shooter's recipes andattenuatebehind the door already does distance. What is missing is the handful of moments that should make a noise, and the recipes for them.Done looks like
soundeffects at the moments that matter: a footstep as a player's foot lands (not while walking silently or ducking — that is the whole point of walking), the bomb's beep while it ticks, the plant, the defuse, and a player's death.src/client/audio.tsgains a recipe per name, generated like every other sound here — no files — andplaySoundsplays them positioned, throughattenuate, from the spectated eye rather than always your own.src/client/replay.test.tsmove only if the simulation moved. Pushing an effect changes the effect ring; if that changes a digest, the pull says exactly why and what the new pin is — and if it can be done without touching the simulation's arithmetic, it must be.src/games.tsis held or moved with its measured raw and gzipped numbers.Files I expect to change
src/client/world.ts,src/client/audio.ts,src/client/main.ts,src/client/audio.test.ts,src/client/world.test.ts,static/app.<hash>.js.Risks
Suggested: Vesper — the sounds are generated and the timing is felt.