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.
Distributing a game project on PC with Godot is rather easy. Just drop the godot.exe (or godot) binary together in the same place as the engine.cfg file, zip it and you are done. This can be taken advantage of to make custom installers.
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 just find it inelegant, etc.
Another reason is that, for distribution, the developer might prefer a specially compiled binary, which is smaller in size, more optimized and does not include tools inside (like the editor, debugger, etc.).
Finally, Godot has a simple but efficient system for creating DLCs as extra package files.
The same scenario in mobile is a little worse. To distribute a project in 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 PVRCT (iOS) or ETC (Android).
Export from Command Line¶
In production it is useful to automate builds, and Godot supports this
--export-debug command line parameters.
Exporting from command line still requires an export template to define
the export parameters. A basic invocation of the export would be
godot --export "Windows Desktop" some_name
Which, assuming there is a preset called “Windows Desktop” and the
template can be found, will export to
some_name.exe. The output
path is relative to the project path or absolute. It does not respect
the directory the command was invoked from.
You can also configure it to export just the .pck or .zip file (allowing a single export to be used with multiple Godot executables). This takes place if:
- The export preset is not marked as runnable
- The target name ends with .pck or with .zip
It is often useful to combine the
--export flag with the
flag, and to create a dedicated export template for automated export:
godot --path path/to/project --export "pck" game_name.pck