Why export?¶
Originally, Godot did not have any means to export projects. The
developers would compile the proper binaries and build the packages for
each platform manually.
When more developers (and even non-programmers) started using it, and
when our company started taking more projects at the same time, it
became evident that this was a bottleneck.
On PC¶
Distributing a game project on PC with Godot is rather easy. Drop
the Godot binary in the same directory as the project.godot
file,
then compress the project directory and you are done.
It sounds simple, but there are probably a few reasons why the developer
may not want to do this. The first one is that it may not be desirable
to distribute loads of files. Some developers may not like curious users
peeking at how the game was made, others may find it inelegant, and so on.
Another reason is that the developer might prefer a specially-compiled
binary, which is smaller in size, more optimized and does not include
tools like the editor and debugger.
Finally, Godot has a simple but efficient system for
creating DLCs as extra package files.
On mobile¶
The same scenario on mobile platforms is a little worse.
To distribute a project on those devices, a binary for each of
those platforms is built, then added to a native project together
with the game data.
This can be troublesome because it means that the developer must be
familiarized with the SDK of each platform before even being able to
export. While learning each SDK is always encouraged, it can be
frustrating to be forced to do it at an undesired time.
There is also another problem with this approach: different devices
prefer some data in different formats to run. The main example of this
is texture compression. All PC hardware uses S3TC (BC) compression and
that has been standardized for more than a decade, but mobile devices
use different formats for texture compression, such as ETC1 and ETC2.
Configuration files¶
The export configuration is stored in two files that can both be found in the project
directory:
-
export_presets.cfg
: This file contains the vast majority of the export
configuration and can be safely committed to version control. There is nothing
in here that you would normally have to keep secret. -
.godot/export_credentials.cfg
: This file contains export options that are
considered confidential, like passwords and encryption keys. It should generally
not be committed to version control or shared with others unless you know
exactly what you are doing.
Since the credentials file is usually kept out of version control systems, some
export options will be missing if you clone the project to a new machine. The easiest
way to deal with this is to copy the file manually from the old location to the new one.
Exporting from the command line¶
In production, it is useful to automate builds, and Godot supports this
with the --export
and --export-debug
command line parameters.
Exporting from the command line still requires an export preset to define
the export parameters. A basic invocation of the command would be:
godot --export "Windows Desktop" some_name.exe
This will export to some_name.exe
, assuming there is a preset
called «Windows Desktop» and the template can be found. (The export preset name
must be written within quotes if it contains spaces or special characters.)
The output path is relative to the project path or absolute;
it does not respect the directory the command was invoked from.
The output file extension should match the one used by the Godot export process:
-
Windows:
.exe
-
macOS:
.zip
(from all platforms) or.dmg
(only when exporting from macOS).
.app
is not supported directly, although the generated ZIP archive contains an.app
bundle. -
Linux: Any extension (including none).
.x86_64
is typically used for 64-bit x86 binaries. -
HTML5:
.zip
-
Android:
.apk
-
iOS:
.zip
You can also configure it to export only the PCK or ZIP file, allowing
a single exported main pack file to be used with multiple Godot executables.
When doing so, the export preset name must still be specified on the command line:
godot --export-pack "Windows Desktop" some_name.pck
It is often useful to combine the --export
flag with the --path
flag, so that you do not need to cd
to the project folder before running
the command:
godot --path /path/to/project --export "Windows Desktop" some_name.exe
PCK versus ZIP pack file formats¶
Each format has its upsides and downsides. PCK is the default and recommended
format for most use cases, but you may want to use a ZIP archive instead
depending on your needs.
PCK format:
-
Uncompressed format. Larger file size, but faster to read/write.
-
Not readable and writable using tools normally present on the user’s
operating system, even though there are
third-party tools
to extract and create PCK files.
ZIP format:
-
Compressed format. Smaller file size, but slower to read/write.
-
Readable and writable using tools normally present on the user’s operating system.
This can be useful to make modding easier (see also Exporting packs, patches, and mods).
Warning
Due to a known bug,
when using a ZIP file as a pack file, the exported binary will not try to use
it automatically. Therefore, you have to create a launcher script that
the player can double-click or run from a terminal to launch the project:
:: launch.bat (Windows) @echo off my_project.exe --main-pack my_project.zip # launch.sh (Linux) ./my_project.x86_64 --main-pack my_project.zip
Save the launcher script and place it in the same folder as the exported binary.
On Linux, make sure to give executable permissions to the launcher script using
the command chmod +x launch.sh
.
See also
This page describes how to export a Godot project to Windows.
If you’re looking to compile editor or export template binaries from source instead,
read Compiling for Windows.
The simplest way to distribute a game for PC is to copy the executable
(godot.exe
), compress the folder and send it to someone else. However, this
is often not desired.
Godot offers a more elegant approach for PC distribution when using the export
system. When exporting for Windows, the exporter takes all the project files and
creates a data.pck
file. This file is bundled with a specially optimized
binary that is smaller, faster and does not contain the editor and debugger.
Code signing
Godot is capable of automatic code signing on export. To do this you must have the
Windows SDK
(on Windows) or osslsigncode
(on any other OS) installed. You will also need a package signing certificate,
information on creating one can be found here.
Warning
If you export for Windows with embedded PCK files, you will not be able to
sign the program as it will break.
On Windows, PCK embedding is also known to cause false positives in
antivirus programs. Therefore, it’s recommended to avoid using it unless
you’re distributing your project via Steam as it bypasses code signing and
antivirus checks.
Setup
Settings need to be changed in two places. First, in the editor settings, under
Export > Windows. Click on the folder next to the Sign Tool
setting, if
you’re using Windows navigate to and select SignTool.exe
, if you’re on a different
OS select osslsigncode
.
The second location is the Windows export preset, which can be found in
Project > Export…. Add a windows desktop preset if you haven’t already.
Under options there is a code signing category.
Enabled
must be set to true, and Identity
must be set to the signing
certificate. The other settings can be adjusted as needed. Once this is Done
Godot will sign your project on export.
Environment variables
You can use the following environment variables to set export options outside of
the editor. During the export process, these override the values that you set in
the export menu.
Windows export environment variables
Export option |
Environment variable |
---|---|
Encryption / Encryption Key |
|
Options / Codesign / Identity Type |
|
Options / Codesign / Identity |
|
Options / Codesign / Password |
|
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
Appearance settings
Пройдите тест, узнайте какой профессии подходите
Работать самостоятельно и не зависеть от других
Работать в команде и рассчитывать на помощь коллег
Организовывать и контролировать процесс работы
Введение в экспорт проектов в Godot
Экспорт проекта в Godot позволяет разработчикам распространять свои игры и приложения на различные платформы. Godot поддерживает экспорт на настольные, мобильные и веб-платформы, что делает его универсальным инструментом для создания игр. В этой статье мы рассмотрим, как подготовить проект к экспорту и как выполнить экспорт на разные платформы.

Подготовка проекта к экспорту
Перед тем как приступить к экспорту проекта, необходимо убедиться, что ваш проект готов к этому процессу. Вот несколько шагов, которые помогут вам подготовить проект:
- Проверка ошибок и предупреждений: Убедитесь, что в вашем проекте нет ошибок и предупреждений. Это можно сделать с помощью встроенного отладчика Godot. Ошибки могут включать в себя проблемы с кодом, отсутствующие ресурсы или неправильные настройки. Предупреждения могут указывать на потенциальные проблемы, которые могут не быть критическими, но все же требуют внимания.
- Оптимизация ресурсов: Убедитесь, что все ресурсы (текстуры, аудиофайлы и т.д.) оптимизированы для целевой платформы. Например, для мобильных платформ важно использовать текстуры меньшего размера. Оптимизация также включает в себя уменьшение количества полигонов в 3D моделях и использование форматов, которые лучше всего подходят для целевой платформы.
- Настройка конфигурации проекта: В разделе «Project Settings» убедитесь, что все настройки проекта соответствуют требованиям целевой платформы. Например, для мобильных платформ нужно настроить ориентацию экрана и разрешение. Также стоит обратить внимание на настройки производительности, такие как частота кадров и использование памяти.
Экспорт на настольные платформы (Windows, macOS, Linux)
Экспорт на настольные платформы в Godot довольно прост и требует выполнения нескольких шагов:
- Открытие окна экспорта: Перейдите в меню «Project» и выберите «Export». Это откроет окно, где вы сможете управлять всеми аспектами экспорта вашего проекта.
- Создание нового пресета экспорта: Нажмите кнопку «Add» и выберите нужную платформу (Windows, macOS или Linux). Пресеты позволяют вам сохранять настройки экспорта для каждой платформы отдельно, что упрощает процесс при необходимости повторного экспорта.
- Настройка пресета экспорта: Введите необходимые параметры, такие как имя файла, и выберите целевую директорию для экспорта. Также можно указать дополнительные параметры, такие как версия приложения и авторские права.
- Добавление иконок и других ресурсов: Убедитесь, что вы добавили иконки и другие необходимые ресурсы для вашего проекта. Это включает в себя не только иконки для запуска приложения, но и любые другие графические элементы, которые могут потребоваться для конкретной платформы.
- Экспорт проекта: Нажмите кнопку «Export Project» и дождитесь завершения процесса экспорта. В зависимости от размера вашего проекта и производительности вашего компьютера, этот процесс может занять некоторое время.
Пример экспорта на Windows
- Откройте окно экспорта и добавьте пресет для Windows.
- Убедитесь, что выбраны правильные параметры, такие как архитектура (32-bit или 64-bit). Это важно, так как разные версии Windows могут требовать разные архитектуры.
- Нажмите «Export Project» и выберите директорию для сохранения .exe файла. Убедитесь, что у вас достаточно места на диске для сохранения экспортированного файла.
Экспорт на мобильные платформы (Android, iOS)
Экспорт на мобильные платформы требует дополнительных настроек и установки SDK (Software Development Kit).
Экспорт на Android
- Установка Android SDK и NDK: Скачайте и установите Android SDK и NDK. Убедитесь, что пути к этим инструментам указаны в настройках Godot. Это можно сделать в разделе «Editor Settings» -> «Export» -> «Android».
- Создание пресета экспорта: В окне экспорта добавьте пресет для Android. Это позволит вам настроить все необходимые параметры для экспорта на эту платформу.
- Настройка ключей подписи: Для публикации на Google Play необходимо подписать APK файл. Создайте ключ подписи и укажите его в настройках экспорта. Это можно сделать с помощью команды keytool, которая входит в состав JDK.
- Настройка разрешений и других параметров: Убедитесь, что все необходимые разрешения указаны в настройках экспорта. Например, если ваше приложение использует интернет, необходимо указать разрешение на доступ к сети.
- Экспорт проекта: Нажмите «Export Project» и выберите директорию для сохранения APK файла. Убедитесь, что у вас достаточно места на диске для сохранения экспортированного файла.
Экспорт на iOS
- Установка Xcode: Для экспорта на iOS необходимо установить Xcode на вашем Mac. Xcode предоставляет все необходимые инструменты для разработки и экспорта приложений на iOS.
- Создание пресета экспорта: В окне экспорта добавьте пресет для iOS. Это позволит вам настроить все необходимые параметры для экспорта на эту платформу.
- Настройка профилей и сертификатов: Убедитесь, что у вас есть необходимые профили и сертификаты для подписи приложения. Это можно сделать через Apple Developer Portal.
- Настройка параметров экспорта: Укажите все необходимые параметры, такие как идентификатор приложения и целевая версия iOS. Также можно указать дополнительные параметры, такие как версия приложения и авторские права.
- Экспорт проекта: Нажмите «Export Project» и выберите директорию для сохранения Xcode проекта. Убедитесь, что у вас достаточно места на диске для сохранения экспортированного файла.
Экспорт на веб-платформы (HTML5)
Экспорт на веб-платформы позволяет запускать ваш проект в браузере, что делает его доступным для широкой аудитории.
- Создание пресета экспорта: В окне экспорта добавьте пресет для HTML5. Это позволит вам настроить все необходимые параметры для экспорта на эту платформу.
- Настройка параметров экспорта: Убедитесь, что все необходимые параметры указаны, такие как имя файла и целевая директория. Также можно указать дополнительные параметры, такие как версия приложения и авторские права.
- Оптимизация для веб: Убедитесь, что ваш проект оптимизирован для работы в браузере. Это может включать уменьшение размера текстур и использование форматов, поддерживаемых браузерами. Также стоит обратить внимание на производительность, так как веб-платформы могут иметь ограничения по ресурсам.
- Экспорт проекта: Нажмите «Export Project» и выберите директорию для сохранения HTML файлов. Убедитесь, что у вас достаточно места на диске для сохранения экспортированного файла.
Пример экспорта на HTML5
- Откройте окно экспорта и добавьте пресет для HTML5.
- Убедитесь, что выбраны правильные параметры, такие как имя файла и целевая директория. Это важно, так как разные браузеры могут иметь разные требования к файлам.
- Нажмите «Export Project» и выберите директорию для сохранения HTML файлов. Убедитесь, что у вас достаточно места на диске для сохранения экспортированного файла.
Экспорт проекта в Godot позволяет легко распространять ваши игры и приложения на различные платформы. Следуя этим шагам, вы сможете подготовить и экспортировать ваш проект на настольные, мобильные и веб-платформы. Удачи в разработке! 😉
Читайте также
When it comes to desktop gaming, Windows dominates the market. According to the Steam hardware survey, nearly 97% of users are on Windows. Linux takes second place with around 2% of users, with the majority using a Steam Deck. This market distribution highlights the importance of creating exports for both Windows and Linux to reach the widest possible audience.
If you’re interested in targeting the Steam Deck specifically, check out the tutorial on targeting the Steam Deck with Godot.
Note: This tutorial assumes you’re familiar with the basics of Godot. If you’re new to Godot or need a refresher, check out the Getting Started tutorial.
Getting Started
For this tutorial, you can either use your own project or download the sample project to follow along.
If you want to use the sample project, download the starter materials zip from the link at the top or bottom of this tutorial and extract it. Next, open Godot and import the starter project. The project is a small 2D shoot-em-up game called Aerixa.
Go ahead and run the project if you want to have a look at it.
What is Exporting?
In Godot, exporting a project is the process of packaging your project along with a binary that contains the Godot engine code. The binary is compiled differently for each target platform, allowing your project to run on systems that don’t have Godot installed.
Every supported platform has its own export template, which is a collection of files Godot uses to package and debug your exported project. They’re essential because they contain the Godot engine code compiled for each target platform, allowing your project to run on systems that don’t have Godot installed.
With the binaries in hand, you can then distribute your project on platforms like Steam, itch.io, the App Store and Google Play.
Getting the Export Templates
If this is the first time you’re exporting for the version of Godot you’re using, you’ll need to download and install the export templates.
You can check if you have the templates installed by selecting Editor ▸ Manage Export Templates in the top menu.
This will open the Export Template Manager, a small tool to manage your export templates.
At the top left, you can see the version of Godot you’re using; 4.3.stable in my case.
In case you don’t have the export templates installed yet, you’ll see a red text appear next the version as is the case in the screenshot above. To install the missing templates, click the Download and Install button at the top right.
Doing so will download the templates for the version of Godot you’re using and install them locally.
Once the download finishes, you can see where Godot installed your new export templates.
Note: If you have export templates installed in the Other Installed Versions section for a version of Godot you’re not planning on using anymore, click the trashcan icon next to the version name to delete them and recover some disk space.
With the templates installed, you can now export your project!
I recommend going through the all sections below even if you’re only interested in exporting for Windows as they contain general information about the export process that I’ll reference to later.
Adding an Export Preset
Exporting projects is straightforward, but understanding the details of the process helps you make informed decisions about your export settings.
To start off, open the Export window by selecting Project ▸ Export in the top menu.
The Export window will be almost empty at this point.
To add a Linux export, click the Add… button at the top and choose Linux.
This will add a new Linux entry in the Presets list and enables the options on the right side of the window.
Export Settings
Time to take a closer look at the various settings Godot presents you with for exports.
Shared Options
First up are the shared options at the top, this includes the Name and Export Path fields. These are the same for all platforms.
From top to bottom, the options are as follows:
- Name: A name for your export preset. This is useful as you can configure different presets for the same platform, so the different names make it easier to distinguish between them.
- Advanced Options: For some platforms like Android and iOS, extra options are available. Toggling this on will show options meant for power users.
- Runnable: If checked, this will enable one-click deploy for the export preset, enabling you to quickly deploy the preset via a single button click. The actual function of one-click deploy depends on the platform. For desktop platforms like Linux, macOS and Windows, it allows you to deploy exports over SSH once configured. For mobile platforms like Android and iOS, it allows you to install the export on your device or emulator. Finally, for web exports, it will start a local web server and host the exported project. For more information on one-click deploy, see Godot’s One-click deploy documentation.
- Export Path: The file path where the project will be exported to.
Options Tab
Next, take a look at the Options tab.
Again, from top to bottom, the options are as follows:
- Custom Template: Here you can set a path to custom export templates for both the Debug and Release exports. If you compiled your own export templates from the engine source code, you can set them here. This can be used to optimize your exports for size or speed by stripping out the 3D engine for example.
- Export Console Wrapper: When enabled, an extra executable will be included next to the exported project that will run your project in the console. This is useful for debugging and testing your project.
- Embed PCK: A PCK file is an archive file similar to a ZIP. It bundles the project’s assets like scripts, scenes and textures together in a single file. If enable this setting, the PCK file will be embedded in the exported project instead of being a separate file.
- Architecture: This sets the CPU architecture of the exported project. On desktop platforms, the most common CPU architecture is x86_64, which is the 64-bit version of x86. I recommend leaving this at the default value. The export templates that Godot provides only support the x86_32 and x86_64 architectures. If you need to export for a different architecture, you’ll need to build your own export template. You can find more info on that on the Building from source page.
- Texture Format: With these, you can choose how textures are stored. Both options here combine two texture formats into one. The S3TC and BPTC formats are primarily used for desktop platforms and consoles, while ETC2 and ASTC are used for mobile platforms, embedded devices and the web.
- SSH Remote Deploy: This option allows you to deploy your exported project over SSH. This can be useful to test your project on a remote machine.
For most projects, you can leave these at their default values, but I hope you’ll agree it’s useful to know what you can use these options for.
Time to take a look at the Resources tab.