‫Hello and welcome.
‫In this lecture, we're going to be talking about compilers and editors figuring out what they are and
‫why we need them when we want to write C++.
‫So let's start off with a few glossary definitions and we'll see how they fit into the wider ecosystem.
‫First of all, source code.
‫This is crucial to understanding why we need a compiler in the first place.
‫Source code is the code we write.
‫It's usually text.
‫It's a human readable form of code such as C++.
‫But sometimes you could think of source code as being blueprints as well.
‫They're human readable ways of describing what you'd like your game to do, what you'd like the computer
‫to do.
‫And crucially, it's the human readable part because it's not meant for a machine to be able to execute
‫this, to be able to make it run.
‫That is the role of binary executable.
‫It is usually binary code ones and zeros, and it is intended for a machine to be able to quickly read
‫it and execute it on your CPU and on your CPU.
‫And so it is machine readable code.
‫So between these two there is a gap and we need to fix that gap so that we can convert our human readable
‫code into machine readable code.
‫And that is the role of this so called compiler.
‫It translates from the human readable C++ or blueprints.
‫As we've seen before, we've come across blueprint compiler errors and stuff like that.
‫So it translates from the human to the machine domains and creates those XY files or those binary files
‫or whatever platform you're on.
‫And obviously there's a lot of complexity involved in what a compiler does, and we'll learn more about
‫some of the more intricate parts of it later down the line.
‫But for now, it's enough to know that it is a piece of software that converts from source code to binary
‫code.
‫And then there's another piece of software in the mix called a source code editor, which simply is
‫there to make your life easier when writing human readable code like C++.
‫It just gives us things like autocomplete and highlights any errors that we may have typed automatically,
‫a bit like a spell checker, so it can make our life a lot easier when dealing with source code.
‫So let's see how this all fits together in the unreal ecosystem.
‫So we've been dealing up till now with the editor.
‫We the editor is a piece of software and is one that has already been compiled for us and we already
‫have the executable for that editor when we went and installed it.
‫So we can open up the editor.
‫The editor allows us to modify and create our game project using various game assets.
‫These include things like the meshes that we've brought into our project.
‫They include the blueprint assets and blueprint code in there.
‫And what this allows us to do is using these game assets that we've created in an editor, we can then
‫run the game in a separate standalone executable where it just plays the game and nothing else.
‫However, the picture changes a little bit if we want to start using C++.
‫C++ is the bedrock of the editor, and as such, if we changing the C++ in the editor, we essentially
‫need to rebuild the editors binary executable.
‫So if we have our source code over here, we know that it looks a little bit like this.
‫We've got some text.
‫Basically, it's what makes up our source code and we edit this source code again using a separate piece
‫of software called a source code editor previously blueprint.
‫We've been editing it all within The Unreal editor because it is tightly integrated with the software.
‫However, when we're dealing with C++, we're using third party software to edit the code.
‫Now, the one we're going to be using in this course is called Visual Studio Code because it is cross-platform
‫works on Mac, Linux and Windows just perfectly and it's also very lightweight.
‫But like I said, there's this gap between the source code we've written and turning it into the binary
‫executable required for running the game in the editor and in the actual final game product.
‫And that bit is the compiler.
‫The compiler will take our source code, it will take the libraries and functionality already built
‫into Unreal that we use in our source code.
‫It will compile these together, turn them into binary and output.
‫Either an editor that we can open up and edit our game assets or it will output a game which will take
‫our game assets and allow the player just to play our game.
‫Now there are two choices of compiler depending on which platform you're on.
‫If you're on Windows, we're going to be using Visual Studio, so don't get these too confused.
‫They have very similar logos and very similar names.
‫One is Visual Studio, which is the compiler, and then there's one that is just the source code editor,
‫and that one's called Visual Studio Code.
‫Now, if you're on a mac, you instead are going to be using X code which.
‫Is the compiler over on the Mac to keep things cross-platform, to keep things the same for everybody.
‫We're going to be using Visual Studio code to actually edit the code, even though these compilers have
‫source code editing capabilities built in.
‫But we'll be using these compilers to actually take the source code and turn it in to binary executable.
‫Okay, so that's it for this lecture.
‫Hopefully you're a little bit clearer on why we need a compiler, why we need the source code editor.
‫The next few lectures, we're going to go through the process of installing those.
‫I'll see you there.