‫Hello and welcome.
‫In this lecture we are going to be adding in specialization to our sound.
‫So depending on our distance from sounds, they are going to be louder or quieter.
‫And also it's going to be panning from our left and right speakers so that we can hear whether it's
‫coming from our left or right.
‫Let's dive in and see how all of that works.
‫So in the last lecture we saw how to make our sounds more interesting, but we did notice that they're
‫a little bit flat now that when we're going around in the world, they aren't sounding like they're
‫coming from any particular location.
‫Now, why is that?
‫One reason is attenuation.
‫So this is the fact that a sound that is closer to you will sound louder than a sound that is further
‫away.
‫Another factor coming into play is called spatial ization, and this takes advantage of the fact that
‫you often have two different speakers, one on your left ear, one on your right.
‫If you got headphones or two speakers in front of you stereo, then what happens is, depending on where
‫these sound sources are relative to where you're looking, if it runs over to the left, it will play
‫more of that audio over in your left.
‫Speaker Whereas if another sound source is more over to your right, it will play more of that in your
‫right speaker and so on.
‫And this gives you an illusion that a sound is coming from a particular direction, and that can be
‫really helpful in a game where you want that extra auditory cue as to whether your enemy is trying to
‫sneak up on you, such as in a shooter game.
‫So it's really important to be able to have both of these effects go on to give us more of a sense of
‫space.
‫Now, the way that we are going to do this is go over to our cue, and in fact, we can change these
‫settings.
‫Now, there's two ways we can do this.
‫If we scroll down to a section called Attenuation, you can see that there's a checkbox where we can
‫hit override attenuation, and then that unlocks a bunch of settings here, right here in the cue.
‫And that will allow us to add our own attenuation settings for attenuation and specialization.
‫But another option here is to add some attenuation settings, and these can be shared between multiple
‫cues and so on and so forth.
‫Now this is the more scalable way of doing it, so we're going to create a new sound attenuation asset.
‫Now the prefix for this is a T underscore, and then I'm going to call this just default.
‫So this is the default sound attenuation asset.
‫I'm going to put it in the PSF folder and hit save and then we can go and reveal it in the content browser
‫with the little magnifying glass and open it up to see that it's basically just that details pane again
‫that we were seeing in the queue.
‫Except this time these settings are going to be shared between all the cues that have it applied.
‫Now the first two things that crop up here are attenuation distance and attenuation specialization.
‫So this shows us that right off the bat, these two are both enabled if we create ourselves a attenuation
‫settings asset.
‫Now some interesting things to look at are the attenuation function.
‫You can see this is linear.
‫This is basically saying, how should I adjust the volume as an object gets further away?
‫Linear is often a good start, but you've got a more natural curve, you've got a logarithmic curve,
‫lots of other options, or even you can select custom and you can add in your own custom curve points.
‫Now I would advocate for going with the defaults, unless something sounds weird to you.
‫Then there's the attenuation shape, which by default is a sphere.
‫No real reason that you should need to change this.
‫Some things might give off sound more in one direction than another, and you might want to choose a
‫different option there.
‫Then we have an inner radius.
‫Basically everything this close to the sound source is going to get it at max volume.
‫Then we've got to fall off distance.
‫Basically, anything further than this distance is going to be zero volume.
‫And then finally we've got the specialization section, which again is to do with that left right panning.
‫And you can see that specialization method can indeed be panning, which is quite simply saying if something
‫is over to my left, play more of it in my left speaker.
‫If it's over to the right, play more of it in the right.
‫Speaker.
‫There's also another option here called binaural, and that does some more complicated calculations,
‫basically factoring into account the shape of your ear, changing frequencies and stuff that should,
‫in theory, give you more of a sense of up and down as well as left and right.
‫But it does require you to be wearing headphones.
‫It requires a plug in to be enabled.
‫So I don't advocate using that if panning is enough for you, because panning also works on speakers.
‫And then the final setting of interest is probably this stereo spread down here, which just tells you
‫how far apart things are going to sound.
‫So if things don't sound far apart enough for you, then you can go ahead and make this larger.
‫If they sound too spaced out, then we need to go ahead and make it smaller.
‫But generally I'm advocating leaving these settings as they are by default.
‫One more thing is that if you want to go ahead and test this out, we need to open up our BP rifle and
‫set our damage down to zero so that we aren't easily getting killed.
‫And then we can go ahead and play.
‫And we know this is a little difficult to pick out one sound over another.
‫So if we go over to one of the cues and hit either the solo button, which just plays that one cue so
‫you can hear all we're hearing is the rifle shot right now or we can hit mute, which turns off the
‫rifle shot so that all we can hear is the impact.
‫Cuban.
‫Of course you can do this the other way around by going into the impact.
‫Q And soloing the impact.
‫Q Or muting the impact?
‫Q Now, this obviously doesn't make as much sense when all you've got is two different sounds, but
‫if you had three, for example, then solo would make a lot more sense and Mute would make more sense
‫if we just wanted to take the impact.
‫Q Out of the equation.
‫So it's time for a bit of a challenge for you to specialize the impact sound as well as the rifle shooting
‫sound.
‫So you're going to use solo and mute to test and try and set it up with the attenuation asset that we've
‫just created.
‫So pause the video and have a go.
‫Okay.
‫Hopefully this was a bit of an easy one for you.
‫We're going to go over to the impact cue, scroll down in the details pane to the attenuation section
‫and select our new sound attenuation settings.
‫Then we're going to go over to the rifle and hit play.
‫Hopefully in that little playthrough you are convinced that it was a specialist.
‫You can also play around with the mute buttons and solo buttons to just hear one of the sound effects
‫and just a note in my video recording, you will probably only be hearing mono, so you won't be able
‫to hear the specialization that for that you'll have to try it out in your own game.
‫So that pretty much wraps it up for sound.
‫We now have randomized sound that is specialized and present in our world.
‫In the next lecture, we're going to move on to working with a heads up display and health bars.
‫See you there.