Look... I don't know why you'd want to do this - maybe you want to make an interactive coffee table that only plays DF. Maybe you're committed to having bad FPS. Either way, here's how to play DF on a Raspberry Pi (or presumably any ARM SBC)
I've been tossing this problem around in my head and in action for a while now and messaged methylatedspirit about the issue as well - there are a couple methods to tackle the problem, but first, let's discuss "the problem".
Raspberry Pi are built on ARM architecture - meaning they don't run most programs natively (most programs are x64 or x86 architecture [likely your PC is x86_64, for example]). DF isn't released for ARM architecture - as it's relatively a niche market for home computers and the great Toad's time is limited. But you're not completely out of luck.
If you're going for some sort of record for "playing DF on the most devices possible", Eniteris wrote a guide to play DF on a phone
on the DF Reddit. This is an excellent guide and far better than what follows.
Solution 1: The Bad One.WINE will run the Windows version of DF on a Raspberry Pi. WINE isn't too hard to set up on the Debian-based OSes (and comes included in most of them like Raspbian and Twister), however it isn't available on every OS for the Pi. WINE (and really, whatever software is being used to emulate the architecture, such as QEMU) takes up a bit of processing power and even on a Raspberry Pi 4 - the impact will be obvious.
Not recommended, but if you have a fresh OS install, it might just work right away. It works just like Windows - run the Windows version of the game after unzipping it somewhere.
Solution 2: The Easy OneCut out the middle-man and just use the architecture emulator.
Before anything, chuck an ol'
sudo apt update && sudo apt upgrade
in the terminal and then get to work with the following:
Box86 is a tool which mimics the architecture of x86 devices - it is also very low-impact and probably the best bet for running DF. QEMU and a few others could potentially provide the same service, but Box86 seems to be the best option and easiest to set up. If you know more about QEMU, let me know - and I'll update how to run DF through it (no matter how convoluted).
Box86 only runs x86 architecture (that's 32-bit) So, run over to the
bay12games page and download the 32-bit version of DF. Unzip and double-check the libraries:
$ sudo apt install libsdl1.2debian libsdl-image1.2 libsdl-ttf2.0-0 libgtk2.0-0 libopenal1 libsndfile1 libncursesw5
My test last night returned mostly "already up to date" on these - so it may not be necessary at all.
-=-=-=-
Solution 2-a: TwisterOSIf you don't care much about the OS and just really want to play DF like...within 30 minutes:
TwisterOS comes with Box86 ready and loaded. Navigate to the df_linux folder (probably
$ cd ~/Downloads/df_linux) in the terminal and just run
./df and you're off to the races! It certainly works. It's slow, but it runs and is playable, if you have the patience.
-=-=-=-
Solution 2-b: Pi-AppsIf you're already on 32-bit Debian (Ubuntu or Raspbian being the most common choices), you can install Pi-Apps to grab Box86 and keep it up to date. methylatedspirit explains how:
Started with base Raspbian OS, installed Pi-Apps on it. To save you time, here's the command you need:
wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash
Went through its menus to install Box86. That'll get you the weekly builds of Box86, which should be recent enough. Thankfully, DF is available as an x86 Linux binary, so just download that. Run these to fix the exec permissions:
chmod +x df_linux/df
chmod +x df_linux/libs/Dwarf_Fortress
cd into the df_linux directory, run the ./df script to run DF. If all goes well, it'll work first try.
Note: methylatedspirit says this might depreciate in the next few years - check their post below for more info, if you use this method.
-=-=-=-
Solution 2-c: Synaptic Package ManagerPresumably, you have a visual package manager install - just go there and search for Box86. Install, then follow the same instructions as above.
[psst, I need to double-check if it's there or not...This could be total bullshit, it's not on my laptop's graphical package manager but it's also not an ARM device, so...]
Solution 3: The More Options OneAny 32-bit, Debian based OS should be able to do this, and presumably a 64-bit OS (which RPi does also support, perhaps with Box64).
Grab Box86 through your package manager (apt, most likely, if you're on Debian).
sudo apt install box86I have no clue if this will work with a 64-bit debian-based OS on the Pi (are there any?) If not, you may want to use Box64 and run the 64-bit version of DF. All other things should be equal.
Unzip, update libraries, navigate and
./df Additional, possibly useful informationHere's a
github specific issue on box64. Here's
the Box86 github and
the Box64 one.
The necessary libraries for DF on Arch can be picked up with:
$ pamac install gcc-libs glew glib2 glu gtk2 gtk3 libsndfile openal sdl_image sdl_ttf
Or will be picked up and fixed themselves if you can build it from AUR (I don't know how to do this, but in theory, it should work.)
I haven't managed to get DF to run on Manjaro on a Pi, but
rna's guide from the manjaro forums suggests it is possible (but this thing is really poorly written...)
Avoid the DF package from the Debian repos - it is out of date (47.04 last I checked) and also makes it very hard to change init and raws.
So! Good luck, intrepid adventurer, and enjoy a very slow DF experience. But hey - $40 bucks is pretty cheap for a computer that can run DF.
I'm no expert on all this - just been messing around with it for a while and trying to get DF to run on something that isn't Debian. Any advice below is appreciated. Mostly - this is just a thread for anyone who googles "df on raspberry pi" or searches the forums for an answer.