Make A Multiplayer Survival Game in UE4 Tutorial | #1 Setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello all right guys what is up welcome to my new course for YouTube it's just gonna be this free course and the reason why I'm doing this course is because someone in my discord right here they gave me this really good resource for this Survival project and the problem though is that well the project is good but the issue is that the guy he the guy who made the project here he has a whole entire where is it he was like a whole entire playlist I don't know he just has a whole playlist here I'll find it actually he's a whole playlist for this whole entire course right here on his channel unfortunately okay come on unfortunately the entire playlist is in Russian and every video is just a live stream of him doing it which you know that's cool and all but I wanted to make a course basically remaking this project because it's it's really a great project he gave it away for free everything you see here he gave for free all sources are available here you can download this right now his project if you want but I thought it would be really fun to basically redo his project and give you guys in like a tutorial format and teach you guys how to make your own survival game with inventory and vendors and all these cool things and so that's what we're gonna do in this project so I gotta open the epic launcher but I'm gonna make a new project for this we're gonna do it in 4.2 four because 4.25 is kind of buggy right now so let's just do that we'll come over to then real engine library we're gonna launch the project get this baby going and I hope you guys are ready can be a fun fun survival project I haven't made a survival game actually in a long time and so this will be a good little project to do on my channel so let's just go to games here and we'll go to third-person next and we'll do a C++ project I think actually you know what we'll do blueprint will start out as blueprint we can always make it C++ later it will call this YouTube survival all right let's create the project here get this thing going so guys I'm just gonna let this load and we will be right back I just gotta load in some assets and everything like that and then we'll get started so be right back alright guys we're back and I was just looking around in the project and assets and things like that and I really don't like the character he was using if you guys want to see what it is I'll show you and again all of his those assets are free you guys can get them from his project if you want but this is the character he's using I don't really like it so for now we're just gonna stick to the default mannequin guy while we build stuff out and then in the future I'll find a like a human character that we can use that will look good and we'll just add that to the project or of course you can always use your own characters here as long as they're rigged to this skeleton here the ue4 skeleton but for now we're just gonna get started we're gonna set up our own character here so let's actually make a new level let's go to let's use the new time of day actually and first thing we're gonna do because the post-processing really gets me annoyed we'll throw this in here we're going to enable it infinity which means it just works everywhere and then we'll just set up the exposure here oops it's way too dark so the smaller the number the brighter it is still way too dark there let's try point one point one seems like a good number so we'll do that then I'm gonna grab this mesh on the floor we'll just scale this baby up boom boom all right that's awkward okay so we got this here I actually am not really sure how this time of day system works this is brand new for four point two four we got this new sky atmosphere thing here maybe we can mess with some of the numbers here I always go super-high numbers just to see what difference it makes so six hundred nine hundred seven hundred six hundred apparently six hundred is fine but seven hundred it doesn't like okay well whatever I don't want to mess too much with these numbers here you guys are free to mess with them but yeah you don't have a fog yet what's this thing oh okay sky dome mesh alright okay that's the light source and then you have the sky light of course light should be on Direct okay yep alright so this is good just keep this how it is and set that back - oh there we go alright so first thing we're gonna do guys yeah well we got to save the level so let's save current let's make a new folder here just right click new folder Maps and in the map folder let's call this the testing level because this little platform here this is where we'll test out a bunch of things and then we'll build out a world right we'll go make a landscape and do things like that later but for now let's just use this world here as a way to test things out and use ctrl L + Mouse to move the Sun around okay ctrl + L how do I even reach there my hands are too small ctrl L Mouse ctrl + left mouse I don't know I don't know what that means ctrl L ctrl L Mouse ctrl + L oh there we go I did it [Music] whoever said ctrl L is a good idea that's crazy okay alright whatever cool let's keep it up high though I'm getting distracted okay so first thing we're gonna do guys is we're going to make our characters so let's come to the content folder new folder this is how I always do my folders that I want my custom stuff in I do underscore and then whatever because underscore puts the folder at the top and that's kind of important form we're just getting there quickly you can also right-click and set the color change the color of the folder there but I'll just keep it like that and let's make our character here's go to let's go of a well here right click blueprint class and let's go to a character you'll call this BP a survival character and this is our base character class let's also make a player controller save those things there and then we're gonna use blueprint interfaces in this project because they are key so we'll make a new folder here call it interfaces and in this folder we will make blueprints blueprint interface I always do int underscore we'll call this a survival character and then we'll make another interface for survival controller and we're gonna go rename the other one this player controller we're gonna rename that actually to survival controller okay so we've got a couple classes set up here and this is very important that's why we're doing this in the first video if you've taken other tutorials before you you've probably learned about casting and casting is really not that good of a thing it really can hurt performance the larger your blueprints get every time you cast to an object it will reference anything that object is referencing as well and then on and there like it just goes on and on so for example a common example is when your game gets really large you might have a main menu that references your game mode with a cast but that cat or but that game mode might have a function that's calling that does something to the AI or even the player okay so every time you cast to that game to the game mode in the main menu the game mode has to load the AI has to load the player and it will load anything else that game mode is referencing and so you'll often find that some people have these games where it takes a whole minute for just the main menu to load and it's because you're loading the whole entire game all from the main menu from that they're doing to the game mode so the way you get around that is you don't use casts you use interfaces and an interface will not load the entire object it doesn't work that way okay so that's why we use interfaces we will not use casting unless it's really really basic like we're casting to like like an act like just a top-level actor or object or something like a save game like a save game object you can cast to and you'll be okay all right so that's just the basic gist of it epic actually did a presentation about why you shouldn't be casting so we're gonna open up the survival character interface here just you can drag it up here we're gonna make this new function called survival care survival care ref and the output here will be our BP underscore survival character okay let's call this the survival care all right that's it for this one for now and we'll come through the controller now we're do the same thing survival controller or ref and the output will be BP underscore so wait BP underscore survival controller survival controller ref all right guys very simple I am will close those and now we got to implement these interfaces in our classes so let's come to the main folder now open up survival character and in the class setup let's go ahead and add this interface of a survival character compile and save now go to file refresh all nodes and then down here on the left you have the survival character reference we can open that up and now we can right click and go get self we can plug that in and now we have our own reference we'll never have to use casting alright let's do the same thing in the survival controller so go them to come to class settings type int int underscore and you'll get the survival controller make sure it's controller compile save refresh all nodes open up this interface function on the Left right-click get self plugin and now we got these things set up and we can call these anytime which we'll be doing later on but I just wanted to show you guys this for now okay let's come back to the survival character class close all this stuff here let's start in the defaults here so I'm gonna turn off tick because we don't need it then I will use control rotation off okay and that's it for the defaults here let's come to character movement let's set this Crouch half height 260 max walk speed to 500 and come down here to the jump velocity we'll go 600 air control 20 we're just setting up default values right now boost of 10 okay and then let's come down here to rotation settings set this to the Z here to 540 so you can rotate quicker and we want to do orient rotation to a movement and let's come down to this movement capabilities can Crouch is true now have agent radius do 42 now have height 192 alright compile save and that's it for the initial setup of the defaults here but let us now do some more basics here so we want to do you with this sky I'm trying I don't know if I want to use this guy as the default for the AI or not let me see what the other guy did for his NPCs let's see citizen oh this will be in blueprints wouldn't it there ok blueprint let's see NPC character the parent class is the survival character okay so he is deriving from this character which is which actually makes sense now okay so this will be it for the survival character for now let's come back to here you can click this browse magnifying glass to return to wherever the asset is very important feature to use when you're using the Unreal Engine so we want to setup the actual default character or the player character so we have survival character this is like our base character okay right click this guy and we'll call this the player we could probably come up with a better name maybe like survival underscore player and then like wealth survival underscore NPC I don't know maybe you can come up with a better name do what you want but in the player let's set him up here let's for our mesh I'm just gonna use like I said we're skin we're gonna start with using just the the the mannequin here but you can always plug in your own meshes if you have them but I like to prototype with just the basic stuff here get all the animations set up first and then you know go from there so I'm just rotating the guy 90 degrees I wanna facing the arrow because the arrow is where the way he will look when he spawns and let's see if we have some more defaults we need to do here it looks good there let's check character movement let's see for some the character movement he has this braking acceleration deceleration set to five thousand on flying I'm not sure why guess we'll find out later okay so now let's set up the camera really quick come up here add a spring arm then add a camera okay in the spring arm our settings will be eight on the Z we got thirty nine on the socket offset here one one nine and then zero here and then we want to check this used pong control rotation you want to make sure that's on very important and of course we can always change these values later if we don't like them and we're setting up a third-person camera here by the way we're doing it first and then we have this is the location he has here 7.5 on the x 0 for the Y and the Z is 56 here so we're kind of over the players left the shoulder might be a bit much but we will see ok so if we come to the world settings here we got to make our game-mode really quick but we can come to the to the main folder here and we can do blueprint class game and we can call this survival game mode open this guy up and in the defaults here in the classes we can set the player controller to be our survival controller and we can set default pawn class to be what do we call it survival player okay we won't be able to move but we should be able to spawn in whoops we have to make sure this level has our game written our game mode setup okay so this is the camera view so far so we have to decide if we want to be closer or not if you want it to be closer you just gotta mess with some of these numbers here for example I could come in the spring arm and maybe make the arm length 200 that'll bring it closer see so now we're really close maybe we want to do like 250 and then maybe I'll do know the height was good but maybe the Y we want to do like 70 not 119 something like that see so it's up to you just messing around with these these numbers here and the socket offset things like that but yeah so let's actually get this guy moving what I want to do is I like to do the moving through the player controller not the actual character so I'm going to open up the survival controller here and once we get this guy moving then we'll end the video and that will be the end of episode 1 in this series which be a pretty large series and we'll be making it over a period of time and don't worry guys unlike other people who do tutorials I will finish this one we will finish it or I don't want to say finish but we'll get to a point where it's very playable and you can just run off and do your own thing ok I don't want to say complete because I mean there's always something new you could add right but we want to get to a playable where you're happy and able to move on and do your own thing so with that said let's do let's set up the movement here if we go to our project settings here and then we come to input we have these axes mappings which are for I'm gonna delete that we don't need a vr these are for your controllers and your game pads this is a wsad it'll show you and your your gump your gamepad your golden pone your gamepad and then your turn rate I believe that's yeah that's so the ones we care about our turn look up move forward move right those are the four we want so we come to the controller we go move right move forward we have turned and then we have look up okay these we can just use in the mouse I believe this is a turn is a yaw add yaw input we just plug that in and I believe this one is pitch at pitch input we just plug that in let's see ya see so that's the yaw on the pitch or set up correctly okay but now we want to be able to move forward and stuff like that so for this we have to do something a little bit different if to go get controlled pong and then you need to make you need to check that it's valid because if you don't do it you'll sometimes get errors just in the beginning and there's a split second where the pawn isn't valid and you get errors because these these functions here they run on tick they're running all like on every frame so there's a split second where the character hasn't spawned yet and so you get errors right here so anyway we want to do this we want to add a movement input and we want to duplicate it and do it down here plug these in here and then plug these up like this okay so now we have to get world direction so I might have this backwards actually yes you won't move forward on the top move right on the bottom okay so if these set up here you must get this just delete the begin play we don't need it right now we're just worried about getting this stuff here so we need to get rotation it's called get control rotation you want to split this you want to drag off the Z and type in make rotator but then you want to plug this actually into the Z so here's a little tip if you hold down the control key you can grab a pin and move it very handy tip then you want to split this pin here and then we have to add it into world direction I can't remember how so give me a second here while I look at the other players movement here apparently there's a way easier way of doing it apparently you can just get the let's see let's see if this works get actor forward vector and then get back there right oops get actor right vector apparently that works let's see oh no it doesn't work completely there is there is issues with that so there is another way of doing it well we're just gonna open up my FPS course cuz I just did this or project I just did this a couple days ago so we're just gonna open them up and see what I did there so the FPS courses I'm actually building on a live stream I'm not doing like a tutorial series like this I'm just building this as a live stream because I'm gonna make a course for this but that's gonna be on udemy not on YouTube I'm doing this one on YouTube because it's already been done this guy already did it it's a great course but it's in Russian so yeah not sure why it's taking so long here I just had this open the other day I'll just cut the video here it's okay okay guys we're back and this is a this is why I didn't want to use 4.25 because it's just buggy right now I just had this project open literally yesterday and for some reason - now opening it has to compile 6000 shaders I have no idea why but this is all I wanted to look at was this this right here so it's good actor rotation make rotator and then get forward vector getting right vector so I'm just gonna close this so it's not this one it's get actor rotation okay so drag off your pawn drag off the get control pawn and well let's get rid of these things yeah drag off this and type and get actor rotation and then right-click the rotator there split it now plug your Z value in to make rotator I'm gonna recombine these and now from these we can do get forward vector and then and get right vector okay let's compile that and save it alright now we can move still a little weird but maybe there's another setting I missed here I might have missed a setting not here but in the in the player here there might be a setting on the movement somewhere you don't want to turn orient rotation to movement off okay there we go no orientation to movement we don't want that on so well maybe we do I can't remember if we need it on then we'll turn it back on but I don't think that's I think we're good I think we're okay in fact you know what why don't I just open up another course of mine this one I know will open quickly since I'm always in this one anyway so we'll get this guy opened up and then we will go check out this the settings for the character they're just to make sure we got the movement set up correctly so let's go to the oh this is big as f okay player controller here oh no that's not what I want I want the hero character so in the hero character we have the mesh is it no where do we set this these things up is it defaults no no think it's the spring arm so let's check the spring arm here okay we do have that checked and then we have character movement let's check our character movement down here we do have Orient rotation the movement checked so let me go ahead and recheck that there and then in the spring arm that's check correctly okay so let's try it again yeah okay so this is how we want we do want it like this maybe we'll figure it out guys but basically when you turn left the player will be running left right now yeah we'll figure it out but yeah it just doesn't look good because we don't have animations or anything set up which we'll get set up soon guys the next video will set that up so the player can actually run around and look decent so we'll get that set up just so you know what it looks like when it is set up correctly I'll show you my other game which looks like this use running around so it's up to you if you want to do it this way or if you want the camera stuck behind the player at all times yeah so anyway guys thanks for watching episode 1 and we'll be back with next video tomorrow where we'll flush out the animation so I'll see you then
Info
Channel: DevAddict
Views: 98,874
Rating: undefined out of 5
Keywords: survival game tutorial, ue4 survival game, unreal engine 4 tutorial, coop survival game, make a game in ue4, Devaddict
Id: maG2YnVnIVM
Channel Id: undefined
Length: 32min 36sec (1956 seconds)
Published: Wed May 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.