Skip to content

Anchor overhead-camera audio at the ground focus - #1996

Merged
Noisemaker111 merged 7 commits into
betafrom
audio-listener-ground-focus
Oct 20, 2026
Merged

Noisemaker111 merged 7 commits into
betafrom
audio-listener-ground-focus

Conversation

@Noisemaker111

Copy link
Copy Markdown
Owner

Positional sound was silent in top-down and RTS games.

  • shell/audio/listenerAnchor.ts: groundFocusListener puts the listener where the camera's view ray meets the ground (lifted 2 m, clamped to 400 m), or keeps the camera position when the view never reaches the ground.
  • AudioListener takes anchor; Shell3dPresentation passes "ground" for rts/topDown rigs and "camera" otherwise.
  • Tests for overhead, horizontal/under-ground and grazing views; changes/audio-listener-ground-focus.md.

Root cause: the listener tracked the camera, which these rigs hold 35–50 m above the play surface, beyond the 24 m default falloff. While adding sound to Beacon Bastion (topDown, height 38) and Brightway Park (rts), both agents independently widened falloff.maxDistance per sound to hear anything; Ember Command (rts, height 34) would have shipped silent world cues.

Verification

  • bun test packages/shell/src/audio — 38 pass, 0 fail; bun --cwd=packages/shell run check-types — pass; ship:preflight — ok
  • Not auditioned by ear (headless environment); the gain path is the existing resolveEmitterGain(distance(listener, emitter)), now measured from the ground focus.

No rendered surface changed.


Generated by Claude Code

The listener followed the camera. RTS and top-down rigs sit 35-50 m up,
past the default 24 m falloff, so positional build, combat and death cues
were silent even at screen centre; Beacon and Brightway each widened
falloff by hand to compensate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw
…changelog]

The first test loads the full shell bundle in real Chromium; on a loaded
CI runner it passes Bun's 5 s default and the remaining tests cascade.
It failed this way on #1995, #1996, #1998 and #1999 while passing on
beta and #1997.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw

Copy link
Copy Markdown
Owner Author

test failed in packages/shell/src/settingsBoundary.test.ts (5 failures after a 5 s hook timeout). This PR doesn't touch shell settings, and the same failure hit #1995, #1998 and #1999. I ported the fix from #2000 (20 s timeout for that browser test) and pushed.


Generated by Claude Code

… [skip changelog]

After the settings boundary test got 20 s, the same runner timed out
hudInputBoundary and the Rapier slope test instead: whichever cold-start
browser/WASM suite runs first under load passes Bun's 5 s default. All
pass locally. Set the default for the CI test command; tests with their
own timeout keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwsemkhoUGyeQkdkKFmUmw
@Noisemaker111
Noisemaker111 merged commit e9f96e8 into beta Oct 20, 2026
6 checks passed
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.

2 participants