Conversation
…renamed on any change - the includer provides blue, same as IEveBallpark.h, since destiny sets the vector override before any blue header - rename the interface on any method change instead of append-only so a stale copy fails the cast
…ck occluded ones - skip out of range and 2D emitters when collecting candidates, refresh pass went from 13-18ms to under 1ms - collect candidates under the prioritization lock into scratch vectors so a warm pass allocates nothing - drop entries that settle at clear so Update only walks occluded or fading emitters - onset flag only set when no voice is live and cleared when the last voice ends - GetListener reads the prioritizer's cached listener instead of scanning every object
- keep the last sightline results per emitter and expose GetLastSightlineVerdicts to blue and python - result array is a plain bool array kept between ticks
scaled emitters were cut off at r*sqrt(k) instead of r*k, so the sightline pass never decided occlusion for them in that band and they played unoccluded behind geometry. culling range weight used the same test so it was off too.
- remove IsTracked - EmitterState::SetTargets is the one place targets get set - remove the snap param from SetObstructionOcclusion and SetEmitterLineOfSightBlockage, back to main signatures
- rename GetLastSightlineVerdicts to GetLastSightlineResults in c++, blue and python - rename AtRestClear to IsClear - shorter comments in plain words
phevosccp
marked this pull request as ready for review
September 24, 2026 11:05
Member
There was a problem hiding this comment.
If the idea is for destiny to implement this interface, it may be better to have this header in destiny, and for audio to depend on destiny (and source this file from it). It would make the link between these two components more explicit. See carbonengine/trinity#91 for a similar trinity change
| // Current, mid-fade occlusion value for an emitter. 0.0 if the emitter is clear or not tracked. | ||
| float GetEmitterOcclusion( AkGameObjectID emitterID ) const; | ||
| // Results of the last sightline pass, emitter id to blocked. See AudObstructionOcclusion::GetLastSightlineResults. | ||
| std::map<AkGameObjectID, bool> GetLastSightlineResults() const; |
Member
There was a problem hiding this comment.
Maybe return const std::map<AkGameObjectID, bool>& to avoid copying the map?
| float GetEmitterOcclusion(AkGameObjectID emitterID) const; | ||
|
|
||
| /// Results of the last sightline pass, emitter id to blocked. Emitters that were not checked are missing. | ||
| std::map<AkGameObjectID, bool> GetLastSightlineResults() const; |
Member
There was a problem hiding this comment.
Similar to the other place, return const ...&?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change optimizes performance since the physics engine and CarbonAudio are now directly talking to each other with an interface. This refactor also helps resolve bugs with NPCs and one-shot sounds occasionally not being occluded since after this, each emitter carries its own occlusion state.
IEveObstructionQuery, implemented by destiny's ballpark and set from script asaudioManager.obstructionQuery. CarbonAudio sends the listener and emitter positions and getsback a blocked flag per emitter.
SetEmitterLineOfSightBlockagestill works when no query is set.occlusion reaches Wwise before the first buffer, everything else audible is rechecked every 0.2s.
Unpositioned, 2D and out of range emitters are skipped.
is playing on them.
GetLastSightlineResultsexposes the last pass to debug tools.GetMaxAttenuationRadiusnot squaring the scaling factor, so range tests were wrong for anyscaled emitter.
GetListenernow goes through the prioritizer instead of scanning every game object, which was tooslow to call from the tick.
Linked issue
https://fenriscreations.atlassian.net/browse/PLAT-12113
Testing
Tested in Frontier/Windows
Rewrote some of the occlusion unit tests and reduced them from 11 to 5.