Instance stealing problem, fade outs


I think I either dont understand how stealing is supposed to work, how it works with fadeouts, or something is malfunctioning here.

I got some in game “soft” stealing set up by a programmer, working in a way that, when new event instance spawns, it stops previous instance (if there was one playing at the time), if they are close enough together in the world space.
I’m testing this approach for bullet impact sounds, so that when they are close, they get “stolen”, but if there are another bullet impacts happening in other places (shot by other players for example), they wont get “stolen”
It is set with Allowing fade out, so I can manually set in event ADHSR how much release I want, so I can have control about not getting too many voices playing at once.

I am not sure this approach is optimal, but I’m having troubles in testing this, as it looks like something’s wrong with stopping the events.

Picture 1, there’s no additional FMOD stealing on top, no ADHSR applied or any effects active in the event that would have any sort of release. Events seem to stop with kinda random delay. Take note that those events are happening pretty fast.

Picture 2, I applied long release to ADHSR, and as expected with Allow Fadeout, the events have the fadeout applied.

Picture 3, to determine if the delay in stopping the instance (pic 1) is a faulty system set in Unity, I applied FMOD stealing on top in the events, with Max Instances = 1 based on Stealing Oldest. 0ms release on ADHSR.
Why am I at some points getting 3 instances playing simulteanously? Shouldn’t FMOD stop (immediately) the previous ones the exact moment new instance starts?
Can AllowFadeOut stopping interfere with stealing in that way?

Picture 4, I applied long release to the ADHSR with the same stealing settings as in 3, just to make sure if there’s gonna be any difference.

So with the strange problem shown in picture 3, where I’d imagine active instances to be stopped when new start, I cannot tell if the “soft-stealing” set by programmer is having some kind of delay, as settings from 3 should cut any already active instances.

Any ideas why would that happen?
Or am I getting something wrong?

New finding, for the same set of events, but this time one of them had Fadeout not allowed.

Would that mean that allowing fadeout actually forces some fadeout on instances?
Even if release is set the release to 0ms or there is no ADHSR or effects with release used at all?

Could that also prevent FMOD from stealing the instance that is stopped with fading out allowed?

Unfortunately, without more information about the system your programmer designed, there’s no way for us to know how it works, and thus no way for us to identify the cause of the behavior it is exhibiting. If you’re able to post the code your programmer used, we’ll be in a better position to understand it.

That being said, there are a couple of things we can provide you with information about.

Your first two images don’t show the timeline ruler, so I’m not actually sure what scale they use, but the third and fourth images show event instances that are only playing for ~100 milliseconds. At that scale, it is possible that the delays you’re seeing are due to commands having to wait for update() to be called; by default, it is called every 20 milliseconds.

Yes. This is actually a known bug: Events in the “stopping” event state are not counted against the number of playing event instances for the purposes of stealing, and so are not culled by the stealing system. This issue is already in our bug tracker, and will be fixed in an upcoming version.

1 Like

I’m having issues playing an event shortly after stopping the very same event when it has a fade out. The latest triggered event can start only when the fade out is done.

Would this issue be related to the bug you’re describing?

No, that sounds like an unrelated behavior. Does the issue occur only in FMOD Studio, or does it also occur in your game?

Ok. It happens only in Unity, in FMOD it works as intended using the Sandbox. Not sure why this particular event behaves that way, other events work fine. This is withouth applying Max Instance limit, stealing or cooldown. When applying voice stealing that doesn’t seem to work though, it just keeps fading out the old sound before a new one can play.

Any idea what could be the cause?

Sorry for hijacking the thread…

It sounds like you’re restarting the same event instance each time you want it to play, instead of creating a new event instance each time. Having only one instance of the event means exactly what it says on the tin: There can only be one instance of the event playing at a time.

You need to look at how and when your Unity project creates new instances of the event, and ensure it does so every time you want a new instance of the event to play, instead of just creating one instance of the event when the scene starts and triggering that instance whenever you need it.

1 Like