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.

Migrating from Perforce to Git

For the past year I’ve been using Perforce for my VCS. Originally, I had used Perforce over something like Git or SVN because of its ubiquity in game development and its supposed advantage in handling large binary files. I think Perforce is a fine VCS, but the lack of documentation, being locked into using Perforce’s tools (at least to my knowledge), and an almost nonexistent community has me reconsidering other VCS options. I decided it was time to take another look at Git. Git is used basically everywhere, has a wealth of resources, and I like having the choice of different self-hosted services like GitLab and Gitea (which is what I’m using now). Git also seems to handle binary files better these days, with Git LFS adding file locking support, which basically allows Git users to get the same functionality that a Perforce checkout would enable.

With the decision to switch from Perforce to Git settled, I looked into how best to convert my existing Perforce depot into a Git repository. I wanted to write a quick help you avoid some of the snags I encountered.

If you don’t care about preserving your Perforce history

It should be noted, this process is extremely easy if you don’t care about preserving the history of your Perforce depot. If this applies to you, the easiest way to switch from Perforce to Git is to simply initialize a new Git repository in the local Perforce workspace. At this point you can add a .gitignore, initialize Git LFS, and then push this repo to the remote Git hosting service of your choice. This of course means your Git commit history will be starting from the latest revision Perforce depot you’ve pulled. This may be fine for projects early on in development, but if you have release milestones you’d like to be able to revert back to, you’ll want to preserve your history while converting to a Git repository. Luckily, Git provides some tools to assist in this conversion.

Covert from P4 to a Git while maintaining your Perforce history

Setting up the environment

We will need Python installed to run the git-p4 script. On Windows you can check to see if Python is installed by running

py --version

If Python is installed, you should see some output like

Python 3.10.1

Where the version number will be whatever is recent at the time reading this. In my case I was using 3.10.1. I have not tested this process using Python 2, but I don’t see why it wouldn’t work.

In my case, I was getting errors when trying to run this script. Downloading the latest script from here fixed the problem. In my case I’m using Fork, so my git-p4 script goes in the C:\Users\[USER_NAME]\AppData\Local\Fork\gitInstance\2.33.1\mingw64\libexec\git-core directory.

You’ll also need to add an alias to your .gitconfig, which aliases p4 to the git-p4.py script you just downloaded. The line should be added to [alias] section of your .gitconfig and should look something like this:

[alias]
	p4 = !'C:\\Users\\kevin\\AppData\\Local\\Fork\\gitInstance\\2.33.1\\mingw64\\libexec\\git-core\\git-p4.py'

You should replace the path with wherever you had downloaded the git-p4.py script in the previous step.

Cloning from your Perforce depot

You’ll first want to open your Perforce workspace. For me this meant opening P4V and connecting to my remote Perforce server. After that you can run:

git p4 clone //depot/main@all [Path_And_Name_Of_Your_New_Repository]

This will clone the Perforce depot as a Git repository in the path your specified. For example:

git p4 clone //depot/main@all /z/Repos/MyRepo

Will clone the repository in the folder Z:/Repos/MyRepo. The @all at the end of the depot path specifies to preserve the entire Perforce submission history as a Git commit history. Once the cloning completes, you can check this by running either git log or gitk. At this point you can do any other “smoke tests” you’d normally do to make sure your clone was successful.

Conclusion

At this point you have a new Git repository, and can do anything you’d do with any other Git repository. Since you’ve just cloned from Perforce, you’ll probably want to add a .gitignore, initialize Git LFS, add a .gitattributes file, and setup your new remote. At this point you can now use Git as your VCS for your project.

Welcome to my site 2.0!

It has been awhile since I utilized this site and made any posts. Needless to say a lot has changed in my life since 2019. I wanted to make a re-introduction post to explain what I’ve been up to recently and what’s new since I created this site.

Starting a game company

My “side hustle” is no longer trying to start a game company, at least right now. At some point after making that original introduction post, I realized I enjoyed game development much more when I treated it purely as a hobby in my free time. I like being able to focus on making what I want at the pace I want. By treating gamedev as just a hobby, I can make fan games or small standalone demos since I don’t have to worry about marketability or anything like that.

I still want to release an original game of my own one day, but I’m less interested in making a career out of game development. If I happen to eventually release something that sells enough or gets enough support to sustain me full-time, then that’s great, but it is no longer the end goal. For now, I just want to work on improving my skills and getting game projects out into the world for people to play.

Engine development

I am also no longer trying to learn OpenGL and make a game engine from scratch. In the same way I realized I enjoy game development as a hobby rather than a “side hustle,” I realized I enjoy designing and implementing gameplay systems and levels more than I’m interested in making a game engine. Since the beginning of 2020, I’ve been using Unreal Engine 4 and have been enjoying its workflow. I’ve since made a couple game projects in it, to varying levels of completeness. I may revisit some of those unfinished projects in a future post.

What’s next?

My main goal for this year is to release more game projects. There are a couple fan game projects I have in mind and I want to release betas for them by the end of this year. Another goal of mine is to be more active with this site. My main focus for the site will be making tutorials and writing technical articles about game development problems I faced and how I solved them. I think within the Unreal Engine community, we’re lacking in community-made resources compared to other engines like Unity and Godot. I’m a big proponent of knowledge sharing, and want to make sure there are high quality guides out there for Unreal Engine.

New site features

I’ve started to add more pages to the site aside from blog posts. Along with the site, I’ve also set up a self-hosted Git service for my game projects and libraries. You can find that under the “Portfolio” tab at the top of the page. You can also find links to my GitLab and GitHub under that same tab as well.

Like always, I hope you enjoy your stay! Stay tuned for more blog posts in the near future.

The Vampire Killer

Introduction

I’ve recently been getting into 3D modeling after following Blender Guru’s awesome tutorials. After I finished both his beginner and intermediate tutorials I wanted to go make a model on my own to apply what I learned. I knew I had to pay homage to one of my favorite game series of all time, Castlevania. What better way to pay homage than to make the main weapon from the series, the vampire killer. In terms of references I made a sort of amalgam of all the versions of the vampire killer over the years. I based the handle after the Lords of Shadows version of the weapon. For the chain I wanted to keep it classic so I used Simon’s most recent rendition from Super Smash Bros. Ultimate.

Making the model

The leather wrappings

I learned a lot of new useful tricks doing this model. The handle itself was pretty straightforward besides the leather wrappings. After doing some research I came across this tutorial. The jist is you take various helix curves, convert the curve into vertices, then extrude those out to make a flat rectangular mesh. Once you have the mesh you can use a shrink wrap modifier to wrap it around the grip and a solidify modifier to make it look like an actual strip of leather. I made a copy of just the grip portion of the handle because using the whole handle as the shrink wrap target produced weird results.

Example of one strip of leather wrapped around the grip with the corresponding modifier stack

The spiked ball

Another challenge was making the spike ball at the end of the chain. To do this I made a basic spike shape and set it to be a child of a low-poly ico sphere. I then used Blender’s DupliVerts feature to put the spikes at the vertices of the ico sphere. I made the duplicates “real” and then replaced the ico sphere with a UV sphere. The UV sphere had a subsurf modifier applied to make it look like it does in the final render.

The chain

The chain was probably the easiest object to model, but the hardest to get to how you see it in the final render. I wanted to be able to manipulate and place the chain easily without hand placing each chain link. To do this I used a combination of an array modifier and a curve modifier (using a Bezier curve as the target object) to a single chain link. This combo allowed was then able to position the chain how I wanted. Unfortunately, this slightly morphed the chain links in an undesirable way. I looked into how to fix this, but ultimately decided to live with the deformation since I had been working on this model for about a month. It is barely noticeable in the final render anyway.

Once I was happy with the basic shape of the chain, I set out to have the chain look like it was resting naturally on a surface. Luckily, Blender has a physics engine built in which is great for these types of tasks. Once again, Blender Guru came to the rescue with his tutorial on how to set up rigid bodies. Once I was done setting up the rigid bodies for each chain link I simulated the physics until the chains settled.

Lighting

My lighting setup was pretty simple. I wanted to have that look of a night lit by a full moon. I achieved this by making a giant area light with a blueish tint which sat directly above the chain whip. I added another area light which shown down on the whip from the top left. The point of this light was to mimic the moonlight shining in from a window. Finally, I added a red/orange point light to contrast all the blue light in the scene. This sort of looks like a fireplace in the corner of a room. Overall I’m pretty happy with how the lighting came out. I think it captures the mood of the series pretty well.

Conclusion

Overall I’m happy with how this model turned out. It took me a good deal of time from start to render but I think that was because I had to learn a lot as I went. I think the tricks I learned would be useful for other types of medieval weapons and objects. For my next model I’m going to try something simpler just so I can have more output going forward. Ideally I’d like to finish my next model in about a week or so. Hopefully I will have more to share here soon!

The vampire killer from Castlevania

Welcome to my site!

My name is Kevin Poretti.

I’m a software engineer for GameCo Inc.

My side hustle is trying to start a game company. My dream is to be able to materialize my lifelong passion into a commercially released game.

I have an interest in low-level programming and computer graphics. I’m currently studying OpenGL and trying to further improve my C/C++ skills by developing my own game engine from scratch.

With this site I intend to document my progress towards this goal, but I also have many other interests. You may find tutorials, blog posts, art, recipes, and a slew of other content I plan on creating in whatever free time I have.

I hope you enjoy your stay!