Sites


Initiation à Godot

Exporting games

Exporting games

One of the strengths of Godot is that your game can be exported to run out-of-the-box on a wide variety of platforms, without involving any need for cross-compilation when exporting. This is achieved via binary export templates, which are actually the complete engine compiled for a given platform without the editing tools.

Retrieving export templates

When exporting a game with Godot, you must make sure to use export templates that correspond to the version of the editor you are currently using. For stable releases, export templates for desktop and mobile platforms can be downloaded directly for the engine's website, godotengine.org. Godot can also export to some consoles, but as those require specific licensing from the console vendors, you should get in touch with Godot developers for more information.

Using the official templates, you can export almost out-of-the-box to the following platforms:

  • Android (arm and x86), requires setting up an android SDK as described in a later section
  • HTML5
  • Linux X11
  • Mac OSX
  • Windows Desktop (Vista or newer)

Godot supports other platforms such as iOS or various consoles. Please refer to the official wiki for more details on those platforms.

If you are using a non-stable version of Godot for which no official templates are provided, or if you want to build the templates yourself, you can do it relatively easily by compiling the source code for each target platform. The process of setting up a cross-compilation build environment will not be described here, but there is detailed information on the official wiki. Right now, you simply need to keep in mind that you can develop your game without thinking too much about exports at first, there will always be a solution to export your game to your favourite platforms.

Installing export templates

If you downloaded the official template package from the website (extension .tpz, but it's actually a ZIP archive), you can install it directly from within the Godot editor. Just click on Settings and then Install Export Templates, and select the template package using the file browser.

Alternatively, you can extract the archive and install the templates manually by copying them to Godot's template directory:

  • Linux and Mac OSX: ~/.godot/templates
  • Windows: %APPDATA%\Godot\templates

Packaging the game

The process for exporting a game to a given platform is relatively straight-forward: click on "Export" in the Godot editor, then select your platform, and if it's configured properly you should be able to actually export the game to a given location. A common setting for all platforms is the able to define whether the binary should be optimised (release) or have debug symbols. The following section will give additional details about configuring each platform.

Linux X11 and Windows Desktop

For Linux and Windows, the configuration is pretty straight-forward: define if you want to export a 32-bit or 64-bit binary and the "pack mode". The pack mode refers to the distribution format of your game:

  • Single executable: Creates a single binary, i.e. the game's resources are embedded in the binary; it generates a bigger binary, but you only have one file to distribute.
  • Executable + Pack (.pck): The game's resources are bundled in an archive named data.pck; the binary is simply a copy of the export template, and will run any game it finds in a data.pck archive in its folder or parent folder. You then have to distribute two files, but you can easily update your game by simply exporting a new data.pck to replace a previous version, without touching the binary.
  • Copy: FIXME: How is it different from Executable + Pack?
  • Bundles (optical): This option is similar to Executable + Pack, but will bundle all dependencies of each scene inside the scene, thus making it faster on optical drives by avoiding the need to seek for dependencies. The resulting data.pck might be bigger due to the duplication of resources.

Mac OSX

As for the other desktop platforms, you can define whether the binary should be 32-bit or 64-bit. There is however no pack mode for Mac OSX, the resulting package will always be a ZIP archive containing a usual Mac OSX .app folder. You can also define some metadata such as the game name, icon and your developer signature.

Android

Exporting to Android requires some additional configuration, as you will be the exporter will tell you if the configuration is not complete. You will need to install the ADB tool from the Android SDK, a jarsigner from a JDK (OpenJDK 6 and OpenJDK 8 work fine, OpenJDK 7 has been reported to be problematic) and a debug keystore. If you don't have a debug keystore and need to generate one, you will need keytool from the Android SDK, and run:

keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999

Once you have the necessary tools installed and the debug keystore generated, you have to tell Godot where to find them in the Android section of the editor settings (click on "Settings", then "Editor Settings").

Once the export toolchain is configured, you can then export your game to an APK file. There are many parameters available from the export wizard, such as the export architecture (arm, x86 or both), screen settings, application permissions, etc..

HTML5 (asm.js)

For the HTML5 platform (based on asm.js), you can select the amount of memory that the game should be able to claim. There is also an "Enable Run" option that lets you try the HTML5 version directly from within the editor.

Launching on mobile

Test on my mobile

Test for any device

Il y a une erreur de communication avec le serveur Booktype. Nous ne savons pas actuellement où est le problème.

Vous devriez rafraîchir la page.