Hey everyone and welcome back to part 2 of my “Microgame Platformer” series. Today we’re going to implement some ambience into the game (this time something that actually fits). I’ll be going through both the design of the sounds and the implementation in FMOD. Let’s do it!
Getting An Overview
When designing ambience, it’s a good idea to take a look at the environment and map out sounds that you could add to your ambience sound. If we take a look at the starting area of the game for example, there’s a bunch of visuals that we can draw inspiration from (picture down below).
First of all, I notice the buildings. In my mind I could convey this city-like feel using a distant traffic sound or maybe some car-horn one shots here and there. I also notice the clouds and the trees, which we could maybe just use the sound of wind for. There’s also some birds sitting on the rooftops, so getting some bird ambience sounds would maybe also be fitting. It’s all up to you of course, I just want to get you into the habit of actually looking at the environment when creating ambiences.
Creating The Sounds
(Quick note: you don’t have to create the same sounds as me, just try following along with your own ideas)
For the birds, I took a recording from my mother-in-law’s backyard which had a ton of birds singing at the time. We need to create a seamless loop out of this so I made two zero-crossing cuts (Alt-Z in Reaper) around a selection I liked. Try doing the same, regular cuts also work fine for now.
Now delete everything around these cuts and then make a zero-crossing cut in the middle of the soundfile you have left (this time you need to make one).
Now drag the leftmost audio file so that it crossfades with the end of the right one and adjust until you get a smooth crossfade, and VOILA! You have a seamless loop. This is because the beginning and the end of the file overlaps perfectly since it comes from the same point in the middle of the file and are cut at a zero-crossing.
I also wanted to make a wind ambience, so I took my trusty Zoom H6. With the XY pair of mics and a windscreen on, I put my mouth on the windscreen and then tried to simulate wind noises by just blowing into the mics.
I then gave it exactly the same looping treatment as the bird ambience, but also added some EQ to get rid of some of the harshness. Try this method of creating wind, it’s actually surprisingly effective!
I decided to go with car horn one-shots for the city feel of the ambience. I pulled some car horns from a library (remember, there’s nothing wrong with using sound libraries) and cut them up into different little horn sounds.
Implementing The New Ambience
Let’s get this implemented in the game!
First of all, go and delete the sound file and loop we made last time. Then right click in the “Event Browser” and choose “New Folder”.
Name the new folder “Ambience” and drag your ambience event into it. It might seem unnecessary, but it’s good to get in the habit of keeping some sort of folder structure, even on smaller projects.
Now go on, and just like last time, drag your first ambience into the event and create a loop.
Beneath that loop, create a new track (CMD/CTRL +T). We’ll use this track for the second loop. Right-click in the timeline and select “Add Event Instrument.
You’ll see this little yellow box pop up. What an event instruments basically is, is a “box” that let’s you play an event within it whenever the playheads overlaps with it. Which will become useful in a moment!
Double click on the event instrument and create your second ambience setup in there. In my case, I’ve done exactly the same thing as with my bird ambience, just with a shorter wind ambience file.
Now go back and drag the edges of the event instrument to match the looping points of the bird ambience. Press play to hear the effect. The two ambiences will play at the same time and loop perfectly, but at different points. This will make the ambience seem much more organic, since there isn’t a set looping point for the ambience as a whole. You can also look at the little playheads on the loops, to see how far they are. This wouldn’t be possible without the event instrument having it’s own loop that it’s basically just playing for the duration of the bird loop.
For the car horns, I’ll use event instruments again. Make a new track, add an event instrument and open it up.
Inside of the event instrument, make a “Multi Instrument”. What a multi instruments does, is that it randomizes between different sound files.
Now, take the sound files and drag them into the “Playlist” box down below. Press play to hear the sounds being randomized.
If you want to randomize the pitch and volume as well, you can right-click on one of them and choose “Add Modulation” and then “Random”.
You’ll then get a knob for each of the randomized parameters that you can set depending on how much randomization you want.
Now that the car horn sounds are in place, let’s add some reverb to them to give it that sense of distance. When clicked on the track, click the little black box next to the “Fader” and choose “Add Effect” and then “FMOD Reverb”. I’m just using the default reverb settings for this example.
You can also add an EQ and cut away some of the high frequencies to convey distance even better.
Try copy-pasting the car horn event instrument that you made, so that you have it at different times during the loop.
For extra effect, you can also set the probability for each of the car horn event instruments, so that the sound only have a chance of playing say 60% of the times the playhead passes it. If you open up “Trigger Behaviour” and turn on probability, you can then set the percentage that you want to use for each given instrument. (Note; you need to do this on each of the event instruments if you’ve already copy-pasted them.)
And that’s it for the ambience setup! Listen to it and mix it however you like using the faders on the left.
Lastly, hop into Unity. On the “Ambience” gameobject, we need to re-assign the event because we put the old one into a folder. So just go ahead and point it to the new location of the ambience. If you play the game now, everything should work as intended.
That’s it for today! Hope you enjoyed and learned something new! See you next week! 🙂