I want to create an overview/tutorial here where people can find it about the different ways of shipping a game in UE4 to save people the struggles that we went through. It is just no fun at all to figure it all out by yourself using scattered documentation, the one-liners on the UE4 answer hub that assume you already know half of the story and Google.
From what we figured out, there are 3 different ways of packaging:
- From within the UE4 Editor in the File Panel -> Package Project
https://docs.unrealengine.com/latest/INT/Engine/Basics/Projects/Packaging/ - From within the UE4 Editor using the Project Launcher in the Window Panel
https://docs.unrealengine.com/latest/INT/Engine/Deployment/Releasing/
http://docs.unrealengine.com/latest/INT/Engine/Deployment/Patching/ - From the Window Command Line starting the AutomationTool.exe with options
https://docs.unrealengine.com/latest/INT/Programming/Basics/CommandLineArguments/index.html
***Only the AutomationTool.exe with options via command line is useful for creating the final game for Steam upload or other distributions. See below why. ***
Pros/Cons:
File Panel -> Package Project
- most intuitive way because it is right in front of your nose
- needs to be set up in separate Panel (Edit->Project Settings->Packaging)
- does not allow creation of patches or downloadable content (DLC) after shipping. (most severe con)
Project Launcher in the Window Panel
- allows creation of patches or downloadable content (DLC) after shipping by creating an asset list that is later on compared with updated versions
- does not allow 32 bit builds for some inexplicable reasons
o no prerequisites included (but can be put in your shipping build by hand for the user to execute them)
AutomationTool.exe with options via command line
- is pretty much what the project launcher also does by creating a command line, see log file
- as opposed to the project launcher, here you can add the 32bit option by hand
- tedious and no any documentation resources, just need to experiment
o no prerequisites included (but can be put in your shipping build by hand for the user to execute them)
In a nutshell
For the final shipping built, you will want to create Patches and DLC to not have the players download the full file size everytime you update, but only the things you updated in your project. Therefore File Panel -> Package Project is out.
You also want to create a 32bit shipping built, because this one will run on 64bit systems as well, while 64bit builds will not run on 32bit systems, as with most other software. Best case is that you create both 32bit and 64bit. Therefore using the Project Launcher in the Window Panel is out.
This leaves you with the AutomationTool.exe with options via command line. It basically is a separate piece software that grabs all your project files and wraps them up to the shipping built. It does it separately from the UE4 Editor, which is why you can still play around in the Editor while packaging. The AutomationTool is hard to use directly and the Tutorial will focus on this. The other two ways of packaging have documentation which works and enable packaging with some playing around and trying, so I will skip extensive tutorials.
Please note that the final shipping built, the actual game that you and your customers will play, will not differ from one option to the other. So that’s good news. They are basically just three ways of achieving the same thing, with the first two ways being useless if it comes the final build that you want to put into your customer’s hands.
***Tutorial: Packaging with AutomationTool.exe and command line ***
0. Preparation: Just create a new project from the launcher without starter content, then add a sphere in order to create a map and save all.
1. Off we go: Start the Project Launcher within the Editor, follow Epics Tutorial and create one successful project launcher build. Do not give up, it actually works! This done, go on and save the log file. The only purpose of this step is to get a saved log file. After this is done, you can delete this project folder and continue working on a copy of your project folder that has not seen any packaging.
2. Now back to Windows: Open the command line window by typing cmd in your Windows Search field or the Windows Execute and hit enter. (both can be found using the Start Button)
Now you have entered the long forgetten realm of ancient DOS. Here you will execute the AutomationTool with options. It could also be done in a normal modern shortcut that you create from your .exe, but for a full build the options line is too long for that. Now some Old School! Work your way into the AutomationTool Folder using the old school commands in the screenshot.
4. Ready to Package: Start the AutomationTool.exe as shown in the sreenshot with the (extremely long) options line pasted from your saved log file.The actual UE4 Project File does not have to be open for Packaging. Monitor the Automation tool to make sure everything is fine using the task manager for example. The cmd will close once everything is done.
- All done and fine, there should be a release folder now in your Project folder and all other things like the shipping built. Most importantly, the assetsregistry which allows patching later on.
Success! We now have a build that can be 32bit if we want and can use patches/DLC. That was not difficult or unnecessarily cumbersome, was it? Why they did not include all in one package tool and instead scattered it all over the place, nobody knows…
***Tutorial: Patching with AutomationTool.exe and command line ***
The steps are essentially the same as for releasing, but this time you set up the project launcher for patching and extract the new command line from the saved log.
- Make a copy of the project folder for patching. The patching process deletes the original .pak file and replaces it with the patch file. Therefore the copy.
- Do a project launcher patch run, save the log file and extract the command line. It shouls now contain -generatepatch and -basedonreleaseversion=.
- Delete the project folder that you just treated with the project launcher, make a new copy of the original project folder and package here with the AutomationTool using the patch command line.
- When all is done, there will be the patch file with ending xxxxx_P.pak and you just take that and move it (e.g. copy/paste) into your original project folder with the release .pak file. So there will be two files in the end sitting in the same folder: the original release .pak file and the patch. pak file. Starting you project as usual will load the patch automatically.
In testing, for an empty scene with just a sphere the .pak was released ~30MB. Then we changed the color of the sphere from white to blue to be used for a patch, and the patch file was only ~100kb. So that’s really useful for dlc and patching.