Friday, 30 September 2016

Last Minute Audio!

I have to give a huge thank you to Daniel Ben Jones for this opportunity, as up until yesterday I was preparing to put stock audio into my scene rather than audio that had been made specifically for it. Needless to say, specially made audio is 1000x better, so thank you, Daniel! :D 

I met Daniel through the Games Development society that I ran alongside my MA, and we had talked about collaborating but hadn't really seemed to find the right opportunity. Then Daniel asked me if I'd like audio for my forest, and here we are! 

Daniel made me 3 sets of audio - a 7 minute audio recording of a forest, some magical music to go with it, and 7 unique footsteps. <3

So now let's go through the process of actually adding the audio...

Audio imports to UE4 just like meshes, textures etc. Just select 'import', select the file(s) you want to add, and they show up in the bottom like so:

The reason these are on their own and not with other assets/audio/textures is because they're in a folder - keeps things organised. ;)

The difference between audio and a mesh, however, is that you can't just drag it into your scene and have it work. First you need to make a Sound Cue for it. 

To do this, you select the pieces that you want to put into the sound cue. In this case I have 7 individual footsteps, so with all 7 selected you then right click > select 'create cue' from the drop down menu. 

This will then create the cue for you, and you'll have a little window that looks a bit like this:

It'll look different if you only select one sound to play, as you won't need to randomise it. So rather than all the different nodes connected to 'Random', it'll just go straight from the audio box to the Output. :)

In this case I need the footsteps to randomise as the player walks, so the 'Random' box is necessary. With everything connected like the image above, you can then test whether or not the sound cue is working properly:

If you select 'Play Cue' from the top left side of the menu, it'll then play a random sound connected to the Output. Pressing this several times should randomise the selection, and if all of them play then you're good to go! 

After you've saved your sound cue, you're then ready to add it to your scene. For general audio/soundtrack music you can just drag it into the scene, select the radius of it in the settings, and you're good to go! 

For footsteps you have to attach it to your player, so now you need to find your 'FirstPersonCharacter' (or the equivalent if your game is in 3rd person) and double click it to open the Blueprint. 

With the Blueprint on screen, you need to add your Footsteps to the character so that they play randomly while your character works. Create an 'Audio Component' and select your Footsteps sound cue to work with it. Then connect it to Play/Stop as it is above. :)

With all of this done, you should now have both in-game sound, as well as a randomised selection of footsteps which play whenever you walk! Amazing! 

I'm so thankful to have been able to learn this (and to actually have the audio to do so!), so a huge thank you again to Daniel and to my lovely friend Elliott for all of the guidance. I feel like I learned something super important and valuable, so I'm very thankful for the opportunity. :)

No comments:

Post a Comment