‫In this lecture, we're going to be adding a little bit of polish with some background music
‫and a little bit of an introduction text and a little bit of an introduction sound as well.
‫And we're going to look at a list of things that you could improve and build upon in this shooter project
‫as mega challenges for yourself.
‫Let's dive in.
‫So it is nearly time to wrap up and for me to say goodbye.
‫But before we do, I would like to leave you with a few challenges to expand upon this project.
‫These are my mega challenges, distinguished in the fact that I won't be showing you all of the solutions.
‫For that, you're going to have to rely on the community and talk to each other and help each other
‫out and really explore the engine.
‫Hopefully this will help you really get to grips with Unreal.
‫So the first mega challenge is going to be level layout and I am going to do some of that in this lecture.
‫So basically, I mean, layout your level, put your enemies where you want them to be, make it really
‫a challenge, try and play test, try and play.
‫Get your family and friends to play the level and try it out.
‫The next one is background music.
‫I do have some background music assets in there and again in this lecture I'm going to show you how
‫you could add those in.
‫So if you want a challenge for this lecture, you can pause the video and have a go right now.
‫Okay.
‫Welcome back.
‫So I'm going to go in and do these challenges just a bit.
‫But in case these were not the ones that you want to tackle and you want to try some other things,
‫here are the rest of my challenges for you.
‫One of them is to implement weapon switching.
‫At the moment we've got quite a flexible weapon architecture that would support weapon switching, but
‫at the moment it does not.
‫So I'm going to give you some pointers on how you might want to go ahead and implement that.
‫But I'm not going to go through the entirety of the process with you.
‫The other one is implementing ammo with the weapon.
‫Again, I'm going to give you some pointers on the process here, but not the actual code.
‫Then some more advanced A.I..
‫What do I mean by this?
‫Well, if you're introducing ammo and weapon switching, maybe your eye needs to know when to use each
‫one of these.
‫So you might need to add in some behaviors for switching weapons and so on.
‫You might also want to have an I have an idea of whether it's under fire, whether it's being shot at,
‫in which case it might want to try and take cover so you can have some more advanced behaviors like
‫that.
‫All that can be implemented with behavior, trees and services and custom tasks.
‫You might want a main menu in order to select between multiple levels and yes, multiple levels.
‫Add in some other layouts of level, put your eye differently, make it more challenging, have a progression,
‫and have it so that you move from one level to the next when you succeed.
‫Now, I'm going to go through the details of weapon switching and ammo in just a second.
‫But first, we're going to do our level layout.
‫The first thing I want to do is move my player, start to more of a neutral location.
‫So I'm going to delete the main player start we've got and I'm going to stick the player start over
‫here instead.
‫So I'm going to look for a place, Actors Pane, and I'm going to look for the player, start and stick
‫it in here.
‫And that should mean when we hit play that we end up in this corridor.
‫That's good.
‫Next up, what I want to do is add in some enemies.
‫I'm going to put one enemy in here.
‫So BP shoots a character in here.
‫There's one enemy.
‫Then we've got already an enemy over here.
‫I like that.
‫I'm going to add a couple of enemies, one over here and one down here.
‫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
‫come and find you as soon as possible.
‫Then we've got one enemy over there.
‫That's good.
‫I might stick and just sticking enemies everywhere.
‫One round this corner, one up here.
‫That's great.
‫Another one.
‫Maybe here.
‫Maybe a couple down here to shoot at you as well.
‫Maybe one up at the top of the stairs here.
‫To just shoot down from rain, bloody fire from up there.
‫And then we're going to stick a quite a few in this command center type room, one few to ambush you
‫round the corner here and maybe one or two down in this little pit.
‫There we go.
‫Now, this room is going to be a real challenge.
‫When you come in here, you're just going to be shot to pieces.
‫So if we go ahead and play, we're going to go and try this out.
‫It's going to be pretty tough at the moment and you may want to tweak it much further.
‫I'm just going to mute here.
‫You want to tweak it further and tweak the amount of health you have, maybe to make it the right level
‫of challenge, or maybe you want to tweak how many eye there are in the level, all that sort of thing
‫you can try by playing through and just testing this game to bits.
‫And then one final thing I want to do is add some background music and some ambience.
‫So if you look for sound in the place actors, you can see there's an ambient sound actor.
‫We can drag this into the world.
‫It doesn't really matter where because it's going to play some sound everywhere.
‫And then what we want to do is select a sound from here, which I'm going to look for music and we basically
‫want the shooter game music here and you can pretty much just leave that as it is.
‫And if we go and hit play, you can see that we've got our background music going on, giving us a lot
‫nicer ambience here.
‫And then one more thing I want to do is just add a little bit of an intro text, which I'm going to
‫do from our player shooter character and I'm going to open up in the blueprint here, open up the full
‫blueprint editor and I'm going to go to the event graph and off of the Begin Play node, we're going
‫to add a play sound at location, the location I want to be the actor location.
‫So and then the sound asset that we want is going to be, I believe I've got something called intro,
‫which is something that I recorded myself just to say, you know, let's go and kill these guys in the
‫level or something to that effect.
‫So now if we go ahead and hit play, we get a little bit of that introduction telling the player what
‫to do, that they need to go and clear this base.
‫Of all of the enemies.
‫Now, as promised, what are we going to do with things like weapon switching and ammo?
‫Well, weapon switching roughly.
‫The flow is going to look like this.
‫First of all, you're going to add an array of weapons or weapon classes to the character so that it
‫knows which weapons it can use, spawn all of those weapons into yet another array so that you can keep
‫track of the different weapons that our character has.
‫So basically we're going from using a single weapon class and a single weapon instance to having an
‫array for both of them.
‫Then you want to have something like an active index integer that keeps track of which weapon is currently
‫the active one.
‫You're going to hide all of the weapons, basically deactivate and hide all of the weapons except for
‫the one in the active index.
‫And then you might want to bind the scroll wheel or the numbers so that that changes up your active
‫index and you can update once you do that, once you change the active index, you want to make sure
‫you're updating the weapon that is currently visible.
‫And you also need to make sure that you bind the fire so that it selects whichever weapon is currently
‫active so that it uses the fire method, the trigger method of your currently active weapon.
‫So that's weapon switching a brief kind of outline of how you would implement that and how you'd go
‫about trying that.
‫The other one is ammo, which is also fairly straightforward.
‫If you follow along with these steps, you're going to need some sort of ammo variable on your weapon,
‫basically an integer saying, How much ammo do you have left?
‫You're going to subtract from that every shot until you get down to zero.
‫Very much like health, really.
‫If you think about it, you're going to prevent from shooting there.
‫It won't be possible to shoot.
‫If your amigo is less than zero, you play some sort of empty sound to give a signal to the player and
‫you might want to create some sort of pickup actor.
‫So create a new actor, something that derives from actor, add a collider, add a mesh to it so that
‫when you overlap with it, when an actor, a character overlaps with it, you're going to get hold of
‫the currently active weapon on that character and you're going to add your ammo to it.
‫And finally, you probably want to disable collisions and hide the mesh, at least for a short amount
‫of time.
‫You might want to re-enable it on a timer, but you want to disable it at first once you've gone over
‫that pickup so that you aren't continually refueling your ammo while you stand on it.
‫So that's it for this lecture.
‫I'll leave you with the challenge slide of things that you can do to expand on what's already there.
‫Do check out the Q&A and the discussions and our Discord Channel for input, feedback and other people
‫who are sharing what they have done to continue their journey with this shooter game.
‫Can't wait to see what you make with it.
‫I will see you in the discussions.