/RetroPie-Godot-Game-Engine-Emulator

A scriptmodule to install a Godot "emulator" for RetroPie.

Primary LanguageShellMIT LicenseMIT

RetroPie Godot Game Engine "Emulator"

A scriptmodule to install a Godot "emulator" for RetroPie.

Thanks to @efornara (for creating FRT - A Godot "platform" targeting single board computers) you can now play* games made with Godot on the Raspberry Pi (and other single-board computers) using RetroPie.

*Games that (would) work on a Raspberry Pi must have been created with Godot version >= 3.1.x using GLES2 (or maybe Godot 2.x.x) and that they must not use any "fancy VFX", like particles and other CPU/GPU demanding stuff.

If you are running RetroPie on an x86 PC, the Godot "emulator" uses the Linux/X11-32bits export template instead of FRT, so most games should work fine.

There are plenty of games made with Godot, most of them hosted on https://itch.io/.

You can find Godot games using the following links:

NOTE:

When you download a game from https://itch.io/, you have to look for a .pck file. Those files will most likely be found on Linux downloads (maybe on Windows too).

Take a look at the compatibility list to check which games work. Everyone can contribute to the list.

Install the setup script

cd /home/pi/
git clone https://github.com/hiulit/RetroPie-Godot-Game-Engine-Emulator.git
cd RetroPie-Godot-Game-Engine-Emulator/
sudo chmod +x setup-godot-engine-scriptmodule.sh

Update the setup script

cd RetroPie-Godot-Game-Engine-Emulator/
git pull

Usage

./setup-godot-engine-scriptmodule.sh [OPTIONS]

If no options are passed, you will be prompted with a usage example:

USAGE: ./setup-godot-engine-scriptmodule.sh [OPTIONS]

Use '--help' to see all the options.

The script assumes that you are running it on a Raspberry Pi with the RetroPie-Setup folder being stored in /home/pi/RetroPie-Setup. If your setup differs, you can pass the path where your RetroPie-Setup folder is stored as a parameter, like this:

./setup-godot-engine-scriptmodule.sh [OPTION] "/path/to/your/RetroPie-Setup"

Options

  • --help: Print the help message and exit.
  • --install: Install the scriptmodule.
  • --uninstall: Uninstall the scriptmodule.
  • --update: Update the scriptmodule.
  • --version: Show script version.

Examples

--help

Print the help message and exit.

Example

./setup-godot-engine-scriptmodule.sh --help

--install

Install the scriptmodule.

Example

./setup-godot-engine-scriptmodule.sh --install

--uninstall

Uninstall the scriptmodule.

Example

./setup-godot-engine-scriptmodule.sh --uninstall

--update

Update the scriptmodule.

Example

./setup-godot-engine-scriptmodule.sh --update

--version

Show script version.

Example

./setup-godot-engine-scriptmodule.sh --version

Install the Godot "emulator" from RetroPie-Setup

Once you've successfully installed the scriptmodule, run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Manage packages
  • Manage optional packages
  • godot-engine
  • Install from source

A new godot-engine folder will be created in /home/pi/RetroPie/roms/, where you can put your games using the .pck and .zip extensions.

For example, if you download a game from https://itch.io/, the downloaded .zip usually contains 2 files: the executable and the game. The later is, most of the times, a .pck file. That's the one we want. Just copy it to /home/pi/RetroPie/roms/godot-engine.

The script installs different versions of the "emulator" for maximum compatibility:

  • 2.1.6
  • 3.0.6
  • 3.1.2
  • 3.2.3

If the game you are trying to play doesn't work, try changing the "emulator" in the runcommand.

If you are using an x86 PC, the "emulators" used are Godot's export templates downloaded from https://godotengine.org/download/.

  • godot-engine-x.x.x-x86

For the Raspberry Pi, the script will auto-detect if you are using a 0/1, a 2/3 or a 4 version and it will install the proper FRT "emulators".

  • godot-engine-x.x.x-frt-rpi0-1
  • godot-engine-x.x.x-frt-rpi2-3
  • godot-engine-x.x.x-frt-rpi4

In the case of the Raspberry Pi 4, the script will install additional Godot "emulators", starting at v3.1.2, specifically compiled for it.

  • godot-engine-x.x.x-rpi4

For any arm64 single-board computer, the script will install the proper FRT "emulators".

  • godot-engine-x.x.x-frt-arm64

In case none of the "emulators" work... Sorry :(

Well... there's one last thing you could try. See the section below.

Force Godot to use the GLES2 video render

If you get this error when trying to play a game:

Your video card driver does not support any of the supported OpenGL versions. Please update your drivers or if you have a very old or integrated GPU upgrade it.

You can force the Godot "emulator" to use the GLES2 video driver.

Run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Configuration/tools
  • godot-engine

Select Force GLES2 video driver.

Configuration dialog

Select Yes.

Force GLES2 video driver dialog

If you want to to reverse that action, follow the same steps and select No.

Uninstall the Godot "emulator" from RetroPie-Setup

Run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Manage packages
  • Manage optional packages
  • godot-engine
  • Remove

Update the Godot "emulator" from RetroPie-Setup

Run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Manage packages
  • Manage optional packages
  • godot-engine
  • Update from source

Using a GPIO/Virtual keyboard

Warning! When using a GPIO/Virtual keyboard, the actual keyboard won't work anymore. But you can always remove the GPIO/Virtual keyboard (see below).

As of v1.2.0, when using the FRT emulator, you can use a GPIO/Virtual keyboard, such as GPIOnext or Adafruit's Retrogame.

Add a GPIO/Virtual keyboard

Run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Configuration/tools
  • godot-engine

Select Use a GPIO/Virtual keyboard.

Configuration dialog

Select Yes.

GPIO/Virtual keyboard dialog

You will be prompted with a menu showing all the results from the command cat /proc/bus/input/devices. Select the GPIO/Virtual keyboard that you want.

Remove the GPIO/Virtual keyboard

If you don't want to use the GPIO/Virtual keyboard anymore, run:

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

and then go to:

  • Configuration/tools
  • godot-engine

Select Use a GPIO/Virtual keyboard.

Configuration dialog

Select No.

GPIO/Virtual keyboard dialog

How to create a new Godot system for an EmulationStation theme

As there is no way to create a script to automate this, because themes don't have the same structure, the best way is to manually create a new system in your preferred theme.

  • Download the Godot system.svg.
  • Download the Godot controller.svg.
  • Copy any system folder in your theme (e.g. /etc/emulationstation/themes/[THEME]/nes).
  • Rename it as godot-engine.
  • Move the Godot system.svg and controller.svg to the godot-engine/art folder.

NOTE:

The folder structure in the theme you are using might differ. Take a look at how this particular theme works to create the godot-engine folder accordingly. You might need to delete extra icons that are not needed.

Premade Godot systems

I've created a couple of ready-to-use Godot systems.

One for the default EmulationStation theme that comes in RetroPie, Carbon theme, and the other, my personal favourite theme, for the Pixel theme.

Copy the theme/[THEME]/godot-engine folder from this repository to /etc/emulationstation/themes/[THEME].

Carbon theme

Godot system for EmulationStation's Carbon theme

Pixel theme

Godot system for EmulationStation's Pixel theme

Changelog

See CHANGELOG.

Author

Me 😛 @hiulit.

Credits

Thanks to:

LICENSE