How to build build pipeline for your Unreal Engine 4 game, along with iteration advice and best practices.
Originally presented in Poznan, Poland for GIC 19.
2. #UE4 | @UNREALENGINE
Introduction
Axel Riffard
Epic Games Japan
Support Engineer
● French 🇫🇷
● Twitter : @AxRiff
● Hobbies : Whisky, Cats and Disneyland
● Currently Playing: Dragon Quest XI, COD Mobile, The Witcher III (Switch)
9. #UE4 | @UNREALENGINE
Disclaimer
There is no such thing as THE perfect pipeline.
Rely on experience ! In this session, I will only talk to you about mine and
give you a few best practices. But donʼt trust me, trust yourself !
10. #UE4 | @UNREALENGINE
Agenda
●CI : What is it ?
●UnrealAutomationTool
●Building the Engine and your Project
●The other stuff
●The Unreal Way
11. #UE4 | @UNREALENGINE
Agenda
●CI : What is it ?
●UnrealAutomationTool
●Building the Engine and your Project
●The other stuff
●The Unreal Way
14. #UE4 | @UNREALENGINE
● Local build breaks after updating
● Finding the bad commit wastes time
● Communication issues, fights in the team
● Non technical members are scared to commit things
● Building locally every time is a waste
Consequences
15. #UE4 | @UNREALENGINE
CI Software
CI = Continuous Integration
A combination of software and hardware allowing to merge the team source
code and assets several times every day.
18. #UE4 | @UNREALENGINE
CI Software
In 2019, there is no bad choice.
I have worked with both TeamCity and Jenkins, and was satisfied with
both of them
21. #UE4 | @UNREALENGINE
Jenkins
Merits︓
● Free Open Source
● Plenty of documentation and plugins
● Huge Community
Drawbacks︓
● Commercial Support exists but is complicated
● Some plugins are unreliable
23. #UE4 | @UNREALENGINE
TeamCity
Merits :
● Building pipelines is crazy fast
● Technical support is great
Drawbacks :
● Limitations on the Free version
24. #UE4 | @UNREALENGINE
CI Software
Every advice can be applied to TeamCity, or any CI solution.
Also, totally unrelated, but this cat looks like Jenkins mascot, so Iʼm going
to use him instead.
27. #UE4 | @UNREALENGINE
Build Machine
VersioningDEV PC
CI Server
Master
Slack
Commit
Slave 1 Slave 2 Slave 3
Company
Server
Poll
Distribute
Versioning
28. #UE4 | @UNREALENGINE
Build Machine – How many
Prototyping Stage :
● Just the Master
Production Stage :
● One Master
● One slave for every release platform
29. #UE4 | @UNREALENGINE
Build Machine - OS
Master︓Win64 or Linux
Slave︓Win64(for platforms SDK), MacOS for Apple Platforms
31. #UE4 | @UNREALENGINE
Build Machine - MacOS
No C++ and Shader compiling distribution on Mac,
So get as many cores as you can for your CPU.
If itʼs just for a build machine, no need for GPU.
High spec Mac Mini is good enough.
32. #UE4 | @UNREALENGINE
Agenda
●Continuous Integration : What is it ?
●UnrealAutomationTool
●Building the Engine and your Project
●The other stuff
●The Unreal Way
33. #UE4 | @UNREALENGINE
Building in UE4
● Engine and Editor
● Game sources
● Game Assets (lights, shaders, etc.)
● Tools
34. #UE4 | @UNREALENGINE
Build Commands
Find all the command lines here
https://github.com/AxRiff/UnrealEngineJenkins
36. #UE4 | @UNREALENGINE
UnrealAutomationTool
Depending on your company size, type of project, workflow, etc., you can
use different parts of UnrealAutomationTool
● BuildGraph Custom Script
● BuildGraph InstalledBuild Script
● BuildCookRun Command Line Tool
40. #UE4 | @UNREALENGINE
BuildGraph
Merits :
● Reduce dependency on CI framework.
● Work on it locally -> No more Jenkins master
● XML Based : easy to read and write
● Platform Agnostic
● Can be shared between projects
Drawbacks :
● Steep learning curve at first
41. #UE4 | @UNREALENGINE
BuildGraph
● Agents: Group of nodes being executed on the same build machine
● Nodes: Sequence of Tasks
● Tasks: Build Process Step (Updating, Compiling, etc)
49. #UE4 | @UNREALENGINE
InstalledBuild
● Think of it as your own Unreal Launcher
● Created by Epic to deploy a non editable engine
Engine/Build/InstalledEngineBuild.xml
● Easy to use for Designers and Artists
● Engine build only. Canʼt use it to build a project.
57. #UE4 | @UNREALENGINE
BuildCookRun
● Script located at /Engine/Build/BatchFiles/
● From build to package, do anything
● Highly customizable
● Command line based : nostalgic feeling ! <3
58. #UE4 | @UNREALENGINE
BuildCookRun, BuildGraph, InstalledBuild
● Depending on the situation, the best choice will differ
● I think adaptability is the most important thing in game dev, so I
personally use BuildCookRun most of the time.
59. #UE4 | @UNREALENGINE
Agenda
●CI : What is it ?
●UnrealAutomationTool
●Building the Engine and your Project
●The other stuff
●The Unreal Way
61. #UE4 | @UNREALENGINE
Engine DLL Build
If you donʼt edit the Engine a lot, trigger it manually
If you extend the Engine a lot, do it once a day. Morning or Lunch Time
is preferred
65. #UE4 | @UNREALENGINE
Build Command
Engine/Build/BatchFiles/RunUAT.bat BuildCookRun
-project=Samples/StarterContent/StarterContent.uproject
-platform=Win64
-clientconfig=Development
-build
You need a uproject to use RunUAT. You
can use a sample project or blank one !
86. #UE4 | @UNREALENGINE
Build Command
Engine/Build/BatchFiles/RunUAT.bat BuildCookRun
-project=GamePath/GameName.uproject
-noP4
-platform=Win64
-clientconfig=Development
-cook
-allmaps
-build
-stage
-pak
-archive
-archivedirectory=C:/TempDirectory/
Argument to zip all the assets in one “pak” file
91. #UE4 | @UNREALENGINE
Build Command
https://github.com/electronicarts/EACopy
Twitter : @honk_dice
EA DICE Studios has open sourced EACopy, a faster alternative to
robocopy !
Give it a try !!!
93. #UE4 | @UNREALENGINE
Incremental Build
● Manual Trigger
● For those “Hey mate, I need to show the build in 40 minutes to our
investor / boss / publisher, do smth plz lolwut”
● Contrary to the nightly build, faster is better so …
● Use -partialgc
● Donʼt make it clean
94. #UE4 | @UNREALENGINE
Incremental Build Flow
Jenkins Build
Send to
DevKit
Update
Notify
For DevKit deployment, check your platform
But you might get an idea
/Engine/Source/Programs/AutomationTool/PlatformName/PlatformNamePlatfo
rm.Automation.cs
95. #UE4 | @UNREALENGINE
Build Command
Engine/Build/BatchFiles/RunUAT.bat BuildCookRun
-project=GamePath/GameName.uproject
-noP4
-platform=Win64
-clientconfig=Development
-cook
-allmaps
-build
-stage
-pak
-archive
-partialgc
-archivedirectory=C:/TempDirectory/
Instead of cleaning the memory when you run out of it, it will free it
up at the end of the packaging process
104. #UE4 | @UNREALENGINE
Shared DDC
Derived Data Cache (DDC) is a feature to keep assets that were
prepared for every platform.
To make it simple, itʼs an asset caching feature.
109. #UE4 | @UNREALENGINE
Argument Type Comment
ReadOnly Bool Make it false when Shared
Clean Bool Delete files that went over UnusedFileAge limit
Flush Bool Delete all DDC
DeleteUnused Bool Il false, never deletes old assets (overrides UnusedFileAge and Clean)
UnusedFileAge Int Limit of days after which an asset will be deleted, Fortnite sets it to 10.
FoldersToClean Int Max limit of folders to be flushed each time. 0 or -1 means no limit.
Shared DDC
113. #UE4 | @UNREALENGINE
Lighting Build
● All lights except the ones calculated in real time are to be built.
● Of course, Epic is providing the tools for it.
But …
117. #UE4 | @UNREALENGINE
Lighting Build
There are times you want to check the lights in the editor / game
In this case, build locally, and Swarm is your new BFF
118. #UE4 | @UNREALENGINE
Lighting Build - Swarm
With Swarm, you can distribute the task of
building lights between the computers of your
team.
You will need a Coordinator. Your Jenkins master
should do the trick.
https://wiki.unrealengine.com/Swarm_Agent_Trou
bleshooting
119. #UE4 | @UNREALENGINE
Lighting Build - Swarm
Engine/Binaries/DotNET/SwarmCoordinator.exe
Engine/Binaries/DotNET/SwarmAgent.exe
To add it at startup,
Create a shortcut the the Agent and copy it here.
%APPDATA%/Microsoft/Windows/Start Menu/Programs/Startup
121. #UE4 | @UNREALENGINE
Redirectors
● When you move or rename an asset in the editor, a Redirector is created to
know the ”new address”
● Super convenient feature but it has a tendency to bug, so you will need to
clean them up frequently
● Once a month is fine, but do it once a week in the critical phases of the
project (alpha, beta, gold, patch release)
https://docs.unrealengine.com/en-US/Engine/Basics/Redirectors/index.html
125. #UE4 | @UNREALENGINE
Fortnite
● Only engineers have Visual Studio
● We are building with BuildGraph managed by ElectricCommander
● We are heavily using UnrealGameSync
126. #UE4 | @UNREALENGINE
Iteration
Iteration can seem complicated without Visual Studio.
But actually, itʼs pretty manageable.
● Heavily rely on PIE for testing
● Leverage your CI software properly
127. #UE4 | @UNREALENGINE
Testing a Level on Device
So letʼs say your artist has just changed a characterʼs hair color and
wants to see how it looks on the release platform screen before
committing…
First, create an incremental build task on your CI software, and commit
the binaries to Project/Binaries/PlatformName
128. #UE4 | @UNREALENGINE
Custom Launch Profile
Then in the editor, click on the triangle on
the right side of of “Launch”, scroll down
and create a new Custom Launch Profile
Stored in
/Engine/Programs/UnrealFrontend/Profiles
In the profile, untick the Build step, and
then you can deploy the currently edited
level on the machine connected to the
computer, even without Visual Studio.
Magic !!
129. #UE4 | @UNREALENGINE
Build Machine Jobs
What I think a UE4 build pipeline should have :
● Engine Build
● Project Build
● Nightly Package
● Incremental Package
● Incremental Package for the Device Launcher
● Lightmaps Build
● Fixup Redirectors Command
● SharedDDC Cleanup Command
● SharedDDC Fillup Command
Any suggestion on what to add ? Tell me in Q&A !!!
130. #UE4 | @UNREALENGINE
Versioning
● Epic uses Perforce. If you want to be as close as possible to our
workstyle, you know what to do
● SVN might be a little slow, but it is very reliable and still heavily used
● GIT is free, modern design choices and is very used for mobile and
social games (in Japan !)
SVN and Perforce have Editor support !
GIT too, but itʼs still experimental !
131. #UE4 | @UNREALENGINE
UnrealGameSync
Made by Epic for Epic. Heavily used on Fortnite
Itʼs Perforce only, and it allows non technical staff not to have to deal with
P4V
134. #UE4 | @UNREALENGINE
UnrealGameSync
Get the latest version anytime on GitHub and Perforce.
UGS dev is unrelated to UE4, so always get the latest version even if
youʼve locked your engine version !
https://docs.unrealengine.com/latest/en/Programming/Deployment/Unre
alGameSync/Reference/
135. #UE4 | @UNREALENGINE
https://github.com/gpageot/JenkinsUE4
Twitter : @GregoryPAGEOT
https://github.com/AxRiff/UnrealEngineJenkins
Twitter : @AxRiff
https://github.com/electronicarts/EACopy
Twitter : @honk_dice
Manga by @shiba_zushi, Technical Artist at Epic Games Japan.
Links