Skip to content

workstation setup

Poobslag edited this page Oct 3, 2022 · 15 revisions

Opening and Running the Turbo Fat project for the first time

If you want to tinker with the project locally, you just need to run Godot and tell it where the game files are. Here is what you need to get started:

  1. Install Godot. You'll need the latest stable version of the Godot Engine, available either through their website or through Steam.

  2. Download the Turbo Fat source code. You can download a Zip file or clone the repo through Git or SVN: https://github.com/Poobslag/turbofat.git

  3. Launch Godot.

  4. Add the Turbo Fat project to the Godot Project Manager. In Godot's Project Manager, click Import and locate Turbo Fat's project/project.godot file, or .zip file.

  5. Open the Turbo Fat project. Select the Turbo Fat project and click Edit.

  6. The project should take a few seconds to open. To run the game, click the play button in the upper right corner.

image

You're done! If you want to do something more complex like run unit tests or put the game on your phone, then the rest of these instructions are for you.

Configuring your system to build and run Turbo Fat

  1. (Optional) If you want to run the unit tests, copy the Gut config templates:
    cp project/gut_editor_config.json.template project/.gut_editor_config.json
    

Configuring your system to export

Generating export presets

The export_presets.cfg file contains keystore passwords and cannot be kept in version control. Run the generate_export_presets.sh shell script to generate the export_presets.cfg file. If you need to share changes to your export_presets.cfg file with other developers, modify the export_presets.cfg.template file.

Exporting to Windows

  1. Install Gnu On Windows. Turbo Fat's release scripts depend on the unix zip command, which must be available on your path. Other 'unix on windows' solutions such as Cygwin should work fine as well.

  2. Update your Rcedit path:

    • In the Godot editor, navigate to Editor -> Editor Settings.
    • In the Editor Settings window, navigate to Export -> Windows and set the Rcedit path.
      • Windows: C:/Program Files/rcedit/rcedit-x64.exe

Exporting to Android

Installation

The steps in the Godot documentation for Exporting for Android indicate two options: installing the Android SDK using Android Studio version 4.1 or later, or using the command line tools.

The Android Studio instructions are out-of-date and difficult (or possibly impossible) to follow. They indicate non-existent menus such as Tools > SDK Manager, and non-selectable versions such as Android SDK Build-Tools version 30.0.3. It is possible there is a way to repair Android Studio to make these menu items and versions available, but it is easier to just use the command line tools.

Install OpenJDK 11

Deceptively, Godot's Android SDK installation instructions are listed before the OpenJDK 11 instructions. However, Android Studio's command line tools error out if you do not have a JDK installed. You must actually install OpenJDK 11 before installing the Android SDK.

Download and install the Android SDK

The Android SDK installation instructions incorrectly indicate indicate To open the SDK Manager from Android Studio, click Tools > SDK Manager. These instructions are incorrect. The SDK can instead be launched from the Android Studio launcher under Configure > SDK Manager.

Create a debug keystore and release keystore

Exporting to android requires the creation of certificates and keystore files which are stored in a /secrets folder. This folder contains keystores and passwords and cannot be kept in version control.

  1. Generate a debug keystore:
    keytool -genkeypair \
     -keystore secrets/debug.keystore -keyalg RSA -validity 9999 \
     -alias androiddebugkey -keypass android \
     -storepass android \
     -dname "CN=Android Debug,O=Android,C=US"
    
  2. Generate a release keystore:
    keytool -genkey -v \
     -keystore release.keystore -keyalg RSA -keysize 2048 -validity 10000 \
     -alias poobslag
    
    For the keystore properties, I used CN=Aaron Pieper, OU=Poobslag Software, O=Poobslag Software, L=Clifton, ST=VA, C=US

Setting it up in Godot

Exporting to Android requires changing some settings in the Godot editor.

  1. Update your ADB path:

    • In the Godot editor, navigate to Editor -> Editor Settings.
    • In the Editor Settings window, navigate to Export -> Android and set the Adb path.
      • Windows: c:/Users/<username>/AppData/Local/Android/Sdk/platform-tools/adb.exe
  2. Update your OpenJDK Jarsigner path:

    • In the Godot editor, navigate to Editor -> Editor Settings.
    • In the Editor Settings window, navigate to Export -> Android and set the Jarsigner path.
      • Windows: c:/program files/Eclipse Adoptium/jdk-11.0.13.8-hotspot/bin/jarsigner.exe
  3. Update your Android SDK path:

  • In the Godot editor, navigate to Editor -> Editor Settings.
  • In the Editor Settings window, navigate to Export -> Android and set the Android Sdk path.
    • Windows: c:/Users/<username>/AppData/Local/Android/Sdk

Troubleshooting

The .apk won't install

Additional diagnostic information can be obtained by running adb directly:

C:/Users/Aaron/Appdata/Local/Android/Sdk/platform-tools/adb.exe install export/android/turbofat-android-v0.0618.apk

Make sure to monitor Godot's console output when generating the .apk. Important warning and error messages are logged to the console which are not relayed to the UI.

'apksigner' returned with error #1

No additional diagnostic information is available.

Uninstall OpenJDK 11 and Android Studio (if it is installed). Delete all files from %USER_HOME%\appdata\Local\Android\Sdk. Repeat the installation instructions listed above.

This removes older versions of Android SDK packages. The apksigner can fail if you have older build-tools versions installed.

Clone this wiki locally