﻿1
00:00:04,560 --> 00:00:06,150
‫Hello and welcome.

2
00:00:06,300 --> 00:00:12,030
‫We are going to be randomizing our sounds in this lecture so you can hear the soundscape is far less

3
00:00:12,030 --> 00:00:14,130
‫boring than it was in the last lecture.

4
00:00:14,130 --> 00:00:19,110
‫We're going to be using a feature built into unreal called sound cues that allow us to do this.

5
00:00:19,110 --> 00:00:20,730
‫Let's dive in and see what they are.

6
00:00:21,370 --> 00:00:24,460
‫So our sounds are a bit monotonic as it stands.

7
00:00:24,460 --> 00:00:29,260
‫And I have alluded to the fact that there's something called a sound cue which allows us to fix this

8
00:00:29,260 --> 00:00:29,920
‫in Unreal.

9
00:00:29,950 --> 00:00:33,380
‫It's a new type of asset, so let's see how to create it.

10
00:00:33,400 --> 00:00:39,220
‫First of all, I want to create a new folder for the sound cues for both of our shot and our impact.

11
00:00:39,220 --> 00:00:43,630
‫So this folder is going to be called SFX for Sound Effects, and we're going to go into there right

12
00:00:43,630 --> 00:00:47,980
‫click, go to the Sounds menu and then select the sound cue in here.

13
00:00:47,980 --> 00:00:52,210
‫Now the naming convention here is that we start with an a underscore, as we would with a sound wave.

14
00:00:52,210 --> 00:01:00,880
‫Then I'm going to give it a useful name such as the rifle shot and then underscore Capital C.

15
00:01:00,910 --> 00:01:07,030
‫Q So it's saying that it's an audio asset and it's specifically a sound cue at the end.

16
00:01:07,240 --> 00:01:12,190
‫Now we can go ahead and open this asset and you can see we get this fun little blueprint editor with

17
00:01:12,190 --> 00:01:17,140
‫a node editor in the middle, which is a bit like the material editor, the animation editor, in that

18
00:01:17,140 --> 00:01:20,920
‫it has this output pin ready for us to plug stuff into.

19
00:01:20,920 --> 00:01:27,130
‫And the way we could start plugging something in is if we write clicked and looked for wave.

20
00:01:27,160 --> 00:01:31,390
‫You can see there is a wave player node, select the wave player node and go to the details pane.

21
00:01:31,390 --> 00:01:39,220
‫Over on the left I could select one of the sound wave files to play and then I can pull out of its output

22
00:01:39,220 --> 00:01:41,920
‫pin and plug it into our output node.

23
00:01:41,920 --> 00:01:46,180
‫And essentially I can use the play buttons at the top of the queue to preview what this queue is going

24
00:01:46,180 --> 00:01:46,960
‫to sound like.

25
00:01:47,050 --> 00:01:52,180
‫But an impressively, it's just going to play that one clip.

26
00:01:52,450 --> 00:01:55,630
‫Obviously, this is not why we put a sound cue in place.

27
00:01:55,630 --> 00:01:59,560
‫What we really want to be able to do is to do other cool stuff.

28
00:01:59,560 --> 00:02:03,580
‫And if you right click, you can see there's a whole load of nodes that we could choose from.

29
00:02:03,580 --> 00:02:09,370
‫There's attenuation branching concatenation, so we can do all sorts of stuff such as play different

30
00:02:09,370 --> 00:02:12,250
‫sounds depending on the material of what's being impacted.

31
00:02:12,250 --> 00:02:16,000
‫We can add some looping, we can do cross fades and so on and so forth.

32
00:02:16,000 --> 00:02:18,820
‫But what I'm really interested in here is some randomization.

33
00:02:18,820 --> 00:02:23,350
‫So there is a random node here where you can add as many pins as you like.

34
00:02:23,350 --> 00:02:28,750
‫And what it's going to do is it's going to switch between its inputs and give one of them out randomly

35
00:02:28,750 --> 00:02:29,950
‫as its output.

36
00:02:29,950 --> 00:02:33,640
‫There's a few properties that you might be interested here in the details pane.

37
00:02:33,880 --> 00:02:39,760
‫The most interesting one for me was the randomize without replacement, and this is basically saying

38
00:02:39,760 --> 00:02:46,360
‫that the type of random it's going to use won't cause you to replay anything until you've played all

39
00:02:46,360 --> 00:02:47,920
‫of the clips on the left hand side.

40
00:02:47,920 --> 00:02:49,990
‫It's basically a random shuffle.

41
00:02:49,990 --> 00:02:56,470
‫So what we're going to do is we're going to output assault rifle, shot one in to the random node and

42
00:02:56,470 --> 00:02:59,590
‫then output that in to the global output here.

43
00:02:59,590 --> 00:03:05,230
‫And I'm also going to copy and paste that assault rifle shot one and do a shot two and put that into

44
00:03:05,230 --> 00:03:06,520
‫the random node as well.

45
00:03:06,520 --> 00:03:10,030
‫And I'm just going to delete the extra inputs that we had here.

46
00:03:10,030 --> 00:03:16,660
‫And now you can hit the play queue and you can see how it's basically just switching between these random

47
00:03:16,660 --> 00:03:19,720
‫outputs because of this randomize without replacement.

48
00:03:19,720 --> 00:03:28,090
‫If we uncheck that, then you're going to see that occasionally it will play the same clip two times

49
00:03:28,090 --> 00:03:28,900
‫in a row.

50
00:03:29,230 --> 00:03:35,290
‫And that's why oftentimes it's useful to have that randomize without replacement so that we don't hear

51
00:03:35,290 --> 00:03:37,570
‫the repetition in our game.

52
00:03:37,570 --> 00:03:38,590
‫Okay, so that's cool.

53
00:03:38,590 --> 00:03:43,720
‫What other interesting nodes do we have here to help us have a more random sounding effect?

54
00:03:43,720 --> 00:03:48,910
‫Well, one of them is the modulator node, and if you select that, the details should give you a bit

55
00:03:48,910 --> 00:03:51,040
‫of a hint as to what's going on here.

56
00:03:51,040 --> 00:03:54,670
‫It's got a min and max pitch and a minute max volume.

57
00:03:54,670 --> 00:03:59,950
‫And as you might guess, the whole purpose of this modulator node, if we just plug it in to one of

58
00:03:59,950 --> 00:04:05,650
‫our clips and to the output, is that it's going to randomize the volume and the pitch.

59
00:04:05,650 --> 00:04:06,460
‫Let's try it out.

60
00:04:06,460 --> 00:04:10,150
‫Now, the effect is not very noticeable there because we don't have very big ranges.

61
00:04:10,150 --> 00:04:15,730
‫So I'm going to go between half volume and two times volume and see if we can hear that now.

62
00:04:15,730 --> 00:04:17,830
‫Hopefully you're able to hear the variations there.

63
00:04:17,830 --> 00:04:24,190
‫Let's also try some bigger variations in pitch two times, pitch and half pitch, and let's just reset

64
00:04:24,190 --> 00:04:25,360
‫the volume.

65
00:04:25,360 --> 00:04:29,890
‫So hopefully you're able to hear the difference there in the min and max pitch as well.

66
00:04:29,890 --> 00:04:35,020
‫So then what we can do is we can put these two nodes one into another and we're then going to get random

67
00:04:35,020 --> 00:04:38,890
‫clips and additional modulation on top of that.

68
00:04:38,890 --> 00:04:43,900
‫Now we have a lot more clips here than just these assault rifles shot one and two.

69
00:04:43,900 --> 00:04:48,640
‫So I want to get bring all of these in, but it can be a bit tedious to duplicate and select the clips.

70
00:04:48,640 --> 00:04:50,440
‫So here's a little shortcut for you.

71
00:04:50,470 --> 00:04:56,620
‫If we go over to our content folder, go down into the asset packs, shoot a game sounds, and then

72
00:04:56,620 --> 00:04:58,360
‫the weapon assault rifle, mono.

73
00:04:58,360 --> 00:05:00,490
‫You can see we've got the clips that we want here.

74
00:05:00,490 --> 00:05:03,130
‫So I'm going to select from shot one to shot six.

75
00:05:03,400 --> 00:05:07,840
‫Then I'm going to go over to my cue editor and I'm going to right click in there.

76
00:05:07,840 --> 00:05:14,260
‫And you can see there is this from Selected Option, which allows us to bring in multiple clips in to

77
00:05:14,290 --> 00:05:16,360
‫various nodes that take multiple clips.

78
00:05:16,360 --> 00:05:19,570
‫And the one we're interested in is the random node.

79
00:05:19,570 --> 00:05:20,500
‫And if you select that.

80
00:05:20,600 --> 00:05:28,280
‫And you get six different wave players all inputting in to a random node so we can now delete the other

81
00:05:28,280 --> 00:05:33,650
‫random node we had manually created and we can use this new random node instead.

82
00:05:33,650 --> 00:05:35,420
‫And that's sounding much better.

83
00:05:35,420 --> 00:05:39,110
‫Now, I just want to tweak the settings here for our pitch.

84
00:05:39,110 --> 00:05:45,380
‫I don't think we want such a big variation in pitch, so I'm just going to reset those down to the defaults.

85
00:05:45,380 --> 00:05:55,280
‫I do want a slight more variation in volume though, so I'm going to go 4.7 to 1.3 and then let's go

86
00:05:55,280 --> 00:05:56,690
‫ahead and play that.

87
00:05:56,690 --> 00:06:00,890
‫I think that's a good variation and it definitely doesn't sound boring anymore.

88
00:06:00,890 --> 00:06:06,200
‫I'd like you now as a challenge to apply the same process to the impact sound effect.

89
00:06:06,200 --> 00:06:12,020
‫So create a sound queue, add randomization, add a modulator, and then play around with the volumes,

90
00:06:12,500 --> 00:06:17,030
‫the values, rather to see what works best for the impact sound.

91
00:06:17,060 --> 00:06:18,260
‫Pause the video and have a go.

92
00:06:18,260 --> 00:06:18,560
‫Okay.

93
00:06:18,560 --> 00:06:19,340
‫Welcome back.

94
00:06:19,340 --> 00:06:20,240
‫Let's give this a shot.

95
00:06:20,240 --> 00:06:27,080
‫So we're going to go over to our content SFX right click and we're going to try and create a new sound

96
00:06:27,080 --> 00:06:27,530
‫asset.

97
00:06:27,530 --> 00:06:28,460
‫And it's a sound cue.

98
00:06:28,460 --> 00:06:34,400
‫So a underscore we're going to call it rifle impact and then underscore cue.

99
00:06:35,010 --> 00:06:36,740
‫Let's go ahead and open that one up.

100
00:06:37,070 --> 00:06:39,950
‫And we essentially want to do the same thing here.

101
00:06:39,950 --> 00:06:43,910
‫So first of all, I'm going to add in a modulator and output that to the output node.

102
00:06:44,120 --> 00:06:49,130
‫Then we're going to go over to our sandbox, skin up to the root content asset packs, shoot a game

103
00:06:49,130 --> 00:06:51,290
‫sounds weapon mono.

104
00:06:51,290 --> 00:06:56,330
‫And then I'm going to select from all of the impact, sound effects, there should be six of them and

105
00:06:56,330 --> 00:07:02,900
‫then going to go over to the impact cue right click and add in the random node and output that random

106
00:07:02,900 --> 00:07:04,820
‫node into the modulator.

107
00:07:05,030 --> 00:07:11,240
‫And then from my playing around, I found that the modulator works better here to have a bigger pitch

108
00:07:11,240 --> 00:07:17,480
‫difference because something plinking off concrete or whatever substance that is could make various

109
00:07:17,480 --> 00:07:20,270
‫sounds depending on what angle it's hitting it at.

110
00:07:20,270 --> 00:07:25,880
‫So I'm going to go between 0.5 and two with less of a volume variation here.

111
00:07:25,910 --> 00:07:27,810
‫Let's go ahead and try playing this queue.

112
00:07:27,860 --> 00:07:28,080
‫Okay.

113
00:07:28,130 --> 00:07:31,580
‫So I think that sounds good with a good amount of variation.

114
00:07:31,580 --> 00:07:37,340
‫Now all that's left to be seen is if we can put this into our rifle and you may have already tried doing

115
00:07:37,340 --> 00:07:44,210
‫this, we can just go over to where we have our sound effects in the beep rifle and change out the wave

116
00:07:44,210 --> 00:07:51,560
‫that we were using for a sound cue so we can swap it out for the rifle impact or shot cue on the muzzle

117
00:07:51,560 --> 00:07:52,010
‫sound.

118
00:07:52,010 --> 00:07:58,370
‫Then the impact sound we're going to switch out for let's go and find it should just be something called

119
00:07:58,370 --> 00:08:00,260
‫impact they go rifle impact cue.

120
00:08:00,740 --> 00:08:06,440
‫We can go ahead and play that now and we can hear a good amount of variation in the sound that was going

121
00:08:06,440 --> 00:08:11,810
‫on there, that the different muzzle flashes sounded different and the impact sounds sounded different.

122
00:08:11,900 --> 00:08:16,220
‫Now, if you're playing this with headphones, you will notice that it all sounds a little bit flat,

123
00:08:16,220 --> 00:08:18,080
‫like there isn't a sense of space.

124
00:08:18,080 --> 00:08:20,780
‫That's what we're going to be dealing with in the next lecture.

125
00:08:20,780 --> 00:08:25,820
‫So in this lecture, what we have done is we've over viewed what a sound cue is and how it can allow

126
00:08:25,820 --> 00:08:32,840
‫us to do lots of cool stuff with sound, including adding randomization and making our sounds less boring.

127
00:08:32,840 --> 00:08:34,340
‫I'll see you in the next lecture.

