Hour 24. Exporting the Project
What You’ll Learn in This Hour:
Things to consider when exporting for each platform
Creating Export Presets
Modifying Export Parameters
In this hour, we’ll learn about the process of deploying the project to the end users. First, we’ll take a look at how to export differently for each
platform. Then we’re onto creating the Export Presets and using them to manage export options. Finally, we’ll look at these options and how
they affect the exported binaries.
Platform-specific Considerations
Each platform is unique. Features that are available in one platform might not exist in another. For example, exporting for some mobile
platforms might have access to unified leaderboards, but rendering quality might not be as good as a desktop’s due to limited power. This can
be defined in the Project Settings.
Project Settings Override
To override a setting for specific platform, click on that item, choose “Override For” (Figure 24.1), then select the platform. A new setting item
is created, and you can use it to define a value for that platform (Figure 24.2).
FIGURE 24.1
“Override For” option
FIGURE 24.2
Disabling HDR for mobile platforms only
Export Presets
Export Preset is a way to manage export parameters for a platform. Most of the time, you want to separate parameters between Debug
(Testing) and Release build, since Debug build contains data useful for debugging, but this data takes up a lot of space and is not really useful
for end users. Using Export Presets, you can easily switch between building Debug and Release binary, and you don’t have to set export
options all over again each time you export for other platforms.
Export Templates
Export Templates are Godot engine without the Editor exported for each platform. You can launch the Export Template Manager from the
Editor menu > Manage Export Templates. On this dialog (Figure 24.3), you can download the templates and install, reinstall, and uninstall
templates.
FIGURE 24.3
Export Template Manager
Imported templates are saved in the Engine’s data directory/templates/<template_name>.
TIP
Export Template Version
It is very important that both Export Templates’ version and the Editor’s version are the same. The exported game might not behave as
expected when they don’t match.
Export Dialog
With the correct version of export templates installed, you can now create Export Presets and export the game using Export Dialog (Figure
24.4). It can be accessed from Project > Export.
FIGURE 24.4
Blank Export Dialog
111111111
22222222To create Export Preset, click the “Add” button (Figure 24.5) and choose the platform.
FIGURE 24.5
Adding an Export Preset
If you add a preset without the corresponding Export Template (Figure 24.6), a warning is displayed at the bottom upon selecting the preset,
and you’re not able to export the project (Figure 24.7).
FIGURE 24.6
Export Dialog with presets
FIGURE 24.7
Warning on missing Export Template
Export Options
Export Options are located at the right side of the Export Dialog. You customize the parameters from here. You can also specify which files to
be included or excluded.
Options
In this tab (Figure 24.8), there are various platform-specific options, including texture formats, binary types, application names, and versions.
Export templates are also overridden from here. You may want to do this when you make changes to the Engine internals and compile your
own export template specific to the project.
FIGURE 24.8
Options tab
Resources
Here, you can choose which files to include and exclude in the final package. Use a comma to separate entries (Figure 24.9).
FIGURE 24.9
Resources tab
Patches
This tab creates a patch (Figure 24.10) from a package file of an earlier version.
FIGURE 24.10
Patches tab
Features
This tab summarizes parameters from the Options tab. The features listed (Figure 24.11) determine which value to use in the Project Settings.
If a platform-specific value exists for the listed platform or feature, it is used instead of the global value. You can also add custom features here.
FIGURE 24.11
Features tab
Export
There are two export buttons in the lower part of Export Dialog, one for exporting PCK/Zip only, another for both executable file and PCK. Both
files must be in the same folder; otherwise, the game cannot start. Clicking on the button shows Save File Dialog. Choose the destination and
give it a name. Finally, click OK, and your game is now playable on that platform.
Summary
In this hour, you learned about exporting the project. You now know how to set default values for each platform. You learned about Export
Preset and Export Templates and where to manage them in the Editor and in the file system. You also learned about Export Dialog and adding
presets. You learned some basic Export Options and what each tab does. Finally, you learned how to export the executable file.
111111111
22222222Q&A
Q. What is the main difference between the Debug and Release templates?
A. The Debug template contains information useful in debugging with tools such as “gdb.” This information includes functions’ names and
their position in the source code, source file names, and paths in C++. Overall, it approximately takes an additional 100 megabytes of the
final executable file.
Q. What is the relation between Templates and the Editor?
A. Templates and Editor compile from the same version of C++ source code. However, Templates are compiled without tools (tools = no),
while Editor is compiled with tools enabled (tools = yes). In the other words, Templates are Godot engine without the Editor.
Workshop
Let’s recall the contents of this hour by answering these questions.
Quiz
1. Where can you find the imported Export Templates in the file system?
2. True or False: can you use any version of Export Template?
Answers
1. Godot appdata directory/templates/
2. False. The Template’s version must match the Editor’s.
Exercises
Try to execute these exercises to get acquainted with this topic.
1. Export any projects you’ve made so far to the same platform as the Editor.
2. Export the project to HTML5 platform and run it using your favorite web browser.
111111111
22222222