﻿1
00:00:04,390 --> 00:00:05,530
‫Hello and welcome.

2
00:00:05,530 --> 00:00:11,590
‫In this lecture, we're going to be talking about compilers and editors figuring out what they are and

3
00:00:11,590 --> 00:00:14,770
‫why we need them when we want to write C++.

4
00:00:14,770 --> 00:00:20,950
‫So let's start off with a few glossary definitions and we'll see how they fit into the wider ecosystem.

5
00:00:21,340 --> 00:00:23,050
‫First of all, source code.

6
00:00:23,050 --> 00:00:26,680
‫This is crucial to understanding why we need a compiler in the first place.

7
00:00:26,680 --> 00:00:29,500
‫Source code is the code we write.

8
00:00:29,500 --> 00:00:30,490
‫It's usually text.

9
00:00:30,490 --> 00:00:34,150
‫It's a human readable form of code such as C++.

10
00:00:34,150 --> 00:00:37,060
‫But sometimes you could think of source code as being blueprints as well.

11
00:00:37,060 --> 00:00:43,000
‫They're human readable ways of describing what you'd like your game to do, what you'd like the computer

12
00:00:43,000 --> 00:00:43,720
‫to do.

13
00:00:43,720 --> 00:00:51,460
‫And crucially, it's the human readable part because it's not meant for a machine to be able to execute

14
00:00:51,460 --> 00:00:53,470
‫this, to be able to make it run.

15
00:00:53,560 --> 00:00:57,280
‫That is the role of binary executable.

16
00:00:57,280 --> 00:01:04,210
‫It is usually binary code ones and zeros, and it is intended for a machine to be able to quickly read

17
00:01:04,210 --> 00:01:07,770
‫it and execute it on your CPU and on your CPU.

18
00:01:07,780 --> 00:01:10,540
‫And so it is machine readable code.

19
00:01:10,540 --> 00:01:17,470
‫So between these two there is a gap and we need to fix that gap so that we can convert our human readable

20
00:01:17,470 --> 00:01:19,240
‫code into machine readable code.

21
00:01:19,240 --> 00:01:22,840
‫And that is the role of this so called compiler.

22
00:01:22,840 --> 00:01:26,800
‫It translates from the human readable C++ or blueprints.

23
00:01:26,800 --> 00:01:31,270
‫As we've seen before, we've come across blueprint compiler errors and stuff like that.

24
00:01:31,270 --> 00:01:38,230
‫So it translates from the human to the machine domains and creates those XY files or those binary files

25
00:01:38,230 --> 00:01:39,940
‫or whatever platform you're on.

26
00:01:40,060 --> 00:01:46,000
‫And obviously there's a lot of complexity involved in what a compiler does, and we'll learn more about

27
00:01:46,000 --> 00:01:49,300
‫some of the more intricate parts of it later down the line.

28
00:01:49,300 --> 00:01:55,000
‫But for now, it's enough to know that it is a piece of software that converts from source code to binary

29
00:01:55,000 --> 00:01:55,390
‫code.

30
00:01:55,390 --> 00:02:00,820
‫And then there's another piece of software in the mix called a source code editor, which simply is

31
00:02:00,820 --> 00:02:06,130
‫there to make your life easier when writing human readable code like C++.

32
00:02:06,130 --> 00:02:13,780
‫It just gives us things like autocomplete and highlights any errors that we may have typed automatically,

33
00:02:13,780 --> 00:02:19,060
‫a bit like a spell checker, so it can make our life a lot easier when dealing with source code.

34
00:02:19,120 --> 00:02:23,380
‫So let's see how this all fits together in the unreal ecosystem.

35
00:02:23,380 --> 00:02:27,070
‫So we've been dealing up till now with the editor.

36
00:02:27,070 --> 00:02:34,810
‫We the editor is a piece of software and is one that has already been compiled for us and we already

37
00:02:34,810 --> 00:02:38,110
‫have the executable for that editor when we went and installed it.

38
00:02:38,110 --> 00:02:39,670
‫So we can open up the editor.

39
00:02:39,670 --> 00:02:45,880
‫The editor allows us to modify and create our game project using various game assets.

40
00:02:45,880 --> 00:02:49,960
‫These include things like the meshes that we've brought into our project.

41
00:02:49,960 --> 00:02:53,770
‫They include the blueprint assets and blueprint code in there.

42
00:02:54,100 --> 00:03:00,670
‫And what this allows us to do is using these game assets that we've created in an editor, we can then

43
00:03:00,670 --> 00:03:08,050
‫run the game in a separate standalone executable where it just plays the game and nothing else.

44
00:03:08,110 --> 00:03:11,920
‫However, the picture changes a little bit if we want to start using C++.

45
00:03:11,950 --> 00:03:19,000
‫C++ is the bedrock of the editor, and as such, if we changing the C++ in the editor, we essentially

46
00:03:19,000 --> 00:03:23,830
‫need to rebuild the editors binary executable.

47
00:03:23,830 --> 00:03:28,570
‫So if we have our source code over here, we know that it looks a little bit like this.

48
00:03:28,570 --> 00:03:30,310
‫We've got some text.

49
00:03:30,700 --> 00:03:38,380
‫Basically, it's what makes up our source code and we edit this source code again using a separate piece

50
00:03:38,380 --> 00:03:41,470
‫of software called a source code editor previously blueprint.

51
00:03:41,470 --> 00:03:47,320
‫We've been editing it all within The Unreal editor because it is tightly integrated with the software.

52
00:03:47,320 --> 00:03:52,870
‫However, when we're dealing with C++, we're using third party software to edit the code.

53
00:03:52,870 --> 00:03:57,730
‫Now, the one we're going to be using in this course is called Visual Studio Code because it is cross-platform

54
00:03:57,730 --> 00:04:02,980
‫works on Mac, Linux and Windows just perfectly and it's also very lightweight.

55
00:04:02,980 --> 00:04:07,990
‫But like I said, there's this gap between the source code we've written and turning it into the binary

56
00:04:07,990 --> 00:04:14,170
‫executable required for running the game in the editor and in the actual final game product.

57
00:04:14,170 --> 00:04:16,570
‫And that bit is the compiler.

58
00:04:16,570 --> 00:04:22,780
‫The compiler will take our source code, it will take the libraries and functionality already built

59
00:04:22,780 --> 00:04:25,000
‫into Unreal that we use in our source code.

60
00:04:25,000 --> 00:04:29,620
‫It will compile these together, turn them into binary and output.

61
00:04:29,620 --> 00:04:35,890
‫Either an editor that we can open up and edit our game assets or it will output a game which will take

62
00:04:35,890 --> 00:04:39,070
‫our game assets and allow the player just to play our game.

63
00:04:39,070 --> 00:04:44,380
‫Now there are two choices of compiler depending on which platform you're on.

64
00:04:44,380 --> 00:04:49,300
‫If you're on Windows, we're going to be using Visual Studio, so don't get these too confused.

65
00:04:49,300 --> 00:04:51,370
‫They have very similar logos and very similar names.

66
00:04:51,370 --> 00:04:56,290
‫One is Visual Studio, which is the compiler, and then there's one that is just the source code editor,

67
00:04:56,290 --> 00:04:58,480
‫and that one's called Visual Studio Code.

68
00:04:58,720 --> 00:05:03,070
‫Now, if you're on a mac, you instead are going to be using X code which.

69
00:05:03,150 --> 00:05:09,580
‫Is the compiler over on the Mac to keep things cross-platform, to keep things the same for everybody.

70
00:05:09,600 --> 00:05:14,310
‫We're going to be using Visual Studio code to actually edit the code, even though these compilers have

71
00:05:14,310 --> 00:05:16,410
‫source code editing capabilities built in.

72
00:05:16,420 --> 00:05:23,760
‫But we'll be using these compilers to actually take the source code and turn it in to binary executable.

73
00:05:23,810 --> 00:05:25,320
‫Okay, so that's it for this lecture.

74
00:05:25,320 --> 00:05:29,460
‫Hopefully you're a little bit clearer on why we need a compiler, why we need the source code editor.

75
00:05:29,490 --> 00:05:34,030
‫The next few lectures, we're going to go through the process of installing those.

76
00:05:34,050 --> 00:05:34,830
‫I'll see you there.

