workstation setup - Poobslag/turbofat GitHub Wiki

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, put the game on your phone, or upload the game to steam, 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

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

You can download Eclipse Temurin, the open source Java SE build based upon OpenJDK from adoptium.net.

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. You will be prompted to create a new password. Make this a long, complex password. A malicious actor with the password could sign unauthorized and modified versions of Turbo Fat.

  3. Create a secrets/android.properties file:

    ANDROID_KEYSTORE_RELEASE_PASSWORD=<keystore-password>

Setting it up in Godot

Exporting to Android requires setting the Android SDK path in the Godot editor.

  • 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

Exporting to Steam

If you want to upload builds to Steam, you'll need to install the GodotSteam pre-compile, install the Steamworks SDK, and configure the SteamPipeGUI.

  1. Download the latest Steamworks SDK from steamgames.com
  2. Extract the Steamworks SDK into a suitable path (e.g C:\workspace\steam\steamworks-sdk\)
  3. Extract the Steamworks SDK (<sdk-path>\tools\SteamPipeGUI.zip), it can stay in the same folder (...\tools\SteamPipeGui)
  4. Copy the steam_api64.dll into the turbofat/project/export/windows-steam folder.
  5. Copy the libsteam_api.so into the turbofat/project/export/linux-x11-steam folder.

Installing the GodotSteam pre-compile

  1. At the GodotSteam homepage, locate the Godot 3 Precompiled Editor and Templates.
  2. Extract the GodotSteam templates into a suitable path (e.g C:\workspace\steam\godotsteam-g36-s160-gs327-templates)
  3. Create a secrets/steam.properties file:
    GODOTSTEAM_LINUX_DEBUG_TEMPLATE=<godot-steam-templates-path>/godotsteam.353.debug.template.linux.64
    GODOTSTEAM_LINUX_TEMPLATE=<godot-steam-templates-path>/godotsteam.353.template.linux.64
    GODOTSTEAM_WIN_DEBUG_TEMPLATE=<godot-steam-templates-path>/godotsteam.353.debug.template.windows.64.exe
    GODOTSTEAM_WIN_TEMPLATE=<godot-steam-templates-path>/godotsteam.353.template.windows.64.exe
  4. Extract the GodotSteam executable into a suitable path (e.g C:\program files\Godot\godotsteam-36). Create a shortcut to the executable. You will use this instead of the standard Godot executable.

If the GodotSteam plugin is configured properly, you should see a Steam toaster popup when the game starts, and you should be able to access your community with <Shift + Tab>

Configuring the Steamworks SDK

The files to upload to Steam should be arranged in the following subfolders. The directory names don't matter, but the filenames should not have a version number. Otherwise with every new release, we will need to reconfigure Steam with the new executable filename, and Steam will force users to download the files from scratch over and over instead of just the parts that changed.

<sdk-path>/tools/ContentBuilder/content/turbofat-linux
<sdk-path>/tools/ContentBuilder/content/turbofat-linux/libsteam_api.so
<sdk-path>/tools/ContentBuilder/content/turbofat-linux/turbofat-linux.pck
<sdk-path>/tools/ContentBuilder/content/turbofat-linux/turbofat-linux.x86_64
<sdk-path>/tools/ContentBuilder/content/turbofat-win
<sdk-path>/tools/ContentBuilder/content/turbofat-win/steam_api64.dll
<sdk-path>/tools/ContentBuilder/content/turbofat-win/turbofat.exe
<sdk-path>/tools/ContentBuilder/content/turbofat-win/turbofat.pck

Next, run and configure the SteamPipeGUI with the appropriate IDs and paths.

  1. Run the SteamPipeGUI exe (<sdk-path>\tools\SteamPipeGui\SteamPipeGUI.exe)
  2. In the SteamPipeGUI, set the SDK ContentBuilder path to the ContentBuilder path in the SDK you are currently targeting. (<sdk-path>\tools\ContentBuilder)
  3. Set the username and password to an account that has access to your Steamworks publisher account.
  4. Enter the App ID for your game (2213410)
  5. Click Add Depot for each depot you want to upload
  6. Set the correct Depot IDs and the paths to each Depot (<sdk-path>\tools\ContentBuilder\content\turbofat-win)
  7. If this is the first time doing this, click "Generate VDFs"

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.

class_name not recognized throughout the project

Every three years or so, Godot throws a massive temper tantrum and ignores all class_name declarations in the project, even when opening older tagged versions of the project. See #1989

I'm unsure how I fixed this, but I tried the following steps:

  • Purge the /project/.import folder and re-open the project
  • Disabled and re-enabled the Gut plugin
  • Opened a problematic .gd file, change its class name, save, and change its class name, and save again. Repeat 5-10 times for other .gd files as well

Eventually Godot just snapped out of it. Good luck!

Cannot test on Android

To test on Android, your phone must have 'USB Debugging' enabled.

  • Open Settings on your Android device.
  • Navigate to About Phone (usually at the bottom of the settings menu).
  • Tap Software Information.
  • Find the Build Number entry and tap it seven times quickly.
  • You will see a prompt saying "You are now a developer!" or asking for your device PIN/password to confirm.
⚠️ **GitHub.com Fallback** ⚠️