Making a Dynamic Ambient Sound System in UE5

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/elementor/thumbs/Screenshot_14-q8w8o2wygn50hq63rh0eo1ne4vsn0227361je25v28.png

Hi there! My name is Conrado Laje, and this is my journey into getting better at Game Audio. My third step consist in build a dynamic ambience system. Hope you find it intresting!

In this third entry of my blog, I’ll explain how I made a “Dynamic Ambient Sound System” in Unreal Engine. I want to point that this idea it’s just a rip off of a plugin made by Dan Reynolds (Technical Sound Designer at Epic). His idea consist in building “Sound Palettes” that are just collections of “Sound Colors”. In this video he explain with greater detail his philosophy behind “Soundscape”, the plugin. I thought that that was a great idea, and I tried to make my own version using Blueprints and Data Assets (in oppose to the C++ architecture used by Dan, which I don’t master).

Sound Palletes

A Sound Palette it’s just a collection of different Sound Colors. For example, “Forest” can be a Sound Palette made by Crickets, Birds, Tree Rustles and Owls (Sound Colors). And all this colors can be used in other Sound Palettes. Crickets and Birds can be part of Prairie Sound Palette, and Owl and Trees can be part of a Swamp Sound Palette.

First of all, I made the Primary Data Assets, that will contain the data required to control the spawn behavior of the different sounds. One for the Palettes and one for the Colors.

The Primary Data Asset of the Sound Colors look like this. All the variables created will be responsible for the behavior of the spawn of the sounds and the modulation. How active they are in the environment. Think of a bird, or how quiet and paused can be an Owl, hooting very sparsely in time.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_6.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_8.png

And the “Sound Palette” Primary Data Asset, which is just an Array of Sound Colors Data Assets.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_5.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_9.png

The Controller

With this two created, it’s time to build the logic that will use this data to play the sounds. The “Ambient Sound System Controller” it’s the responsible for assign a Sound Palette to a Trigger Box founded in the level. Once the player enter a Trigger Box, the controller will know which Sound Palette play.

I’ve made a Struct  called “Ambience Volume” (read volume as box) that has a Trigger Box and a Sound Palette

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_3.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_4.png

Then I’ve made an Actor which has an Array of this Ambience Volumes. This will be the Master Controller. Tis Array it’s the only public variable that the Controller has. The designer just have to place a Box Trigger in the world, assign it to the trigger box variable, and choose a Sound Palette that it’ll be triggered. Very easy and with little room to mistakes.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_1.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_15.png

Here’s a GIF showing the set up.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Set-Up2.gif

The Logic

This is how the logic works. Feel free to click on the images to see them larger. You can also double click for further zooming. I’ve made sure that I took large screenshots for easy reading.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/AmbienceMaster_01.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_16.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/AmbienceMaster_02.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_17.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/AmbienceMaster_04.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_19.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/AmbienceMaster_03.png

As you can see in the “Play & Stop” screenshot,  I’m spawning an actor called “Ambience Color Behavior” for each ambience color founded in the Palette (please bear in mind that it also appears as “Ambience Color Spawnable” in other screenshots. I’ve changed the name of the actor later on and forgot to take new screenshots).

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_20.png

This Actor it’s in charge of play each Sound Color. Here is where the spawn and modulation data of each Data Asset takes place.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_2.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_01.png

There are two types of possible playbacks. 2D ambient sound beds that helps to fill the space and 3D ambient sounds that spawns around the player. The combination of this two creates a rich and immersive environment. E.g. you can have a 2D wind ambient sound that plays in loop and multiple localized sounds like birds, leaf rustles, dogs, etc. The beds are pretty simple.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_02.png

Words and Phrases

In the 3D sounds is where the fun begins. The idea it’s to think in terms of “words” and “phrases” (another idea borrowed of Dan’s). A word it can be a single chirp of a bird, and a phrase could be a consecutive chain of chirps by this bird. Words could be separated by very little space in between, like a random between 0.2 and 0.6 seconds, and phrases can be separated by a larger amount, like a random between 6 and 20 seconds.

Here’s some individual crickets sounds in Reaper, that later I randomize using SoundCues.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Crickets.gif

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_03.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_04.png

I’m always spawning the sounds in relation to the player location, because it doesn’t make sense to spawn the sounds too far away. For that, I’ve made this macro. I’m sure that this can be done more neatly, but it gets the job done.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_21.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_05.png

And for stopping the ambiences

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Spawn_06.png

The result

And that’s pretty much all! Here you can see the representation of the spawned sounds as spheres of colors.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Demostration2-1.gif

This is how a Sound Color looks.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_12.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/AmbienceColorDataAsset.gif

And this is how a Sound Palette looks.

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_10.png

!https://web.archive.org/web/20240228213549im_/https://conradolaje.com/wp-content/uploads/2021/09/Screenshot_11.png

And thats all! I hope you found it interesting!

I’m sure this same idea can be made a lot better, please do not take this blog as a guide, this hasn’t been tested in any real game application

I want to take the opportunity and thank Dan for his kindness to share all his knowledge. Go see their videos, they are incredible.

If you have any comments, please reach out through my Twitter, I would love to see if you have any suggestions to further improve this system!

By the way, I’m making one of this blogs per month so… please stay tuned! Thanks for reading! Till the next one!

Here’s a little showcase! Use headphones if you can.

GET IN