Build the Game#
This page compiles the game module and packages the game for Linux.
The result is the packaged game in the folder Packaged/Linux.
Before You Start#
- Do the procedure of Install. The assets of Git LFS must be in the repository.
- Build the Unreal Engine 5.8 source. The file
Engine/Build/BatchFiles/RunUAT.shmust exist in the engine folder. - Stop each game and each editor that runs on the workstation.
- Keep 20 GB of the disk free.
Package the Game#
The Unreal Automation Tool (RunUAT.sh) does the full build: it compiles, cooks, stages and archives the game.
The procedure does not open the editor.
-
Go to the repository root.
-
Set the variable
UEto the engine folder. The engine folder contains the folderEngine. -
Make sure that no editor and no game run.
Expected Result
The command prints nothing.
CAUTION
Close the editor before you package the game. The cook starts a second editor process for the same project. When the MCP server of the editor starts automatically, the cook cannot bind port 8000 and the build fails.
-
Package the game.
"$UE/Engine/Build/BatchFiles/RunUAT.sh" BuildCookRun -project="$PWD/Acres/Acres.uproject" \ -platform=Linux -clientconfig=Development -build -cook -map=/Game/Maps/V03ACRE \ -stage -pak -iostore -archive -archivedirectory="$PWD/Packaged" -nop4 -unattended -utf8outputExpected Result
The tool prints one line for each completed stage and then the result.
Note
The first build compiles the game module and several thousand shaders. It is much slower than the subsequent builds. An incremental build took 56 s on the test workstation.
-
Make sure that the packaged game exists.
The options of the command have these functions.
| Option | Function |
|---|---|
-build |
Compiles the game module Acres and the target Acres. |
-cook |
Converts the assets to the format of the platform. |
-map=/Game/Maps/V03ACRE |
Cooks the farm map and the assets that the map uses. |
-stage -pak -iostore |
Copies the game into a layout that can run and packs the assets into container files. |
-archive -archivedirectory= |
Copies the completed game to the folder Packaged. |
-clientconfig= |
Selects the build configuration: Development or Shipping. |
-nop4 -unattended -utf8output |
Runs the tool without Perforce, without dialogs and with UTF-8 output. |
Note
The game loads some assets by path at run time, for example the vehicle meshes. The file
Acres/Config/DefaultGame.ini lists their folders as DirectoriesToAlwaysCook. Add a folder to this list when
the game loads a new asset by path.
Use the Package Script#
The script Tools/ACRE/Tools/package.sh does steps 3 and 4 and writes the output into a log file.
CAUTION
The script stops the game and the editor before it starts the build. Save your work in the editor first.
Expected Result
The script prints PACKAGE_EXIT 0.
Find the Result#
| Path | Content |
|---|---|
Packaged/Linux/Acres.sh |
The start script of the packaged game. Use this file in all commands. |
Packaged/Linux/Acres/Binaries/Linux/Acres |
The executable. |
Packaged/Linux/Acres/Content/Paks |
The cooked assets in container files. |
Packaged/Linux/Acres/Content/Simulation |
The configuration files that the game reads at run time. |
Packaged/Linux/Acres/Saved |
The folder that the game writes: logs, sessions and saved configurations. |
Packaged/Linux/Engine |
The engine files that the game needs. |
The packaged game on the test workstation uses 6.4 GB.
Development and Shipping#
The option -clientconfig= selects the build configuration.
| Configuration | Properties |
|---|---|
Development |
The game has the console and writes the log. The game writes into Packaged/Linux/Acres/Saved. An incorrect option stops the game with a message. All procedures of this documentation use this configuration. |
Shipping |
A build for distribution. The game has no console and writes no log. The game writes its data into the application data folder of the user. The build does not contain the checks of the options. |
Note
The test record of this documentation is for the Development configuration only.
Open the Project in the Editor#
Open the editor only when you change the map or the assets. The package procedure does not need it.
-
Start the editor with the project.
-
Accept the request to build the module
Acres.Expected Result
The editor opens the map
V03ACRE. -
Close the editor before you package the game again.
If the Build Fails#
| Symptom | Cause | Correction |
|---|---|---|
| The map loads grey or assets are missing. | Git LFS did not download the assets. | Run git lfs pull. Package the game again. |
| The cook stops with an error about port 8000. | An editor runs, or the MCP server of the editor starts automatically. | Close the editor. Use Tools/ACRE/Tools/package.sh. |
An assertion names the folder Acres/Shaders. |
The folder is not in the repository copy. | Get the folder from the repository. It contains the shader of the GPU LiDAR. |