Two user findings from the Campaign A listening session. 1. The portal tunnel's in-flight sound was silent while its enter/exit cues played. The tunnel's authored SoundTweakedHook drained into the world 3-D path at its synthetic owner's origin (0,0,0) — after A2 that dies twice: the listener is usually beyond the -50 dB no-allocate radius, and the world pool is suspended for the whole transit hold. The cues the user COULD hear were on the interface bus, which has neither problem, and retail's tunnel is gmSmartBoxUI — UI-owned — so that bus is also the faithful route. UiPresentationHookSink now wraps the shared router for the tunnel: sound-bearing hooks go from-centre through the interface bus (AudioHookSink.OnUiHook); every other hook kind still reaches the particle/lighting/translucency sinks unchanged. 2. Ambience cut dead inside houses; retail keeps the outdoor soundscape in sky-lit interiors. This is TS-66, now retired: the ambient listener source resolves the per-cell CEnvCell.seen_outside bit through the physics cache (the same #107 field AdjustPosition reads) and converts the envcell-local origin through the cell's WorldTransform into landblock coordinates before the 3x3 walk centres on it — an outdoor Position's origin is already landblock-local, an envcell's is cell-local, and skipping that conversion would centre the walk wrongly by up to a landblock. A not-yet-resident cell record resolves to silence for that rebuild rather than a wrong walk. Sealed dungeons stay silent, which is retail-correct. The user also reports interiors carrying their own local sound in retail (hearth-type emitters). Statics already register their sound tables and route animation hooks, so the expectation is that the seen_outside fix plus existing emitters covers it; re-listen decides, and anything still missing becomes a precise follow-up. Full Release suite: 11,740 passed / 4 skipped / 0 failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using System;
|
||
using System.Numerics;
|
||
using AcDream.Core.Physics;
|
||
using DatReaderWriter.Types;
|
||
|
||
namespace AcDream.App.Audio;
|
||
|
||
/// <summary>
|
||
/// Hook sink for UI-OWNED presentations (the portal tunnel is retail's
|
||
/// <c>gmSmartBoxUI</c>): sound-bearing hooks go to the interface bus — from
|
||
/// centre, distance 0, immune to the world-audio suspension that covers
|
||
/// reveal holds — while every other hook kind forwards to the shared router
|
||
/// unchanged, so particles/lighting/translucency behave exactly as before.
|
||
///
|
||
/// <para>
|
||
/// Without this split the tunnel's authored in-flight <c>SoundTweakedHook</c>
|
||
/// went down the world 3-D path at the synthetic owner's origin: usually
|
||
/// beyond the −50 dB no-allocate radius AND inside the suspended-transit
|
||
/// window, so the tunnel interior was silent while the enter/exit cues (on
|
||
/// the interface bus already) played fine.
|
||
/// </para>
|
||
/// </summary>
|
||
public sealed class UiPresentationHookSink : IAnimationHookSink
|
||
{
|
||
private readonly IAnimationHookSink _router;
|
||
private readonly AudioHookSink? _audio;
|
||
|
||
public UiPresentationHookSink(IAnimationHookSink router, AudioHookSink? audio)
|
||
{
|
||
_router = router ?? throw new ArgumentNullException(nameof(router));
|
||
_audio = audio;
|
||
}
|
||
|
||
public void OnHook(uint entityId, Vector3 entityWorldPosition, AnimationHook hook)
|
||
{
|
||
if (hook is SoundHook or SoundTableHook or SoundTweakedHook)
|
||
{
|
||
// With no audio graph (headless/driver-less) the sound hook is
|
||
// simply dropped — forwarding it to the router would put it back
|
||
// on the world 3-D path this sink exists to bypass.
|
||
_audio?.OnUiHook(entityId, hook);
|
||
return;
|
||
}
|
||
|
||
_router.OnHook(entityId, entityWorldPosition, hook);
|
||
}
|
||
}
|