Making an installed build of Unreal Engine 5

As I’ve mentioned in previous blog posts, I’m working on a game in Unreal Engine. I’ve come to the point where I’m starting to work on the online part of my game, and was considering using dedicated servers. Unfortunately, the version of the engine I was using from the Epic Games Launcher did not include the server build configuration.

For those that are unaware, there are two main ways to get and use Unreal Engine 5. The most common way is to install the pre-compiled binaries from the Epic Games Launcher. For most people wanting to use UE5, this is the easiest method. However, in some cases, developers may want to build the engine themselves from source. Obviously, if you want to make any modifications to the base engine, you’ll need to get UE5 using this method rather than the pre-compiled version. More commonly, however, developers may want to build dedicated server versions of their game projects.

For awhile, I was using the source version of UE5 just fine, but occasionally the engine would decide to do a full rebuild, even when only game code was changed. On my machine, this could sometimes take over an hour. Since I didn’t plan on making any engine changes, and only wanted to have access to the server build configuration, I decided to try to to make my own installed version of UE5 to speed up iteration time. In this post I will walk you through the basics of making an installed build and identify some snags I faced that you may too.

Prerequisites

You will need to download the UE5 source code from GitHub. To get access to the UE5 source code, you will need to create a GitHub account and then link your GitHub account with your Epic account. When you do this, you will receive an invitation to the Epic Games organization on GitHub. From there you can clone the UE5 repository.

The README in the repository explains what you need to do to finish setting up before you build UE5. You will need to get the project dependencies and then generate the project files for your platform.

Additionally, before making an installed build, you’ll want to get the platform SDK for each platform you plan on supporting. In my case I also wanted to be able to cross-compile and package my game for Linux. You can look at this page in the documentation to find the right tool-chain for the version of the engine you are building. For me, I was building Unreal Engine 5.0.3 so I installed -v20 clang-13.0.1-based cross-compilation tool-chain. You can check to see if the tool-chain installed successfully by running the following from the command line:

%LINUX_MULTIARCH_ROOT%x86_64-unknown-linux-gnu\bin\clang++ -v

You should see an output like this:

You may need to restart after installing the tool-chain to get this output

You should also regenerate your UE5 project files after installing the Linux tool-chain. If you open your UE5.sln Visual Studio project, you should see Linux as a platform target.

If you see Linux in the platform dropdown in Visual Studio then tool-chain was setup correctly

Using Unreal Automation Tool

An installed build can be made using Unreal’s BuildGraph system. Epic provides a BuildGraph script ready to go at [YourUnrealEngine5SourceDirectory]\Engine\Build\InstalledEngineBuild.xml. To run this script, use the following command after navigating to [YourUnrealEngine5SourceDirectory]\Engine\Build\BatchFiles:

RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -clean -set:WithClient=true -set:WithServer=true -set:WithLinux=true -set:WithLinuxArm64=false -set:WithWin64=true -set:WithMac=false -set:WithAndroid=false -set:WithIOS=false -set:WithTVOS=false -set:WithHoloLens=false -set:WithFullDebugInfo=true -set:BuiltDirectory="C:/UE5Custom/"

This will run a clean build of the installed version of UE5. You can see what the various parameters do on this page. The particular example above makes an installed build with Client and Server build configurations, and packaging support for Linux and Windows.

One snag I faced when building was running out of memory when the UnrealAutomationTool was working with large pre-compiled headers. I ended up having to increase the size of my pagefile to 32gb to get this build to run successfully.

Another snag I hit was running out of disk space when trying to build. The UE5 source directory grew to almost 500gb with all the intermediate files the build produced. The output directory with the installed build was almost 200gb. Make sure you have enough space before attempting to build.

Conclusion

As you can see, we are able to package a server target using a pre-compiled binary build of UE5
You switch your game projects to use your custom engine version just like you would with different versions of Unreal from the Epic Games Launcher

Once the build succeeds you can use it like you would with a version downloaded from the Epic Games Launcher. You can switch your Unreal projects to use this custom version of the engine. Most importantly, you now have the option to package a server version of your game from the editor.