Simulating sound across multiple rooms

Suppose we have the following room layout, where we have rooms A, B, C, and D, separated between them with doors.

2021-09-30 19.02.19

Let’s assume I have emitters on every room and they are assigned to a separate bus for every room. The listener is able to move between rooms, and I’m able to know where she is. To simulate what she should hear, I could implement mixer snapshots “inside_a”, “inside_b”, and so on, that will activate when she enters the corresponding room. So when the listener is “inside_b”, I could modulate the sound coming from A, C, and D, depending on the state of the doors.

So far so good. But what happens if the listener is, for example, “inside_a”? I can modulate the sound “coming from” B, but that sound not only must integrate also the emitters on C and D, but honoring the state of the doors too.

You can see that the combinations are many and I can’t find a good way to simulate this that works on the 100% of cases, without using occlusion, which let’s say I can’t do for the moment as I have no access to the backend. I only get the data “inside where” and “door state” as parameters in Studio.

Any ideas?

Indeed, that seems tricky to implement within fmod studio, though that would only take a few lines of code… I think the best idea is to beg the developer to implement the logic in the game code :smiley:

I just had an idea, though. Use multiple sends between busses, to mimic the real geography. Send some A in B and some B in A, and so on for each pair of consecutive rooms. Automate those sends with snapshots related to door state: if A/B door is closed, less A goes into B (and conversely). In top of that, use another set of snapshots for the “inside where”, controlling bus volume.
That could maybe cause feedback of phasing issues, I don’t know. You’ll have to try!

Steam Audio might be the answer for this kind of thing if you’re using Unity. Sadly no support for Steam Audio with FMOD if you’re using Unreal.

I built a custom audio propagation solution in Unreal using A* pathfinding and special rules of propagation through portals and rooms, which is a fancy way of saying I added overlap volumes into the scene and hooked those into an A* pathfinder, where I look up the room the sound emitter is in, and the room the listener is in, and then find multiple paths to the listener. This way the sound can come through a window to your left and the closed door in front of you at the same time, and how the sound bends through portals, how far it travels to reach the listener and what type of portals it travels through affect the occlusion that is applied to the sound, its volume, its spread and its direction. Not trivial to implement, and lots of little corner cases :sweat_smile: Wish I had the option to use Steam Audio instead!

1 Like

Thanks @Alcibiade @ptrefall ! This gave me some ideas. Maybe in the future I could use Steam Audio, but for now, I ended up implementing the door logic in a scripting language that sits between my backend and the parameters I receive, so now for each “inside_space” snapshot, I get several parameter that tell me what the volume from each other space is supposed to be, and I modulate the busses based on that. For this case it works, but is a bit messy to implement (not as much the sends maze though :stuck_out_tongue: )

1 Like

This is what I was thinking to answer. We implemented this in one game and it went very well. Cheers!

1 Like

I managed in the past this situation in a lecture on FMOD + Unity without using occlusion
I used:

  • a single label parameter describing in which room the player is
  • a mixer bus (group) for every room to route all the 3d ambience emitters placed in that room
  • emitter placed behind every door (this means that you need two emitters for every door) that contains a transceiver set to receive ambience from the proper room group (the room where receiver is)

You need the parameter to mute/filter room sounds when you leave that room, muting door transceiver that are in the same room you are
The trainsceiver gives you the propagation simulation through the door (you can use groups to route every room sources into proper receiver)

Next step is to simulate occlusion through doors using code logic (script) that filter the receiver for every door emitter

It could sound complicated but it is not and it works!

1 Like

Thank you @Gianni , that’s exactly what I ended up doing. Works good enough for now :slight_smile: