3D sounds in building - adopt room shape?

Hey folks,

I’m really struggling with fitting sounds into a room or any closed area.

Let’s say I have a cubic room and want to put a sound source, like a generator or something, in it. As the sound should adopt to the player’s movement, I set up a 3D event, place my sound and edit the attenuation settings.

With the attenuation falling off in a circular manner, there will be some points within my cubic room, which will not be covered by the sphere of the attenuation. Meaning there will be no sound at all, which is not what I want. I could of course increase the radius of the attenuation, but then the sphere spreads into the other rooms next door.

Is there any smart way to change the shape of the attenuation to adopt the rooms shape?

Many sound designers add a parameter that represents whether or not the event is muffled or otherwise occluded from the listener by an intervening barrier, and automate the event’s volume on that parameter. Many commercial game engines have built-in ray tracing that can be used to calculate whether an emitter is occluded. If you are using your own game engine, you will need to add this feature to it in order to drive the parameters you add.

1 Like

Thank you for your answer. I’m using Unity. So far I only came across “ray cast”, but found some tutorial on building your own ray tracer. In the end I guess I have to write another script to constantly read out the ray tracer and link this the FMOD parameter?

If you want the occlusion state of your event to be updated constantly, yes. In some situations it may be easier to just update the occlusion parameter of your event whenever the listener/player pawn leaves or enters the room.

1 Like

Ray tracing/casting is a demanding process, so if you just want to switch between states of “how to sound”, I suggest the following which I use often and also implemented in proprietary game engines with success.

Organization

  1. Group all sources to “outdoors” and “indoors” groups.
  2. Route those groups to different filters, one for each group.
  3. In your room prefabs (or model groups) include a collision box.
  4. Put a tag on each collision box depending on how much its structure blocks the sound transmission to the other side of the wall.

Logic

  1. Each time the listener (player) enters or exits a room, a trigger will be send to switch on or off the corresponding filter.
  2. Depending on the tag of each collision box, different presets loads on the corresponding filter, to simulate none/light/medium/heavy/complete occlusion. That way you also simulate from fences and lights walls, to heavy forts and caves.

Some more ideas

  • You can find more clever ways to route sources to groups or switch between presets, depending on the way the audio engine functions and how you setup your game mechanisms.
  • You can setup different reverb processing with the same logic and omit the Unity reverb zones altogether, to achieve similar simulation for the reverb, which is better in my opinion.
  • Using different reverbs in groups can also allow for sounds to feature the reverb that belongs to where they are located. For example, you are out of a cathedral and another character is in the cathedral, so you hear his voice with the cathedral’s reverb and muffled from the cathedral walls. But that depends on how you designed your system and of course maybe your game simulation does not need it at, so it adds no value.

The secret here is your game’s metadata, how you tag things in your level, so that you can create rules that follow specific logic according to tags. Indoor/outdoor, light/medium/heavy, nature/closet/room/hall/unreal, etc. All those can be tags of your level assets, building, models, etc., and then you use that to build switching mechanisms that boost immersion.

1 Like