﻿1
00:00:04,460 --> 00:00:08,180
‫In this lecture, we're going to be adding a little bit of polish with some background music

2
00:00:10,970 --> 00:00:17,390
‫and a little bit of an introduction text and a little bit of an introduction sound as well.

3
00:00:17,390 --> 00:00:23,450
‫And we're going to look at a list of things that you could improve and build upon in this shooter project

4
00:00:23,450 --> 00:00:25,880
‫as mega challenges for yourself.

5
00:00:25,880 --> 00:00:26,750
‫Let's dive in.

6
00:00:27,590 --> 00:00:32,060
‫So it is nearly time to wrap up and for me to say goodbye.

7
00:00:32,060 --> 00:00:37,910
‫But before we do, I would like to leave you with a few challenges to expand upon this project.

8
00:00:37,910 --> 00:00:42,350
‫These are my mega challenges, distinguished in the fact that I won't be showing you all of the solutions.

9
00:00:42,350 --> 00:00:47,210
‫For that, you're going to have to rely on the community and talk to each other and help each other

10
00:00:47,210 --> 00:00:48,740
‫out and really explore the engine.

11
00:00:48,740 --> 00:00:52,310
‫Hopefully this will help you really get to grips with Unreal.

12
00:00:52,670 --> 00:00:58,490
‫So the first mega challenge is going to be level layout and I am going to do some of that in this lecture.

13
00:00:58,490 --> 00:01:03,920
‫So basically, I mean, layout your level, put your enemies where you want them to be, make it really

14
00:01:03,920 --> 00:01:06,380
‫a challenge, try and play test, try and play.

15
00:01:06,410 --> 00:01:10,460
‫Get your family and friends to play the level and try it out.

16
00:01:10,670 --> 00:01:12,200
‫The next one is background music.

17
00:01:12,200 --> 00:01:15,920
‫I do have some background music assets in there and again in this lecture I'm going to show you how

18
00:01:15,920 --> 00:01:17,000
‫you could add those in.

19
00:01:17,240 --> 00:01:21,860
‫So if you want a challenge for this lecture, you can pause the video and have a go right now.

20
00:01:21,860 --> 00:01:22,280
‫Okay.

21
00:01:22,280 --> 00:01:22,910
‫Welcome back.

22
00:01:22,910 --> 00:01:26,150
‫So I'm going to go in and do these challenges just a bit.

23
00:01:26,150 --> 00:01:29,690
‫But in case these were not the ones that you want to tackle and you want to try some other things,

24
00:01:29,690 --> 00:01:31,700
‫here are the rest of my challenges for you.

25
00:01:31,820 --> 00:01:34,520
‫One of them is to implement weapon switching.

26
00:01:34,520 --> 00:01:39,530
‫At the moment we've got quite a flexible weapon architecture that would support weapon switching, but

27
00:01:39,530 --> 00:01:41,060
‫at the moment it does not.

28
00:01:41,060 --> 00:01:44,510
‫So I'm going to give you some pointers on how you might want to go ahead and implement that.

29
00:01:44,510 --> 00:01:47,420
‫But I'm not going to go through the entirety of the process with you.

30
00:01:47,540 --> 00:01:49,880
‫The other one is implementing ammo with the weapon.

31
00:01:49,880 --> 00:01:54,580
‫Again, I'm going to give you some pointers on the process here, but not the actual code.

32
00:01:55,340 --> 00:01:56,930
‫Then some more advanced A.I..

33
00:01:56,960 --> 00:01:57,800
‫What do I mean by this?

34
00:01:57,800 --> 00:02:02,750
‫Well, if you're introducing ammo and weapon switching, maybe your eye needs to know when to use each

35
00:02:02,750 --> 00:02:03,800
‫one of these.

36
00:02:03,800 --> 00:02:07,610
‫So you might need to add in some behaviors for switching weapons and so on.

37
00:02:07,610 --> 00:02:13,160
‫You might also want to have an I have an idea of whether it's under fire, whether it's being shot at,

38
00:02:13,160 --> 00:02:18,980
‫in which case it might want to try and take cover so you can have some more advanced behaviors like

39
00:02:18,980 --> 00:02:19,460
‫that.

40
00:02:19,460 --> 00:02:23,960
‫All that can be implemented with behavior, trees and services and custom tasks.

41
00:02:24,620 --> 00:02:30,920
‫You might want a main menu in order to select between multiple levels and yes, multiple levels.

42
00:02:30,920 --> 00:02:37,070
‫Add in some other layouts of level, put your eye differently, make it more challenging, have a progression,

43
00:02:37,070 --> 00:02:41,960
‫and have it so that you move from one level to the next when you succeed.

44
00:02:41,960 --> 00:02:46,670
‫Now, I'm going to go through the details of weapon switching and ammo in just a second.

45
00:02:46,670 --> 00:02:49,190
‫But first, we're going to do our level layout.

46
00:02:49,490 --> 00:02:53,930
‫The first thing I want to do is move my player, start to more of a neutral location.

47
00:02:53,930 --> 00:02:58,700
‫So I'm going to delete the main player start we've got and I'm going to stick the player start over

48
00:02:58,700 --> 00:02:59,420
‫here instead.

49
00:02:59,420 --> 00:03:05,180
‫So I'm going to look for a place, Actors Pane, and I'm going to look for the player, start and stick

50
00:03:05,180 --> 00:03:05,870
‫it in here.

51
00:03:06,870 --> 00:03:10,050
‫And that should mean when we hit play that we end up in this corridor.

52
00:03:10,080 --> 00:03:10,830
‫That's good.

53
00:03:11,250 --> 00:03:14,810
‫Next up, what I want to do is add in some enemies.

54
00:03:14,820 --> 00:03:16,740
‫I'm going to put one enemy in here.

55
00:03:16,740 --> 00:03:18,510
‫So BP shoots a character in here.

56
00:03:18,510 --> 00:03:19,530
‫There's one enemy.

57
00:03:19,680 --> 00:03:22,050
‫Then we've got already an enemy over here.

58
00:03:22,050 --> 00:03:22,770
‫I like that.

59
00:03:22,770 --> 00:03:26,940
‫I'm going to add a couple of enemies, one over here and one down here.

60
00:03:26,940 --> 00:03:31,080
‫So you have to kind of go out of your way to find them and they're going to try and shoot at you and

61
00:03:31,080 --> 00:03:32,820
‫come and find you as soon as possible.

62
00:03:33,300 --> 00:03:35,190
‫Then we've got one enemy over there.

63
00:03:35,190 --> 00:03:35,880
‫That's good.

64
00:03:35,880 --> 00:03:38,160
‫I might stick and just sticking enemies everywhere.

65
00:03:38,160 --> 00:03:40,560
‫One round this corner, one up here.

66
00:03:40,560 --> 00:03:41,610
‫That's great.

67
00:03:41,970 --> 00:03:42,900
‫Another one.

68
00:03:42,900 --> 00:03:44,100
‫Maybe here.

69
00:03:44,160 --> 00:03:48,510
‫Maybe a couple down here to shoot at you as well.

70
00:03:49,770 --> 00:03:52,650
‫Maybe one up at the top of the stairs here.

71
00:03:53,510 --> 00:03:57,560
‫To just shoot down from rain, bloody fire from up there.

72
00:03:57,620 --> 00:04:05,990
‫And then we're going to stick a quite a few in this command center type room, one few to ambush you

73
00:04:05,990 --> 00:04:11,240
‫round the corner here and maybe one or two down in this little pit.

74
00:04:11,750 --> 00:04:12,500
‫There we go.

75
00:04:12,770 --> 00:04:14,540
‫Now, this room is going to be a real challenge.

76
00:04:14,540 --> 00:04:17,000
‫When you come in here, you're just going to be shot to pieces.

77
00:04:17,000 --> 00:04:20,960
‫So if we go ahead and play, we're going to go and try this out.

78
00:04:20,960 --> 00:04:25,850
‫It's going to be pretty tough at the moment and you may want to tweak it much further.

79
00:04:25,850 --> 00:04:27,350
‫I'm just going to mute here.

80
00:04:28,280 --> 00:04:33,350
‫You want to tweak it further and tweak the amount of health you have, maybe to make it the right level

81
00:04:33,350 --> 00:04:39,860
‫of challenge, or maybe you want to tweak how many eye there are in the level, all that sort of thing

82
00:04:39,860 --> 00:04:44,210
‫you can try by playing through and just testing this game to bits.

83
00:04:44,210 --> 00:04:48,440
‫And then one final thing I want to do is add some background music and some ambience.

84
00:04:48,440 --> 00:04:54,770
‫So if you look for sound in the place actors, you can see there's an ambient sound actor.

85
00:04:54,770 --> 00:04:57,170
‫We can drag this into the world.

86
00:04:57,170 --> 00:05:00,740
‫It doesn't really matter where because it's going to play some sound everywhere.

87
00:05:00,920 --> 00:05:06,620
‫And then what we want to do is select a sound from here, which I'm going to look for music and we basically

88
00:05:06,620 --> 00:05:11,930
‫want the shooter game music here and you can pretty much just leave that as it is.

89
00:05:11,930 --> 00:05:17,030
‫And if we go and hit play, you can see that we've got our background music going on, giving us a lot

90
00:05:17,060 --> 00:05:18,410
‫nicer ambience here.

91
00:05:18,410 --> 00:05:22,400
‫And then one more thing I want to do is just add a little bit of an intro text, which I'm going to

92
00:05:22,400 --> 00:05:28,100
‫do from our player shooter character and I'm going to open up in the blueprint here, open up the full

93
00:05:28,100 --> 00:05:35,030
‫blueprint editor and I'm going to go to the event graph and off of the Begin Play node, we're going

94
00:05:35,030 --> 00:05:41,720
‫to add a play sound at location, the location I want to be the actor location.

95
00:05:41,720 --> 00:05:47,390
‫So and then the sound asset that we want is going to be, I believe I've got something called intro,

96
00:05:47,390 --> 00:05:51,920
‫which is something that I recorded myself just to say, you know, let's go and kill these guys in the

97
00:05:51,920 --> 00:05:54,050
‫level or something to that effect.

98
00:05:54,050 --> 00:05:59,870
‫So now if we go ahead and hit play, we get a little bit of that introduction telling the player what

99
00:05:59,870 --> 00:06:02,240
‫to do, that they need to go and clear this base.

100
00:06:02,240 --> 00:06:03,710
‫Of all of the enemies.

101
00:06:03,710 --> 00:06:07,940
‫Now, as promised, what are we going to do with things like weapon switching and ammo?

102
00:06:07,940 --> 00:06:10,100
‫Well, weapon switching roughly.

103
00:06:10,100 --> 00:06:12,470
‫The flow is going to look like this.

104
00:06:12,740 --> 00:06:18,410
‫First of all, you're going to add an array of weapons or weapon classes to the character so that it

105
00:06:18,410 --> 00:06:25,070
‫knows which weapons it can use, spawn all of those weapons into yet another array so that you can keep

106
00:06:25,070 --> 00:06:28,280
‫track of the different weapons that our character has.

107
00:06:28,280 --> 00:06:33,470
‫So basically we're going from using a single weapon class and a single weapon instance to having an

108
00:06:33,470 --> 00:06:34,850
‫array for both of them.

109
00:06:35,030 --> 00:06:40,790
‫Then you want to have something like an active index integer that keeps track of which weapon is currently

110
00:06:40,790 --> 00:06:41,720
‫the active one.

111
00:06:42,020 --> 00:06:47,390
‫You're going to hide all of the weapons, basically deactivate and hide all of the weapons except for

112
00:06:47,390 --> 00:06:49,310
‫the one in the active index.

113
00:06:49,460 --> 00:06:55,040
‫And then you might want to bind the scroll wheel or the numbers so that that changes up your active

114
00:06:55,040 --> 00:07:00,050
‫index and you can update once you do that, once you change the active index, you want to make sure

115
00:07:00,050 --> 00:07:03,410
‫you're updating the weapon that is currently visible.

116
00:07:03,410 --> 00:07:10,010
‫And you also need to make sure that you bind the fire so that it selects whichever weapon is currently

117
00:07:10,010 --> 00:07:14,870
‫active so that it uses the fire method, the trigger method of your currently active weapon.

118
00:07:14,870 --> 00:07:19,220
‫So that's weapon switching a brief kind of outline of how you would implement that and how you'd go

119
00:07:19,220 --> 00:07:20,270
‫about trying that.

120
00:07:20,300 --> 00:07:23,720
‫The other one is ammo, which is also fairly straightforward.

121
00:07:23,720 --> 00:07:29,990
‫If you follow along with these steps, you're going to need some sort of ammo variable on your weapon,

122
00:07:29,990 --> 00:07:32,480
‫basically an integer saying, How much ammo do you have left?

123
00:07:32,510 --> 00:07:36,320
‫You're going to subtract from that every shot until you get down to zero.

124
00:07:36,320 --> 00:07:37,670
‫Very much like health, really.

125
00:07:37,670 --> 00:07:40,880
‫If you think about it, you're going to prevent from shooting there.

126
00:07:41,090 --> 00:07:42,140
‫It won't be possible to shoot.

127
00:07:42,140 --> 00:07:47,090
‫If your amigo is less than zero, you play some sort of empty sound to give a signal to the player and

128
00:07:47,090 --> 00:07:49,460
‫you might want to create some sort of pickup actor.

129
00:07:49,460 --> 00:07:56,030
‫So create a new actor, something that derives from actor, add a collider, add a mesh to it so that

130
00:07:56,030 --> 00:08:02,930
‫when you overlap with it, when an actor, a character overlaps with it, you're going to get hold of

131
00:08:02,930 --> 00:08:08,480
‫the currently active weapon on that character and you're going to add your ammo to it.

132
00:08:08,480 --> 00:08:14,240
‫And finally, you probably want to disable collisions and hide the mesh, at least for a short amount

133
00:08:14,240 --> 00:08:14,540
‫of time.

134
00:08:14,540 --> 00:08:19,430
‫You might want to re-enable it on a timer, but you want to disable it at first once you've gone over

135
00:08:19,430 --> 00:08:24,710
‫that pickup so that you aren't continually refueling your ammo while you stand on it.

136
00:08:24,710 --> 00:08:25,850
‫So that's it for this lecture.

137
00:08:25,850 --> 00:08:31,520
‫I'll leave you with the challenge slide of things that you can do to expand on what's already there.

138
00:08:31,520 --> 00:08:38,420
‫Do check out the Q&A and the discussions and our Discord Channel for input, feedback and other people

139
00:08:38,420 --> 00:08:44,300
‫who are sharing what they have done to continue their journey with this shooter game.

140
00:08:44,310 --> 00:08:46,280
‫Can't wait to see what you make with it.

141
00:08:46,400 --> 00:08:48,860
‫I will see you in the discussions.

