Skip to content

Stage 3.9 — Procedural Audio - #17

Open
QemmHD wants to merge 2 commits into
stage-3.8b-atmospherefrom
stage-3.9-audio
Open

Stage 3.9 — Procedural Audio#17
QemmHD wants to merge 2 commits into
stage-3.8b-atmospherefrom
stage-3.9-audio

Conversation

@QemmHD

@QemmHD QemmHD commented Jun 19, 2026

Copy link
Copy Markdown
Owner

The game's first sound — 100% synthesized WebAudio (no asset files). Pure presentation: AudioSystem only listens to the EventBus + reads a per-frame tension snapshot; it never touches the simulation.

Stacked on #16 (3.8B). Diff is audio-only; retarget to main after #16 merges.

Sound

  • Combat thud, tonal metallic door slide/clang (no noise), typed event cues (fight/lockdown/search/critical/guard/warning/trade), UI confirm on success / soft "no" on failure.
  • Ambient bed: a sine hum that's near-silent when calm and swells with riot pressure; ducked overnight + when paused.
  • Alarm: a brief warble on lockdown/alarm onset (not a continuous klaxon).
  • Mute toggle in the topbar (🔊/🔇), persisted to localStorage; AudioContext unlocks on first tap (mobile autoplay-safe).

Invariants

  • Render/presentation-only; RenderSync + AudioSystem never write sim state. Save format unchanged (v12).

Verification

  • npm run typecheck + npm run build green (49 modules); headless-Chrome smoke test green (0 console/page errors, self-test clean, mute button renders).
  • Adversarial multi-agent review run; all 7 confirmed findings fixed (door-clang-on-load, small-phone topbar overflow, failure-chime, volume clamp, leaked unlock listeners, fragile glideTo).
  • Playtest feedback addressed: noise-based door/ambient sounds ("static") reworked to tonal synthesis; long repetitive alarm klaxon → brief onset warble.

What's next

Toward a modern Hard Time — candidate next stages: settings menu (volume slider + difficulty), world expansion, or a sentence/notoriety meta-loop.

🤖 Generated with Claude Code

QemmHD and others added 2 commits June 19, 2026 06:07
100% synthesized WebAudio (no asset files), pure presentation (read-only bus
listener; never touches the sim). Typecheck + build green, smoke test clean.

Sound: combat thud, tonal metallic door slide/clang, typed event cues, UI
confirm/deny, a sine ambient bed that swells with riot pressure (near-silent
when calm), and a brief alarm warble on lockdown onset (not an endless klaxon).
Topbar mute toggle, persisted to localStorage; AudioContext unlocks on first tap.

Adversarial-review fixes:
- Re-prime door state on Load/New-Run (no stray clang).
- Topbar chips/mute-button shrink+wrap on small phones (no overflow at lockdown).
- actionResult plays confirm on success, soft 'no' on failure.
- Clamp persisted volume; detach unlock listeners after first use; drop fragile glideTo=0.

User feedback addressed: noise-based door/ambient sounds (read as "static")
reworked to tonal synthesis; long repetitive alarm klaxon -> brief onset warble.

Version -> v3.9.0-audio; CHANGELOG 3.9 entry + README updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per playtest feedback ("i like a little long, just the noise was bad"): the alarm
is sustained again while a lockdown/alarm is active, but as a SMOOTH triangle
hi-lo siren with gentle tremolo + soft fade in/out — not the harsh square klaxon
and not the too-brief onset warble.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
QemmHD added a commit that referenced this pull request Jun 19, 2026
…sentence spine

3.8B: cinematic CSS atmosphere, fake-bloom glow, ground glow (#16).
3.9: procedural WebAudio — SFX, ambient bed, smooth alarm, mute toggle (#17).
4.0: the sentence spine — serve a term, time-off/added-time, RELEASED/ESCAPED/GAME OVER endings (#18).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant