Package the game¶
A Windows build that you can hand to other players needs a C++ toolchain, even though the template has no code. The template enables three plugins the engine does not enable by default, CommonUI, Chaos Vehicles and Motion Warping. Unreal then builds a game executable for the project, as it would for a C++ project.
Before you start¶
Install, once:
- Visual Studio with the Desktop development with C++ workload, or the Build Tools for Visual Studio with that same workload. Use a version the Unreal Engine 5.8 release notes support. Visual Studio 2022 is known to work.
- A Windows 10 or 11 SDK. The Visual Studio installer offers it in the same workload.
Then restart the editor. You do not need to open Visual Studio, write code or generate project files.
What the template already sets¶
The packaging settings are in Config/DefaultGame.ini, section
[/Script/UnrealEd.ProjectPackagingSettings], which is also
Edit > Project Settings > Packaging.
| Setting | Value | Why |
|---|---|---|
BuildConfiguration |
Shipping | The configuration you release. |
MapsToCook |
L_Boot, L_MainMenu, L_World |
L_World is opened through a soft reference. Without this list it would be left out of the build. |
DirectoriesToAlwaysCook |
DataAssets |
The Data Assets are found at run time through the Asset Manager. |
DirectoriesToNeverCook |
Developers |
The editor's developer folder stays out. |
bSkipEditorContent |
true | Editor-only content stays out. |
UsePakFile |
true | The content is packed in one file. |
The .uproject also turns one stock plugin off, NNEDenoiser, the path tracer's denoiser, which the
game does not use. A packaged game then does not carry that plugin's runtime libraries.
Steps¶
1. Raise the version¶
In Edit > Project Settings > Description, raise Project Version at every build you hand out.
It is ProjectVersion in Config/DefaultGame.ini, 1.0.0 as shipped. It is also the network
version: a player whose version differs from the host's is refused.
Give the same value to GameVersion in the Class Defaults of
Blueprints/Core/BP_ZSGameInstance. The main menu shows that number, bottom right.
2. Add your own maps¶
If you made maps of your own, add them to
List of maps to include in a packaged build (MapsToCook) on the Packaging page.
3. Choose the configuration¶
In the main toolbar, open Platforms > Windows and pick one under Binary Configuration. Take Shipping for a release: it is the template's default. Take Development to test: it keeps the console and the logs.
Hosting a co-op game from a Shipping build has not been tested.
4. Package¶
- Platforms > Windows > Package Project.
- Choose an output folder with a short path, for example
D:\Builds\ZombieSurvival.
The first build compiles the game target, then cooks every map and their shaders. It can take a long time. The Output Log shows the progress.
Check that it works¶
The output folder holds a Windows folder with ZombieSurvival.exe. Start it and the main menu
opens. NEW GAME offers Pine Hollow, then character creation and the world open. HOST and
JOIN are the same menus as in the editor.
The first time the packaged game starts, Windows shows its firewall prompt, because the game listens for the other players. Allow it on the host, or nobody can join. The build has not been run on a second PC, and co-op over the Internet has not been tested.
A packaged game keeps its saves in the player's own folder, not in the project.
If it does not work¶
- Packaging stops at once with a message of this kind, "ZombieSurvival.uproject has no code, but is being treated as a code-based project ... because: CommonUI plugin is enabled": the C++ workload or the Windows SDK is missing. Install them and restart the editor.
- A map is missing from the build: add it to
MapsToCook. - The paths are too long: package to a short folder, such as
D:\Builds. - The cook reports errors: read the first error of the Output Log, not the last line. Fix that asset and package again.
- Another player is refused with "different version": both builds need the same
ProjectVersion.
What packaging does not do¶
Packaging does not sign the executable, make an installer or upload anything to a store. It does not set up Steam or any other platform: the template plays over the local network and by direct IP. It builds Windows only here, because the template is made and checked on Windows.