I really like the FMOD integration features in Unreal. Therefore I was wondering if it is possible to bring Ambient Zones with a custom script to Unity.
Recreating the “Ambient Zone” feature of Unreal’s “Audio Volume” for Unity.
What are Ambient Zones
With Ambient Zones it is possible to change the soundscape for a certain area. Based on the player’s position, the FMOD event emitters inside and outside the box are modified in volume and frequency.
There are several settings available to modify the sounds.
When is this useful
- If the player enters a small house and the outside ambience should be lowered and muffled
- If the player is outside a club and we want to hear the muffled music from inside. As soon as the player enters the club, the music gets louder and clearer
- Almost any small environment changes like a small forest on a hillside, an open cave in the mountains etc.
How it works
Within FMOD all the events that should be affected by the Ambient Zone must have set “Ambient | 1” as a “User Property”. For the LPF there needs to be a “Lowpass” effect inserted on the event’s master track. And that’s it. Everything else is done within Unreal using the Ambient Zone’s settings. Unreal somehow calculates itself whether the sound source is inside or outside the box and marks them therefore interior and exterior.
What needs to be done
I don’t know if it is even possible to set this up in Unity, but the basic idea is this:
When the game starts, Unity gets a list of all events with the User Property set to “Ambient | 1”. Afterwards the world position of these events is calculated and divide into 2 groups: Interior and Exterior of the box. When entering or exiting the box, a trigger will send the values set in the inspector to FMOD and drive parameters for the corresponding events.
Wait a second, can’t this all be done using snapshots?
Yes, absolutely. Whenever the player enters a certain area, there could be a trigger which is connected to a snapshot setting the volumes and filters. However, depending on the complexity of the map, there can be dozens of such areas. As snapshots only apply to groups and returns, this could easily end up in a routing chaos.
The Ambient Zone will do a lot of this work just for us.
So what now?
Well, I just wanted to know if any of the required steps described above is even possible. Like getting a list of events with a certain user property or arrange them in groups (not mixer groups) based on their position within the game.