WEBVTT 1 00:00:24.050 --> 00:00:27.500 Hello, I am a programmer of 17 years 2 00:00:27.500 --> 00:00:31.400 and have been a full time professor of NEOWIZ Games 3 00:00:31.400 --> 00:00:34.950 and currently working in KRAFTON, Juhwan Kim 4 00:00:34.950 --> 00:00:38.500 Now, I will start Unreal C++ basics lecture 5 00:00:39.050 --> 00:00:42.500 The objective of this lecture is 6 00:00:42.900 --> 00:00:46.050 gaining basic knowledge 7 00:00:46.050 --> 00:00:50.100 to using Unreal Engine C++ for programming 8 00:00:50.100 --> 00:00:54.500 And I will also give some basic explanation about Unreal Engine 9 00:00:54.800 --> 00:00:57.500 There will be 4 lectures 10 00:00:57.500 --> 00:01:00.050 and on the first lecture 11 00:01:00.050 --> 00:01:03.250 as the basic grammars of C++ 12 00:01:03.300 --> 00:01:06.250 we will learn installing Visual Studio and Unreal Engine 13 00:01:06.250 --> 00:01:09.150 their settings 14 00:01:09.150 --> 00:01:12.950 creating projects for coding 15 00:01:12.950 --> 00:01:15.050 and actors 16 00:01:15.050 --> 00:01:19.500 and outputting logs using Unreal Log 17 00:01:19.850 --> 00:01:22.100 Second lecture 18 00:01:22.100 --> 00:01:27.500 will contain basic C++ grammars including 19 00:01:27.500 --> 00:01:32.500 variables, functions, conditionals, iterations, and expressions 20 00:01:32.500 --> 00:01:34.900 In the third lecture 21 00:01:34.900 --> 00:01:42.200 we will learn what's left in C++ like 22 00:01:42.200 --> 00:01:45.500 array, pointer, reference, class, object-oriented programming, and polymorphism 23 00:01:45.500 --> 00:01:47.550 On the fourth lecture 24 00:01:47.550 --> 00:01:52.300 we'll recap on C++'s inheritance structure based on what we've learned 25 00:01:52.300 --> 00:01:54.800 and learn about Unreal's reflection system 26 00:01:54.800 --> 00:01:58.350 represented with U Property and U function 27 00:01:58.350 --> 00:02:00.000 Lastly, we will briefly recap on 28 00:02:00.000 --> 00:02:04.100 actor's life cycle which is the object that you will 29 00:02:04.100 --> 00:02:07.950 get to use the most and most generally in Unreal 30 00:02:08.301 --> 00:02:11.359 Installing Unreal Engine and Visual Studio 31 00:02:12.550 --> 00:02:14.800 Then, I will start 32 00:02:14.800 --> 00:02:18.500 the first lecture, C++ basics 33 00:02:18.800 --> 00:02:22.550 On this lecture, we will install Visual Studio of Microsfot 34 00:02:22.550 --> 00:02:24.200 and learn about it 35 00:02:24.200 --> 00:02:26.350 and install Unreal Engine 36 00:02:26.350 --> 00:02:30.000 and learn about it linking it to Visual Studio 37 00:02:30.000 --> 00:02:34.500 The lecture will be based on UE5 38 00:02:34.500 --> 00:02:37.900 and Unreal Engine is, as you might know 39 00:02:37.900 --> 00:02:41.200 an AAA engine usually for making games by Epic Games 40 00:02:41.450 --> 00:02:44.150 It would be good if you have Unreal Engine installed 41 00:02:44.150 --> 00:02:45.900 but if you don't 42 00:02:45.900 --> 00:02:48.250 go to the URL in the screen 43 00:02:48.250 --> 00:02:51.300 and let's install Unreal Engine 44 00:02:51.600 --> 00:02:54.500 First, go to Unreal Engine website 45 00:02:54.500 --> 00:02:58.850 through the URL I just showed you 46 00:02:58.850 --> 00:03:02.500 You will see this Unreal Engine download page 47 00:03:02.500 --> 00:03:07.200 I'm not sure what the latest version would look like 48 00:03:07.200 --> 00:03:10.500 but usually, once you go to their website 49 00:03:10.500 --> 00:03:14.800 there will be a download button on the left corner 50 00:03:14.800 --> 00:03:18.500 you can click that to download it from web 51 00:03:18.500 --> 00:03:20.850 This is the Unreal Engine download page 52 00:03:20.850 --> 00:03:25.400 and when you click on the blue button on the left 53 00:03:25.400 --> 00:03:27.050 the download will begin 54 00:03:27.050 --> 00:03:32.500 Before downloading, if you have an Epic account, you can log in 55 00:03:32.500 --> 00:03:34.200 and if not 56 00:03:34.350 --> 00:03:37.800 you can sign in and log in 57 00:03:37.800 --> 00:03:41.500 You can also log in using 58 00:03:41.500 --> 00:03:43.500 other accounts like Google or Apple 59 00:03:43.500 --> 00:03:47.500 Log in and install the exe file 60 00:03:47.500 --> 00:03:49.800 and once it;s done 61 00:03:50.300 --> 00:03:53.100 a launcher that will 62 00:03:53.100 --> 00:03:56.500 run Unreal Engine will start running 63 00:03:56.500 --> 00:03:59.500 and the launcher's screen looks like this 64 00:03:59.500 --> 00:04:02.850 Here, go to Unreal Engine 65 00:04:02.850 --> 00:04:04.900 and on the library tab 66 00:04:04.900 --> 00:04:07.850 Unreal Engine won't be installed like this 67 00:04:07.850 --> 00:04:09.900 Then once you install Unreal Engine 68 00:04:09.900 --> 00:04:11.900 comparing the two screens 69 00:04:11.900 --> 00:04:15.500 this screen shows when Unreal Engine isn't installed 70 00:04:15.500 --> 00:04:18.500 and this shows when it is 71 00:04:18.500 --> 00:04:21.500 The run button on the right top corner 72 00:04:21.500 --> 00:04:25.900 let's you know what version of Unreal Engine is installed 73 00:04:25.900 --> 00:04:30.500 This screen shows where Unreal Engine 5.3.2 is installed 74 00:04:30.500 --> 00:04:35.500 and the library shows a run button with Unreal Engine 5.3.2 75 00:04:35.700 --> 00:04:38.500 You can have various versions of Unreal Engine installed 76 00:04:38.500 --> 00:04:39.950 and in that case 77 00:04:39.950 --> 00:04:44.500 several ones of the the run button in the middle 78 00:04:44.500 --> 00:04:45.850 with a U mark will show 79 00:04:45.850 --> 00:04:47.700 The projects in the bottom 80 00:04:47.700 --> 00:04:51.050 won't show up when you first download it 81 00:04:51.050 --> 00:04:52.550 but once you create projects 82 00:04:52.550 --> 00:04:54.150 it will show a list of your projects 83 00:04:54.150 --> 00:04:57.650 with a screenshot 84 00:04:57.650 --> 00:05:00.250 If you installed Unreal Engine 85 00:05:00.250 --> 00:05:03.450 the editor that can edit C++ 86 00:05:03.450 --> 00:05:06.700 is called IDE 87 00:05:06.700 --> 00:05:08.850 which is Integrated Development Environment 88 00:05:08.900 --> 00:05:11.500 You have to install Visual Studio 2022 89 00:05:11.500 --> 00:05:13.850 of Microsoft 90 00:05:13.850 --> 00:05:17.050 For Visual Studio of Microsoft as well 91 00:05:17.050 --> 00:05:19.100 go to the Microsoft website 92 00:05:19.100 --> 00:05:21.250 which you can follow the URL shown 93 00:05:21.250 --> 00:05:24.750 you'll see the download tab for Microsoft's 94 00:05:24.750 --> 00:05:26.500 Visual Studio Community 95 00:05:26.650 --> 00:05:31.750 Click on the download button on the bottom left corner 96 00:05:31.750 --> 00:05:35.700 and the installer for Visual Studio will be installed 97 00:05:35.700 --> 00:05:39.500 Visual Studio Installer looks like this 98 00:05:39.500 --> 00:05:42.600 Now, Visual Studio 2022 is already installed 99 00:05:42.600 --> 00:05:47.800 so it says that it's available for use 100 00:05:47.800 --> 00:05:49.150 but if you don't have it installed 101 00:05:49.150 --> 00:05:50.900 nothing will show up there 102 00:05:50.900 --> 00:05:53.400 and you can install Visual Studio 2022 103 00:05:53.400 --> 00:05:57.150 When you click on the install button, this screen will show 104 00:05:57.150 --> 00:05:59.900 and just check on the 105 00:05:59.900 --> 00:06:02.500 Unreal development mark 106 00:06:02.500 --> 00:06:07.500 game development using C++ 107 00:06:07.500 --> 00:06:12.200 and click on the install button on the bottom right 108 00:06:12.200 --> 00:06:13.500 then it will start installing 109 00:06:13.500 --> 00:06:16.950 The time it takes to install it will differ from computer types and internet circumstances 110 00:06:16.950 --> 00:06:20.500 but it will usually take from 20 to 40 minutes 111 00:06:20.500 --> 00:06:23.050 Once you've installed Visual Studio 112 00:06:23.050 --> 00:06:25.800 assuming that it's the 2022 Community version 113 00:06:25.800 --> 00:06:28.500 Visual Studio will automatically start 114 00:06:28.500 --> 00:06:30.500 and this screen will show 115 00:06:30.500 --> 00:06:33.500 It says Visual Studio 2022 open recent files 116 00:06:33.500 --> 00:06:36.500 and the menu on the right 117 00:06:36.500 --> 00:06:39.850 is the menu that you can use to make projects 118 00:06:39.850 --> 00:06:41.500 on Visual Studio 119 00:06:41.500 --> 00:06:43.850 and on the left, when you create a project 120 00:06:43.850 --> 00:06:47.500 the recent files and projects will show there 121 00:06:47.500 --> 00:06:49.500 Now there's nothing 122 00:06:49.500 --> 00:06:51.900 so you can click the create new project on the right 123 00:06:51.900 --> 00:06:55.600 to create a new project with Visual Studio 124 00:06:55.600 --> 00:06:57.500 Again 125 00:06:57.500 --> 00:07:00.200 installing Visual Studio 2022 126 00:07:00.200 --> 00:07:03.500 takes the steps of going to the Microsoft website 127 00:07:03.500 --> 00:07:06.850 clicking on download to download Visual Studio Installer 128 00:07:06.850 --> 00:07:08.500 and once you run that 129 00:07:08.500 --> 00:07:11.500 it will show a Visual Studio 2022 install menu 130 00:07:11.500 --> 00:07:13.500 and with that, you can install Visual Studio 131 00:07:13.500 --> 00:07:16.500 You will need to check on the 132 00:07:16.500 --> 00:07:18.500 box for Unreal Engine in the process 133 00:07:19.201 --> 00:07:21.801 Generating actor and outputting log 134 00:07:23.500 --> 00:07:26.500 Then let's learn about 135 00:07:26.500 --> 00:07:30.200 creating a C++ project with Unreal Engine 136 00:07:30.200 --> 00:07:35.350 Once you run the Unreal Engine launcher that you just installed 137 00:07:35.350 --> 00:07:36.700 you'll see this screen 138 00:07:36.700 --> 00:07:41.200 When you click on the run button on the top right 139 00:07:41.200 --> 00:07:44.800 or the run for this version in the center 140 00:07:45.600 --> 00:07:49.050 this project setting screen will show up 141 00:07:49.050 --> 00:07:51.750 On the left of it 142 00:07:51.750 --> 00:07:53.500 it says recent projects 143 00:07:53.500 --> 00:07:57.500 Those are the projects recently created 144 00:07:57.500 --> 00:08:02.800 There are games, films, videos, architecture, automotive 145 00:08:02.800 --> 00:08:05.500 but we will select games tab 146 00:08:05.500 --> 00:08:08.200 and templates will come up in the middle 147 00:08:08.200 --> 00:08:12.500 Templates are pre-made basic settings 148 00:08:12.500 --> 00:08:14.750 but we'll select blank 149 00:08:14.750 --> 00:08:19.050 and it will show an empty tiled floor on the right 150 00:08:19.050 --> 00:08:21.500 which is a screen for creating a new empty project 151 00:08:21.500 --> 00:08:24.700 Under that there are blueprint and C++ 152 00:08:24.700 --> 00:08:27.150 click on C++ 153 00:08:27.150 --> 00:08:30.700 and you may leave other settings as is 154 00:08:30.700 --> 00:08:35.500 If you check on the starter contents the basic contents will be included 155 00:08:35.500 --> 00:08:39.200 so you just need to click on that and then create 156 00:08:39.200 --> 00:08:41.300 On the bottom it says project name 157 00:08:41.300 --> 00:08:43.100 which is just my project 158 00:08:43.350 --> 00:08:46.450 You can choose the name for your game or project 159 00:08:46.450 --> 00:08:48.850 Let's just keep it as is for now 160 00:08:48.850 --> 00:08:51.050 Once you click on the create button 161 00:08:51.500 --> 00:08:53.100 after a while 162 00:08:53.100 --> 00:08:58.250 Unreal project will be opened through Unreal editor 163 00:08:58.250 --> 00:09:01.250 On this Unreal editor screen 164 00:09:01.250 --> 00:09:04.050 we have world view on the left 165 00:09:04.050 --> 00:09:06.150 and world outliner in the middle 166 00:09:06.150 --> 00:09:07.950 and details on the right 167 00:09:07.950 --> 00:09:12.400 Now let's create a project in this Unreal editor 168 00:09:12.400 --> 00:09:16.350 I will tell you in two steps 169 00:09:16.500 --> 00:09:21.800 First, making an actor and writing the C++ code 170 00:09:21.800 --> 00:09:25.750 and the second is outputting a Hello world log in the log tab 171 00:09:26.200 --> 00:09:28.750 There are various ways to create an actor 172 00:09:28.750 --> 00:09:31.500 but we'll use C++ 173 00:09:31.500 --> 00:09:33.150 so from the top menu 174 00:09:33.150 --> 00:09:36.300 select create C++ class 175 00:09:36.300 --> 00:09:38.500 Once you do that, this screen will show 176 00:09:38.500 --> 00:09:44.700 You can select what class to create when making a C++ class 177 00:09:44.700 --> 00:09:48.100 now, we'll create an actor 178 00:09:48.100 --> 00:09:51.900 You can see character, phone, actor 179 00:09:51.900 --> 00:09:55.100 but first, we'll go for an actor 180 00:09:55.100 --> 00:09:58.000 You can name your actor 181 00:09:58.000 --> 00:09:59.850 and keep the public/private as is 182 00:09:59.850 --> 00:10:03.100 Just give it a name and when you click on create class 183 00:10:03.100 --> 00:10:07.000 actor.header file and actor.cpp will be generated 184 00:10:07.000 --> 00:10:09.300 It might vary per settings 185 00:10:09.300 --> 00:10:13.600 but Visual Studio might start being linked 186 00:10:13.600 --> 00:10:16.700 and show this screen which is 187 00:10:16.700 --> 00:10:19.050 a log file during compiling 188 00:10:19.050 --> 00:10:20.900 called live coding in the Unreal screen 189 00:10:20.900 --> 00:10:24.900 Let's say that Visual Studio did start 190 00:10:24.900 --> 00:10:27.150 and try outputting log 191 00:10:27.150 --> 00:10:30.500 If the installation was done properly 192 00:10:30.950 --> 00:10:33.500 as soon as you created the actor 193 00:10:33.500 --> 00:10:36.950 Visual Studio will start and show this screen 194 00:10:36.950 --> 00:10:38.900 If this source screen doesn't show up 195 00:10:38.900 --> 00:10:44.450 you can select the file on the solution explorer on the left 196 00:10:44.450 --> 00:10:48.050 If the Visual Studio tab doesn't automatically pop up 197 00:10:48.050 --> 00:10:51.700 find the MyActor.c++ file that you just created 198 00:10:51.700 --> 00:10:55.600 from the content browser on the bottom center 199 00:10:55.600 --> 00:10:58.850 and double click on it which will open Visual Studio 200 00:10:58.850 --> 00:11:02.600 These are the MyActor files 201 00:11:02.600 --> 00:11:06.350 and there are two, header and cpp 202 00:11:06.350 --> 00:11:08.850 First, go to the cpp file 203 00:11:09.650 --> 00:11:13.500 which has the actions the actor will do 204 00:11:13.500 --> 00:11:17.950 and on the 25th line, under supertick function 205 00:11:17.950 --> 00:11:20.500 we'll write a code 206 00:11:20.750 --> 00:11:23.700 We didn't learn C++ yet 207 00:11:23.700 --> 00:11:26.950 so to give a brief explanation 208 00:11:27.100 --> 00:11:29.500 tick of MyActor is 209 00:11:30.000 --> 00:11:34.500 a code that is practiced every period, for every tick 210 00:11:34.500 --> 00:11:37.000 So we'll write a log there 211 00:11:37.000 --> 00:11:42.500 and have messages be output every tick, for every updated frame 212 00:11:42.500 --> 00:11:45.500 Type the following on the 25th line 213 00:11:45.500 --> 00:11:49.050 UE_LOG( 214 00:11:49.050 --> 00:11:53.900 LogTemp, Warning, TEXT ("Hello World!")); just as written on the screen 215 00:11:53.900 --> 00:11:56.500 To explain this code briefly 216 00:11:56.500 --> 00:12:01.150 when you develop a game you need to do logging 217 00:12:01.150 --> 00:12:03.900 which is leaving records of if a function 218 00:12:03.900 --> 00:12:05.500 is running well or not 219 00:12:05.500 --> 00:12:08.800 and stuff like debug messages 220 00:12:08.800 --> 00:12:14.000 In this case, to see if the code is written properly and to test 221 00:12:14.000 --> 00:12:16.850 we'll put the string of 'hello world' in 222 00:12:16.850 --> 00:12:19.850 Usually if you go to Unreal editor, it will be automatically compiled 223 00:12:19.850 --> 00:12:21.800 but you might do it manually 224 00:12:21.800 --> 00:12:27.250 If you press Ctrl + Alt + f11 in Unreal editor 225 00:12:27.250 --> 00:12:29.500 the code will be compiled like this 226 00:12:29.500 --> 00:12:31.250 and Unreal Engine will be updated 227 00:12:31.250 --> 00:12:33.100 Once the compiling is done 228 00:12:33.100 --> 00:12:35.600 you can go back to Unreal editor 229 00:12:35.600 --> 00:12:38.750 and as I told you when doing the double click 230 00:12:38.750 --> 00:12:40.950 drag the C++ class in the content browser 231 00:12:40.950 --> 00:12:44.750 under the world outliner in the middle 232 00:12:44.750 --> 00:12:47.500 into the view which is 233 00:12:47.500 --> 00:12:50.500 the 3D screen with tiles 234 00:12:50.500 --> 00:12:52.050 Once you do that 235 00:12:52.050 --> 00:12:57.500 it looks like nothing has been added in the world screen 236 00:12:57.500 --> 00:13:00.400 It doesn't show up 237 00:13:00.400 --> 00:13:03.750 because there are no content for the actor 238 00:13:03.750 --> 00:13:05.700 like physical mesh or renderer 239 00:13:05.700 --> 00:13:07.700 but in the world outliner in the middle 240 00:13:07.700 --> 00:13:10.400 you'll see that my actor has been added 241 00:13:10.400 --> 00:13:15.800 If my actor is properly added to world outliner 242 00:13:15.800 --> 00:13:19.550 you can click on the green play button on the top 243 00:13:19.550 --> 00:13:24.750 and Unreal editor will run a game project with an actor 244 00:13:24.750 --> 00:13:27.950 Now, there's nothing that we've created 245 00:13:27.950 --> 00:13:30.100 so we can only move the camera 246 00:13:30.100 --> 00:13:31.750 but through the code that we made 247 00:13:31.750 --> 00:13:33.050 on the bottom left 248 00:13:33.050 --> 00:13:36.950 there are 'hello world' logs 249 00:13:36.950 --> 00:13:40.900 I explained creating an Unreal project 250 00:13:40.900 --> 00:13:43.450 Follow this example step by step 251 00:13:43.450 --> 00:13:49.300 and the objective is installing Unreal Engine 252 00:13:49.300 --> 00:13:50.900 and Visual Studio 253 00:13:50.900 --> 00:13:55.100 and outputting messages on the Unreal Engine editor log tab 254 00:13:55.100 --> 00:13:57.500 So as you saw 255 00:13:58.150 --> 00:14:02.150 if the yellow 'hello world' is output on the bottom left 256 00:14:02.150 --> 00:14:04.600 you've succeeded in writing 257 00:14:04.600 --> 00:14:06.950 a very basic C++ project with Unreal 258 00:14:06.950 --> 00:14:10.350 Let me tell you about the following lectures 259 00:14:10.350 --> 00:14:12.250 To program with Unreal 260 00:14:12.250 --> 00:14:16.250 You wrote a log just now 261 00:14:16.250 --> 00:14:19.700 but to program using C++ with Unreal 262 00:14:19.700 --> 00:14:21.750 you need to know C++ well 263 00:14:21.750 --> 00:14:24.500 So starting from variables for data 264 00:14:24.500 --> 00:14:27.200 I will explain C++, an object-oriented 265 00:14:27.200 --> 00:14:29.600 program briefly 266 00:14:29.600 --> 00:14:33.300 C++ is a very complicated and big language 267 00:14:33.300 --> 00:14:36.200 that would take about a year 268 00:14:36.200 --> 00:14:39.900 in academies or colleges 269 00:14:39.900 --> 00:14:42.750 but I'll have only what's needed 270 00:14:42.750 --> 00:14:45.250 for Unreal programming 271 00:14:45.250 --> 00:14:48.050 Let's wrap up what we've learned in this lecture 272 00:14:48.050 --> 00:14:52.950 First, we installed Unreal Engine 5 from its website 273 00:14:52.950 --> 00:14:56.300 and Visual Studio 2022 Community as well 274 00:14:56.500 --> 00:14:58.300 We created a C++ project 275 00:14:58.300 --> 00:15:03.200 and wrote a C++ code to output 'hello world' log 276 00:15:03.200 --> 00:15:05.750 Thank you for listening 277 00:15:06.897 --> 00:15:10.247 Installing Unreal Engine and Visual Studio Unreal Engine downloading link https://www.unrealengine.com/ko 278 00:15:10.247 --> 00:15:13.798 Visual Studio downloading link https://visualstudio.microsoft.com/ko/vs/community/ 279 00:15:13.799 --> 00:15:15.743 Creating actor and outputting log Creating projects Select Actor from New C++ Class and write a name and click Create Class 280 00:15:15.744 --> 00:15:17.944 Appears linked to Visual Studio tab 281 00:15:17.944 --> 00:15:19.945 Outputting 'Hello World' log Write UE_LOG(LogTemp, Warning, TEXT("Hello World!")) under Tick function 282 00:15:19.945 --> 00:15:21.096 After compiling, click and drag MyActor from Content Browser to scene Check string being output on Output Log tab 283 00:15:21.096 --> 00:15:22.096 The End