Raspberry Pi 4 as Perfect Indie Console

Game Development Jul 07, 2019

Since the first Raspberry Pi I dreamed of making indie arcade console from it. But also as a Godot enthusiast I wanted to use it. Running 2D games was kinda working but it was more like a hack (frt).

Here comes the latest Pi. Forth iteration hardware was bumped to the point that it is a valid personal computer. It also runs full Godot Engine editor. I'm writing this post on it as a best proof.

Desktop of Raspbian on Pi 4

But for developing a game I have a dedicated PC with RTX card. What the Pi can become is a super cheap indie console. Here's the important facts:

  • One software stack: Raspbian OS is wildly accepted as default
  • One hardware stack: Raspberry Pi Foundation will support Pi 4 for next 5 years
  • It have a ton of accessories already
  • It has decent CPU and GPU power
  • Easy to replace or scale up (next day delivery in Poland)
  • Super easy to debug different stacks/settings by swapping SD cards
  • Godot Engine 3.2-dev runs!

GodotEngine

Screenshot from Raspberry Pi 4 game

It's the first time I was able to compile and run official Godot Engine. And the editor runs good enough for a small game or local tweaking.

Godot Engine on ARM

Running Godot projects was doable using FRT port. But it was mostly for 2D side. Now thanks to new graphics chip Pi is able to run 3D projects as well. And with zero modifications to the Godot sources.

With right settings and few sacrifices I was able to get 30fps gameplay. At the time only GLES2 worked.

Compiling

Use Raspbian with desktop. Then add those packages:

sudo apt install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev     libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libfreetype6-dev libssl-dev libudev-dev     libxi-dev libxrandr-dev yasm
sudo apt install clang

Obtain the sources:

git clone https://github.com/godotengine/godot
cd godot

Lastly the longest step. Compiling. It will take more than one hour. Just wait. This is only for Pi4 CPU:

 scons \
    platform=x11 \
    target=release_debug \
    tools=yes \
    use_llvm=yes \
    CCFLAGS="-mtune=cortex-a72 -mcpu=cortex-a72 -mfloat-abi=hard -mfpu=neon-fp-armv8" -j4

Lastly "install" the software:

sudo cp bin/godot.x11.opt.tools.32.llvm /usr/bin/godot

Overclocking Pi 4

Make sure you have those settings in /boot/config.txt:

[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
over_voltage=4
arm_freq=1750
gpu_freq=600

[all]
gpu_mem=512
hdmi_enable_4k=1

Good cooling is required even for stock settings.

Floppy Drive

USB FDD

Here's a video with floppy in action:

I use external FDD 3.5 drive. My resent projects sizes are between 100-600kb. It's half the floppy! That's why I started to use them as a cartridges. Also 1440kb limit forces me to think creatively in terms of optimization and size.

Blue/Red of floppies

There is nothing that can beat the sound of loading floppy. Also those 3.5" are so iconic that even the young generation knows them. For me it's the medium that I grow up with. Everything else was new and different. And mostly silent.

Indie Console

Developer mode

My initial impressions of the latest Pi are very positive. I think it will create a new branch in the history of personal computers. It will be the same home hacking computer as Acorn was with first ARM processor.

With all the accessories and screens its very easy to make your own computer or console. Community is huge. It's easy to find answers and useful projects. The only difference is now we have a horsepower to play with!

Seeed 10.1 inch 1200x1920 HDMI IPS LCD Display

My implementation so far include 10.1" IPS screen, external USB FDD floppy drive and two xbox 360 controllers.

Project

237kB of game

Test your Pi or run the project on any PC.
Just download sources and run godot inside the folder.

Look at my twitter or mastodon from time to time to see if any new Pi-optimized projects are developed.