Learn this before C++ - Unreal Engine Build Tool Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] this video sponsored by Michaels the Unreal Engine C++ survival calls using my knowledge from working in the industry we start from the basics and work our way up until we've created an online survival game with C++ we create vehicles clothing weapons steam matchmaking and much more get lifetime access to $25 using the link in the description hey guys and welcome back today we're gonna be talking about a feature that separates a lot of novices from people that really know what they're doing and that is knowing the Unreal build tool and really just knowing the core of how the engine works a lot of people jump straight in and they learn about actors and making vehicles and weapons and all this stuff but at the core of it all is building your game and your game is made out of something called modules so I guess we'll start with those I've got a project open here don't worry about following anything that I'm doing this is pretty much all for example but here's pretty much an empty project this is from my plugins video and I just want to demonstrate sort of the structure of a project how it works and this stuff I really wish that I had learned this when I started learning unreal it would have saved me so much pain so in about 10 minutes you will be a much better developer I promise you okay so we're gonna start with the you project file so we'll open that up so every project comes with a you project file but the thing that I want to focus on here is this modules array and you're--you project and right out the bed it's listed this plug-in test thing that's the name of my project is plug-in test this is actually my game so the first thing to understand is that your game is a module and you know something's our module because it will have a folder and then the folder is some code and then a bill dot CIS file if I come up here to the engine and look at some of the engine stuff all of these here are modules you can see stuff like the cloth painter the animgraph this is the entire source code for the editor all these folders here are actually modules and again we can tell that because if you expand them you can see these build files so that's kind of an interesting insight the entire engine is build out of these things called modules and your game itself is a module and evidence to back that up is obviously the build file if you go to your plugin tests or whatever your projects called that's EBP you can actually see we use this macro to implement the game module so that is actually implementing the game right there so let's talk about the build files next the build files are just there to specify how your module should be built and any project that you make an unreal this is the default build file that you'll get and you can see that it uses four modules that has core core you object engine and input core these are like the four base modules to get a game up and running and you it's pretty self-explanatory of what a lot of these do like input is for handling input but here's the thing these are just modules if we go up here to the source code of the engine we get a runtime you can actually see these modules core call you object engine input core and so you can go into these modules and you can look at the source code for how the input works in unreal if I wanted to use slate UI in my project I could just uncomment this and now I'm using these slate and slate core modules in my project a lot of people get confused as well by private dependency multiple names and public depends dependency module names and all that does is the public ones are usable by anything in the public folder so you can see here all of these files can access these modules and then the private folder is for the private dependency module names some really old modules have a classes folder don't worry about that that's a legacy thing and you don't need to be concerned with that anymore private and public are the main ones that are used nowadays so your game is a module the engine is made out of modules the truly plugins can't be made out of modules to it well of course there everything is made out of modules so here I've got this crystal that I made called narrative I've included that as a plug-in in my project and if I have a look at the structure of a plug-in we'll just look at my narrative one here and I open the you plug in a you plug in file looks really similar to the year project file just lists all of the modules that are going to be in this project and we'll go a little bit more in depth you can see here that there are some options for blacklisting certain platforms so say you have a module that does some windows specific stuff you might want a blacklist Mac and Linux from your plugin you can also define when modules are loaded which is pretty handy if you want certain modules to load before or after other ones and then you have the type of modules so there's runtime modules which are like part of your actual game and then there's editor modules and modules are usually changing the functionality of the Unreal Engine so because my quiz tool modifies the engine it does have some editor modules in there as well now onto the next file that confuses a lot of people is the target file and the target file really just lets you define different sort of ways of building for different targets here in my survival project that is from my course we actually create four different targets you've got one for like the server and you can see here we're defining things that only the server built needs to have but then the clients that are connecting to the server they don't need all the same information you can see they actually get a little bit less information in their build of the game so it kind of lets you customize the game's build on a per target basis one last thing that confuses a lot of beginners that I thought I'd just show you because it's actually pretty cool to understand how this works is you might make a server function and the the server function when you implement it it has an underscore implementation and it has like an underscore validate which I'll show you now so how is it that I can define a server loot item function but then implement it as underscore validate underscore implementation clearly this is breaking the rules of C++ but it actually isn't when you build your game the Unreal build tool works to do its thing but it also something called the Unreal header tool works and what the Unreal hitted tool will do is it'll see these keywords here and then in this file here the generated file it does some magic so let's have a look at the survival character dot generated if I right click and open it up here is everything that it's doing and it's really unreadable because this is not meant to be read by humans this is just compiler magic macros and all that stuff making this work but you can see here it is it's defining all of these underscore implementations for us you can even see Ritz these RPC wrappers and there's so much more that it's doing I mean honestly I'm not sure what a lot of this does but generally it just looks like implementations for some of the our pcs and things like that but yeah this is where a lot of the magic comes from a lot of these things where you're kind of confused about how how does this work yeah you know how does this work with this is totally defying the laws of C++ well it's actually this generated file is doing a lot of the magic now what if something wrong happens in this generated age well unreal the thought about this if you hover over this you can see it's in the intermediate folder and actually if I right-click on my project which is in my solution remember a solution is just a bunch of projects basically so we're gonna right click on my project here and I'll show it in the file explorer notice that all of the generated files and projects and everything they're all in this intermediate folder so if you do have a problem with this generated file you can totally just delete your intermediate folder rebuild your game and these can just be generated whenever you want right the unreal head at all can just remake them so you can safely delete these files if you think it's worth doing if you think maybe there was a mistake and you want to regenerate them you can totally do that so I hope you enjoy kind of the basics I really wish someone had told me this stuff when I started and I feel like that's the minimum you should know there's a ton more for example here's the engine build you can see I mean obviously this is the engine module it's absolutely massive but they use a lot more stuff in here and you can do like conditional adding of dependencies you can see here they're only doing something if the platform's not html5 and lots of things like this so if you look through the engine modules you can learn a lot more about how the build tool works but if you just learn the stuff that I've described in this video you will be a much better developer for it and it'll probably save you quite a lot of headaches as well anyways thank you very much for watching my video if you want to support me try out my course it's really good I think you'll like it but anyways guys thank you for watching and I'll see you guys in the next video
Info
Channel: reubs
Views: 29,026
Rating: undefined out of 5
Keywords: Unreal, Engine, C++, Tutorial, Beginner, Game, Programming
Id: j4Sq0FpsmIU
Channel Id: undefined
Length: 8min 50sec (530 seconds)
Published: Mon May 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.