Hello, this is Youngho Lee, who will be lecturing the Unreal Engine Network
In the game and big game fields
Unreal Engine has a significant usage rate
And its proportion is increasing across all industries
In particular, it is receiving
Much attention in games
Movies, and media arts
The engine itself provides many functions
And among them, its network engine
Which has proven stability and optimization
is essential when producing multi-user network games
With Unreal Engine
In this lecture
We will learn through various examples
How Unreal Engine's network structure is structured
And how synchronization is performed
Network classes first
Begin based on single-game production
The class will then
Be expanded to a network game
That can be played by multiplayer
On a network
First, creating a single game
Now, let's take a look at
How single-game production progresses
It consists of 9 words in total
And by implementing each content
We will learn how to utilize the detailed technologies of Unreal Engine
For the first step in creating a single game
We will learn about creating a project and creating a third-person player
In this unit, you will learn
How to
Create a project
Set up the created project
And finally create a third-person player
Creating and Setting Up a C Based Project
When the Unreal Project Browser opens like this
We can select the project
Here, we will choose the Third Person
We will create a network project based on this template
In the Third Person, we will create
A network project based on this template
We are trying to create a C based project
Select C on the right
Then, there's the Starter Content here, right?
Please check this
Next, as for the project's path
I created a folder in the project folder on the C Drive
Called Unreal
Here, I will make a project name
Here, I will name the project
NetTPS
Looking again
First, set the game category
I chose this and then the Third Person
Then, select it as a C project
Next, the starter content project's name
is set as NetTPS
Let's leave it like this
And click the 'Create' button here to create the project
If we wait like this, Visual Studio will open
Since the project was created based on C
Visual Studio opens
And then Unreal Editor is opening
The project we have created now
Can be seen
Under the NetTPS source folder
Under the Games folder
When Unreal Editor opens
It looks like this
We will try to transform
This project into a different form
This transformation will make
The project a little more manageable
Like this, when the Editor opens
I will close the Editor for now
Right?
Then, you'll see the Solution Explorer on the right here
And you'll see Visual Studio
If you look here in Visual Studio
Under the NetTPS folder on the right
There is a source folder
Below are script files like this
There are C files
Rather than leaving them like this
For them to be easily managed
I will divide the project settings and folders
Then we will learn about the project settings in the next section
Now, let's look at project settings
First, let's close the Solution Explorer
And close Visual Studio
And let's move to the project folder
We just created
Open Explorer, and in Explorer
I created NetTPS in the Unreal folder
In the project folder on the C Drive
Let's move to the NetTPS project folder
The part where we want to change the structure is
Moved into the source folder
There's a NetTPS folder
Here are all the C classes
We are using now
These kinds of files are here
Let's work on them separately
To manage easily
First, I will create a folder here
And name the folder, Public Folder
We will make the other one a Private Folder
In Public, header files
That can be shared externally are placed
And then select cpp files
This time, Private, it's commonly called a Source File
Get the source files
And put them into the Private Folder like this
This makes project management very easy
Even when distributing later, some security folders are
Put into a Private Folder like this to work on
When exporting plug-ins to the outside
It is better to manage them this way
Because they are modularized
And easy to work with
We have to create folder by dividing them into two folders
Public Folder and Private Folder
After doing this
We need to create a project again
How?
Here, you can see the NetTPS.uproject Unreal Project File
Right-click on it
And select the
Generative Visual Studio Project file
In Windows 11, there is 'More Detailed View' menu
If you click on it and enter it
You will find a Generate Visual Studio Project file
If you click this
It will literally re-create the Visual Studio Project file
This will create a new solution file for your
Visual Studio Project file
I right-clicked
the Generative Visual Project file
As I mentioned, in Windows 11
The 'Show more options' menu appears in the mouse pop-up like this
Please note that the Generative Visual Studio Project
File menu appears when you click this
This will create a new solution file
Let's open this and double-click again
To open the project
Let's go back to the Solution Explorer and take a look
When you go to Solution Explorer in Visual Studio
There is Source under NetTPS, then NetTPS
And then
The Public and Private folders we created are listed like this
You can see that the header and cpp files
are also divided this way
If it happens, let's build again
And run Unreal Editor
You can build by right-clicking
And building
To run the editor while building at once
There's an .exe file here, right?
Let's click this to run it
Then, it will build and run Unreal Editor at the same time
This will open a new Unreal Editor
When it opens, we will chage the screen layout a little
To make working here easier
If you scroll down from the Window menu
In Unreal Editor, you will find Load Layout
Then, there's the UE4 Classic Layout
I will work on this
When you click on it, only the viewport window appears like this
Then the Place Actor on the left
Then the Outliner
I will work like this so that the default content browser
and all of these are preloaded
Edit Menu to Window Menu to Load Layout
Next, click on the UE4 Classic Layout
And if you look again, the content browser will appear in advance
Just leave it like this
If this has been done
We will create a folder in advance in the content browser
And make some settings in advance
To work by inserting essential data into this folder
The content folder here
I will move the content browser here
I will first create a folder here
Right-click under the content folder and create
A New Folder
And a folder named NetTPS
We will create the necessary folders within the NetTPS folder
Create subfolders
And continue to create files there
First, when we first created the project
With StarterContent and then
Third Person type template, we created it
Here, there's Third Person type folder
There are things like Third Person, Blueprint, Input, etc.
If you go to this blueprint folder
There is a BP Third Third Person Blueprint file that we will be working with
Then, if you go to the Input folder, there are several inputs
We will move these two things
The Blueprints and Input folders, to the NetTPS folders
By drag and drop, I chose Move Here
And moved these to NetTPS like this
Next, here, we will do UI work too
So, I'm going to make a UI folder here now
Click the mouse right button, choose New Folder
And name it UI
I will make several, so maybe I should put 's'
S, Input
I will put 's' here too, and make it Inputs
I've made a folder structure like this
I'll add a few more folders
Later as needed
I made folders this much
Next,m right now, we'll be working on
A single game mode first
To create Multiplayer later
I will change the Editor Settings related to this a little
It's testing
When working in multiplayer or network mode
I plan to configure the test environment
To make it more convenient
If you look here, there's a settings button in play mode
There's a Settings button here in dot dot dot mark
When you click here
There's a Net Mode
First, choose Play As Listen Server for Net Mode
It is done
Then, under here is Advanced Settings
You can click here
Then, Editor Preferences window comes out
You can do like this
Also, in Edit, there's Editor Preferences too
You can click the Editor Preference in the Edit menu
Then, the Editor Preference window pops out
I will do some searching here
There are situations like this when we need to open multiple windows when testing
So, we will make sure that
The windows are blocked by these editors or other windows
So, let's type 'always on top' here
When you look here, Level Editor-Play
There's a menu called 'Always On Top'
I will check this option and activate it
Then, our editor will always appear at the top like this
Then, when we click the environment setting button here
There's Number of Players
It means that the number of the player is one
But I want to allow multiple people to participate
When you run it for the first time
You need to set the number of people
But I want to
Add one by one as needed
To do this
Here, in Editor Preferences
I will type 'allow late joining'
But you just can search 'joining'
When you just type 'joining'
You will see 'Allow late joining' here
Check here
This means
If anything, this option will allow other clients to participate
While playing after clicking the play button
It's that option
Select these two options
And press the play button
One will appear first
And then, you will see an
Add another Client button if you go here
Here, on the play button
The button next to the stop button
When you hover your mouse over this
Add another client will pop up
If you click on it, you will see another pop up appear
Another window will pop up
Unreal's network is designed to support
Multiplayer by default
So, even if we don't do anything
What about I move like this now?
You can see that the character's movements are synchronized in both windows
This very good network mode is set by default
Then, 'What? Then it's not a big deal, is it?'
You may be thinking like this
Then, nothing can be done
We can do the basics, but when we make a project
There will be various synchronization process
That needs to be done, and some that shouldn't be
Additionally, for more detailed
Network processing or other such things
But Unreal Engine cannot tell in such cases
So, when the basic character moves
The network handles synchronization and such things
But other things that require more detailed modes
Have to be done manually
But the fact that we can already get to this point is
Very convenient for us
Done, right?
I will close this by pressing Esc
We completed the project settings
Creating Third Person Player
I will create a third-person player
In the TPS folder
BP Third Person has been made
Right? We made this
I will modify some options
And there will be some methods we will use in the game
I will modify these slightly to the desired way
Then, to the C class
To modify and add more content related to this
I will add some content related to this
First, here's BP Third Person Blueprint
There's Blueprint folder in NetTPS
Double click this
Then, click the Open Full Blueprint Editor
And I will grab this and paste it here
Next, there is BP Third Person character
Things we have to work on is
When we go down, here, in Components
There is Character Movement component
Right?
Here is a Character Movement Component
And, on the right, I'll go to the details window in this Character Movement Component
Let's try searching for 'rotation' here
There are several options
Among those, the option we will use is
Use Controller Desire Rotation
I will remove Orient Rotation to Movement
These are supposed to rotate in the direction of movement
Right?
We just want to have it rotate in the direction we control
For example, here's how to use it
I'll play it
Our character is like this now
We move, it moves front and back like this
It also moves right and left
But I don't like how the screen keeps rotating in the direction
The character's moving when it moves
Why? Because with the gun
We want to have an aim mode so we can shoot at other users
However, I only have to face forward when it's like this
If I do in this mode, I can shoot myself
I mean, to the observer
So, I will modify the movement mode to not work like this
In the form of FPS, Third Person, or T-PASS
I'm trying to change the mode into a shooting game
Let's go into the BP Third Person Character
In the Character Movement
I will check the Use Controller Desire Rotation
And I will uncheck the Orient Rotation to Movement
As you see, these two options are changed like this
Right?
Compile again, and it's not saved, right?
I will save it too
But this is very uncomfortable
When you continue working later
You have to keep on doing compile and save
To do these at once
There's a Setting button next to the Compile button
I will click this and choose the Save on Compile button
And select the 'Always' button at the bottom
I will make do this so that I can compile and save at the same time
The structure allows you to compile and save at the same time
Let's run it again and see how it feels
I'll press the play button again
Earlier, when I was moving, and I turned left
The screen also rotated to the left
But now it is moving in this form
When going back and forth, it just runs like this
Of course, only the animation will be changed to the animation
We want behind
But now, we will just do like this
So when the character rotates, it moves in the direction it rotates and shoots
I changed the view mode a bit so I could do this
Next, when I play, the character is too far away
You know the game, BATTLEGROUNDS
I will change this a little bit like BATTLEGROUND mode
This is what it feels like when it comes to BATTLEGROUND mode
There is a screen, and the character is in the exact center
If this is the exact center
It is slightly off to the left, right?
It's like this, and the camera is in the exact center
But the character is a little bit off to the left, right?
Then, instead of capturing the entire body like this
The camera captures from the thighs below the buttocks
But since we are holding the whole thing now
I will change this slightly
So, when you go to the BP Third Person character's viewport window
The camera boom is capturing this character
From too far
So, I'm going to change its position a bit
After selecting Camera Boom, in the Detail, and Transform
And in Location, I will set the y value to 40
And the z value to 60
Then, it will be located slightly above the right shoulder
Then, you have to get a little closer
But if you look at the camera rather than pulling the rotation itself
In Detail's Camera category
There is something called Target Arm Length
This Spring Arm's length, this red line
It's what determines the length
I will set this to around 150
Then the camera captures close like this
The structure allows you to capture the character form this distance
After, I will press the compile button
If you go and play again, what happens?
From the thigh to here
Slightly off-center to the left
It goes like this
Shall we move like this?
I'll do just like this
I think it would be good to modify a little bit more on how you feel
Good, I did like this
I will change the default option values and move it to a C class
Because this Blueprint is a bit less stable
When produced based on C Project
There are some cases where the Blueprint disappears
So, if you move these data to C
Even if the blueprint is lost, because the original C file is there
It is very easy to restore it
I will move the contents of this Blueprint into C
There is a plugin called Visual Assist
By default in Visual Studio
I have installed it and am working on it
In the case of the basic trial version, it's available for free
If you install and use a web extension plugin
That supports code auto-completion as needed
You can make content more conveniently
Especially in Unreal Projects
Some variables, function names, and class names are quite long
It's a bit difficult to memorize everything
So, it would be good to use more plugins that provide auto-completion
In order to move the Bluprinted work here
NetTPSCharacter.cpp
I will open it in Solution Explorer
If you look, there is NetTPSCharacter.cpp in Solution Explorer
Just select it
Then, if you scroll down a bit, there's Constructor here
In the Constructor, there is Get Character Movement
That is, we get the Character Movement Component
The Orient Rotation to Movement option is
Changed earlier
When we do rotation
I set Orient Rotation to Movement to false
Then, Use Controller Desired Rotation
was checked, set to true
I will apply this part
I'll set this to false
Next
For B-Use Controller Desired Rotation
I'll set the value true
B-Use Controller Desired Rotation's value to true
Change like this
Then, we modified the camera's length and place values
So, to modify the camera's value, this is Camera Boom
Spring Arm Component, I will modify this
Here, the Target Arm Length is set to 400, but I will change it into 150
I will change into 150, and then modify the place value
Place value is, at Camera Boom
Set Relative Location
At F-Vector
To conveniently get for tip
It is more convenient in this way
There is Location at Camera Boom's Target
If you bring this value as is if there are decimal points
It is inconvenient to move them one by one
If you right click, you will find a copy
Select copy, and F-Vector
Don't open it horizontally, and it will also be copied horizontally
Press Ctrl V to paste
I don't need things like X here
I'll leave it as 0 here
Delete the part of Y, set it as 40
And add Z like this
Right?
In this way, the position of the Camera Boom was determined
I will click Build here first
When you click Build
The output below from Visual Studio show that
The Build failed
Can you see this?
Output, if you look at this option
You can see that the build failed
Let me enlarge the screen a little and show you
It says 0 builds succeeded and 1 failed
This is because of an option called Live Coding
That was added starting with Unreal Engine 5
If you go to Unreal Editor adding to the bottom right
There is a compile button here, right?
If you click this, it will compile automatically
Here is Live Coding
If Enable Live Coding is checked
It means you will use it
It's already compiling
But Visual Studio is trying to do it again
So the part where this conflict occurs an error
It may vary depending on your work style
But some people compile here
While others compile in Visual Studio
If errors occur in Visual Studio while working on code
It may be more convenient to fix it there
So, I will turn off Enable Live Coding
I will turn off the Enable Live Coding
If you do this and go back to Visual Studio and build again
You will see that it builds normally this time
Then, it says that 1 build was successful and 0 was failed
When this happens, it is reflected properly in the Unreal Editor
The NetTPS character has been modified
For this NetTPS character to work in our project
A few more settings need to be made
That I've successfully built it like this?
What happens now? Suddenly, our character disappeared
This is because there are some changes
In the settings now
That chnged as we moved the folder
But you will probably run into a similar situation in your settings
I'm going to set this again
At Setting - World Setting
There is NetTPS Game Mode
Right?
At NetTPS Game Mode
It is set to Fun Class as a default
So, instead of our BP Third Person character appearing
This class in the Default Fun Class is
Set to appear
So, I'll modify this part a little
So, let's work on NetTPS Game Mode here
By creating it as a Blueprint
Where is it?
You can move this over there
But if you go inside the C Class Folder
In the Content Browser, click on the NetTPS folder
Then, Public, if you look here, we have the NetTPS Game Mode Class
This is C Class
Let's make this a Blueprint
Register it using our NetTPS character Blueprint
Right click this
Create Blueprint Class
Based on NetTPS Game Mode
I will click this
It means, I will make this class into Blueprint
I'll name it BP_
Next, for the path loction to be created
We will make this class
In the Blueprint folder in NetTPS
When you do Create Blueprint Class like this
The Blueprint Editor window opens
The BP_NetTPS Game Mode Blueprint
And the Default Fun Class are here are will be used now
I will change this into BP_Third Person Character
I changed into BP_Third Person Character
Then, compile
Again, come back to Main Mode
And I'm going to change Game Mode Override
At Worldsetting which is written Game Mode Override
Into BP_NetTPS Game Mode
Then, here, at Default Fun Class
The things we registered are in normally
If you can't see the World Setting properly
You can click World Setting, here at Setting
When you click the Play button again
BP_Third Person Character pops out normally
It's done
So far, I've created the project settings
Then do setting
And even created a Third Person Player mode
Let's summarize what we learned in this lecture
Creating and Setting Up C Based Project Use the ThirdPerson template and create a C based NetTPS using the Unreal Engine launcher
Created a structure that divides the Source folder into Public and Private folders and saves them as .h files and .cpp files, respectively Created Unreal Editor's project folder
Set Always on Top and Late Joining options in the Edit Preferences window for a network multiplayer work environment
Set Play Mode to Play As Listen Server
Creating Third Person Player Enable Use Controller Desired Rotation in the CharacterMovement component to change the Third Person player's rotation settings
Set the position of the Third Person camera Modified Game Mode and World Settings