Max Instances doesn't seem to work as intended

I’m having trouble getting the desired result from the Max instances setting on an event. I have a radio receiver event which occasionally is triggered to play when a vehicle in a city is spawned. In Unreal, every non player car has this radio receiver component on them, but on spawning, There is currently a one in 10 chance that it will play this radio receiver event.

There is a global radio in the game and this radio receiver event exists to receive the signal of this radio using an F mod transceiver effect, and play the radio from the position of the vehicle as it drives around. I only ever want one of these radios to be audible at a time, so I have set its Max instances setting to one with stealing setting “furthest”. with this, I get the result I want - occasionally a vehicle can be heard playing the radio.

When I check the FMOD profiler however I often see there are many more than one instance playing. Is this right? I would expect to only ever see one lifespan visible in the profiler, occasionally cut off when a new one begins.


I will test it again when I get the chance, but now in the blueprint I explicitly tell the radio receiver instance to be released when it stops. Maybe this will help (And I should have done it anyway), but it would still be good to know If my thinking is on the right track in the first place.

Thanks!

Hi,

Thanks for the bug report - this definitely isn’t expected behavior, and I’ve passed it on to the development team for further investigation. Explicitly stopping and release the instance from the blueprint should work around this behavior. Just to confirm though, in my reproduction of this issue, FMOD will log the following warning:

EventInstance::update(): Event has waited 10.0 seconds for DSP graph to go idle - check for plugins that may be keeping it active

Can I get you to confirm whether you’re also seeing this on your end in UE’s output log? You may need to enable API error logging and set FMOD’s logging level to “LOG” in order for the warning to show up.

Hi, and thanks for the response. I’ll check this out tomorrow in editor when I get the chance, but in the meantime, do you know how to enable these options while playing a build, using Steam’s launch options? I’ve tried entering
-LogCmds="LogFMOD verbose" -DPCVars=bEnableAPIErrorLogging=True,LoggingLevel=LEVEL_LOG,
and the verbose one works but the other two don’t. I’m just not sure what the formatting is for enabling these options in an Unreal game, if that’s possible!

Thanks

You may be able to use commands like -ini::[/Script/FMODStudio.FMODSettings]:LoggingLevel=LEVEL_LOG for a development build of the game. Otherwise, you may need to create your own command line argument to adjust the setting - see here for more info on how to do so: https://dev.epicgames.com/documentation/en-us/unreal-engine/command-line-arguments-in-unreal-engine#createyourowncommand-linearguments

Thanks very much. I’ve done that, and can confirm that the message does come up in the output log, and it references the offending event. Any idea if there’s a workaround to stop it still triggering new instances when its Max Instances value is set to 1 (all inside FMOD though, without tinkering in Unreal)?

Thanks for confirming that!

Unfortunately, there’s no workaround I can provide that handles the issue solely in Studio at design time. Handling it within Unreal by explicitly stopping and releasing the events is the way to go.