How To Setup A Dedicated Server Locally | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] yo what's up guys this is afix and welcome back to the channel today i'll be showing you guys how to set up a dedicated server locally on your computer and you can do this with pretty much any project but i'm gonna be creating an example one before you do this tutorial you will need some things pre-installed and that will be a setup unreal engine source build i'm using 4.26 and visual studio working with that source build and i will also put a link in the description below on how to do both of those things flop ram has a bunch of good tutorials on it so it should be no trouble now once you've done that you will need to build your engine which is covered in the tutorial so you just right click and click build and once that is finished you will go up make sure development editor is selected win64 is also selected and click on local windows debugger this will basically start up your engine and it'll open up your project browser where you can create a new project or open up another one alright so once your unreal engine project browser has opened up you can go and create a new project or open one that you already have i'm gonna go and click games i'm going to create a new third person project now the main reason why we're not choosing first person is because replication is not set up well so all other players will be invisible and that ruins the whole point of even making the dedicated server now we'll make this third person template project click next make sure it's a c plus project this is important because if it's a blueprint project there are several extra steps you'll need to follow now you can select with starter content or you can do without i'm going to do without because it's less in size now all the other settings are good so i'm just going to name this dedicated daddy server yt cut you can name this whatever you want this is what i'm doing and once you have finished all this setup go and click create project now this code will take a while to compile so give that a few minutes and i'll be back once your visual studio has opened up right click on your dedicated server type project and click build um there's a weird glitch that happens when you create the project it only opens a visual studio and does not build or open up your project in unreal engine so if you build you'll be able to open up your project after it's done now once your build has succeeded you can go and open up an instance of file explorer and just find where your project is located once you have found that you can go to the uproject file and double click on it to open it up and it should open without any problems now once your unreal editor has opened up what we'll go and do is create a new map so over here i'm going to go and file and create new level and uh shortcut is control n that would be useful and click default now here we're greeted with an empty scene and we will create a material so we know that this is the server map so what i'm going to do is actually create a blueprint actor so i'm going to go to content right click and create blueprint class actor and i'm just going to call this uh bp server indicator and if you open that up what we're going to do is drag it over here and i'm going to add a text render so just add that and drag it over default scene root so it is the root component and over here let's just make the text the server and click enter to make that change actually occur and for the text under color let's just make it a bright green now this is looking pretty good so what i'm going to do is go over to the actual indicator and i'm going to set it to replicate and just check replicated and we don't need to replicate movement so this is good so just click compile and save now what you can do now is drag in the server indicator and it is looking a little bit dull here let's see if i can uh if we can change the font size here so i'm going to go to text or scale here and for the scale i'm just gonna set it as three by three that's looking pretty good so i'm gonna compile and save that and oh it is prompting me to save the map so let's actually click s control s to save over the content create a new folder let's call this maps and open up maps and let's just call this one server map and i do like to prefix my maps with a lowercase p and once that is done just click save and it will save your map now the server is a little bit high up so i'm just going to drag that down so it's really easy to see i'm going to rotate this player start so that the player will be facing this server indicator i'll just move this a little bit more backwards all right now one more thing that we can do is create a simple material to indicate this i'm not going to be doing this but if you really want to make it obvious that this is a server map you can go ahead and do so now i'm going to do ctrl shift s to save all and what we'll do is go over to project settings maps and modes and here we'll configure our maps so for the editor startup map it is this third person example map now what this is is when you open up your editor it is the map that is opened now there's also the game default map which is the first map the player is greeted up with when they open your game now this is generally going to be some sort of lobby so what we're going to do is make it obvious that this is a lobby what we'll do is just drag in or we can actually just edit this text render on the floor so i'm going to go over to text render and make it say lobby and that's looking pretty good so i'm going to do ctrl shift s to save all and we do want this to be our lobby and for the transition map this is not important for what we're doing and the server default map is what the server opens up by default now i'm going to choose this to be the p server map and i'm going to go over to the packaging settings over here click on this arrow downwards and i'm going to scroll down to the maps which will be over here list of maps to include and click plus two times and click on these three dots and search for your maps so that would be in maps and p server dot umap and i'm also going to go to the content and then third person cpp maps and third person example map now once that is done we will go over and build our project so what we do is go over to file go down to package project and click on windows 64 bit and go into your d drive and create a new folder so i'm just going to call this packaged daddy tuts and i will select that folder and it will start packaging now one thing to note is that you may have some issues while packaging and especially if you have done many edits to your project so you will need to look out for those and fix them as they come so once your project has finished packaging what we'll do is open up the location where we have the source build of unreal engine double click on that double click on engine and then go to a source which is down here and click on this ue4 server.target.cs and click control c to copy now go over to the place where you have your dedicated server tutorial project and go into the source folder and click on it and do control v to paste now let's rename this daddy server yt tut server dot target dot cs and make sure that this part just matches with your project name so once that is done you can right click and you can open it up with either of these things however i'm just gonna open it up with visual studio so over here we're gonna have to change everything that says ue4 to our game's name so this would be server yt tut and i forgot to capitalize that so steady server yt touch server and you can just copy that and paste it over here uefor server target will be daddy server yd touch server target and for extra modules names you will add your project name once you've finished configuring this cs file for our server what we'll do is open up the area where our project is located right click on it and click generate visual studio project files once that is complete what we'll do is go up and change our solution configuration to development server so we'll go on the drop down and click development server mouse may take a second to change and once that is complete we make sure that win64 is selected as the platform and right click on your project and click build now this may take a while depending on your pc specs so give it the time to build and i'll see you on the other side now once your server build is complete you'll need to open up the place where you have your project which is right here open up binaries win64 and you'll see that there is a daddy server yt-touch server right here this is the executable so click control c to copy and then go to your packaged tutorial or your packaged project open up windows note editor go over to engine oh wait no go over to the ytt binaries win64 and a control v to paste that and right click on your server and click on create shortcut and here right click and click properties now all we're gonna add here is a dash log so that we see the logs for our game click apply and then okay and now you can double click on your server to have it start up and you can see that it is prompting you to allow private network access so just click allow you know what this is this is you so here this is your server now you can close this out and what you can do is join from clients so actually let's restart this server and over here go into the windows note editor folder and double click on this actual game client twice so once those have opened up i'm going to split screen them so after the split screen is completed what we'll do is click on the tilde key and to open up the console where i open up and then you can auto complete by pressing tab and once you click enter it will open up your server map and now when you go over to the other client click tilde and open you'll open your local host and there you go you have a running server with two clients running on that server and you can see that this is the server map right here and if this is your first time doing this you probably feel like an extreme sense of joy and congratulations you have set up a dedicated server locally if you expose your ports you can join the server from a completely different device completely different wi-fi and this is really what we're gonna have to do if you're gonna be doing a dedicated server test using game lift and you've basically done the hardest part congratulations and if you have any questions or you want to hang out you can join the discord server down below i hope this guide this helped you out a lot and i will see you in the next video [Music] you
Info
Channel: Aphix
Views: 6,714
Rating: undefined out of 5
Keywords: unreal engine, ue4, ue5, aphix, unreal engine tutorial, ue4 tutorial, ue4 server, unreal engine server, ue4 how to setup a server, unreal engine how to setup a server, ue4 server tutorial, ue4 gamelift, epic online services, eos, ue4 epic online services, ue4 eos, unreal engine gamelift, unreal engine multiplayer, ue4 multiplayer
Id: AKiGajA7AXM
Channel Id: undefined
Length: 12min 53sec (773 seconds)
Published: Tue Jan 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.