_      __            __                  _ 
      (_)__  / /_________  / /________  _______(_)
     / / _ \/ __/ ___/ _ \/ __/ ___/ / / / ___/ / 
    / /  __/ /_(__  )  __/ /_/ /  / /_/ / /  / /  
 __/ /\___/\__/____/\___/\__/_/   \__,_/_/  /_/   
/___/

[Home] - [Blog] - [About]




Box86 - Momodora II & Unreal Tournament 2004 on the Raspberry Pi 4

(Originally posted to Cohost on Thu, Sep 28, 2023, 11:59 PM)

Alright, so I'm way too excited not to share this, and I hope this ramble will help anyone else out who has trouble setting this up. If you wanna see the cool stuff, scroll down.

I have a Raspberry Pi 4 (2GB) that I bought on Christmas 2021 to benchmark its performance, but to also use as a low-power PC.

I did my fair share of emulating on it, but stuck to standalone emulators on desktop-oriented distros like Manjaro, Void, and (recently) Raspbian. (PPSSPP might be my favorite emulator as of late. So many good games on such a potato-friendly emulator...)

But yeah.

If you haven't heard of them yet, Box86 and Box64 are really cool userspace emulators, meaning that as opposed to emulating a full system, they emulate the specific program you ask of it to run. A similar one is qemu-user, but what makes Box86/64 special is that it tries to make use of native system libraries whenever possible (instead of emulating them) for a speed boost.

(The most creative way I saw someone take advantage of this was to run Dwarf Fortress on Android. In fact, some people made easy, ready-to-go solutions for Android, like Box64Droid, but I prefer the flexibility of setting it up myself since these are focused on 64-bit Android devices.)

As you'd expect, you can combine this with a WINE binary to run x86/x64 Windows applications. The first one I usually test is Notepad++ (and god, the idea of populating my Pi 4 with vintage Windows software is making me happy), but you can run full-on video games, and there's a Pi OS dedicated to this (TwisterOS).

I spent the past couple hours getting Momodora II set up first, since it was a free, relatively lightweight indie game. Since I didn't want to clutter my main Raspbian system, I stuck to Flatpaks for software packages, and used box86 under a Distrobox environment created via distrobox-create debian --image debian:stable --home /home/ruri/Distrobox/debian.

Aside from following the regular box86 tutorial and the WINE one, I took a shitton of notes because I knew my particular setup wasn't going to be easy, so if you attempt this setup as opposed to going the easy (and honestly hassle-free) route of installing Twister, the commands I had to use in my Distrobox environment were:

I haven't gotten started on Box64 yet, but I imagine it'd require the 64-bit versions of these packages (so I wouldn't need the --add-architecture step).

Momodora II performance is... passable, but due to the game's pacing being tied to its framerate, it's rather cheap and uncomfortable to play when it's running around ~30fps as opposed to its intended 60.

Unreal Tournament 2004 I installed through my GOG copy (it failed at the end with a "Out of Global Vars range" error, but it still started just fine). I changed the terminal's current directory to the UT2004 "system" folder, and started the game with: GALLIUM_HUD=cpu+fps MESA_GL_VERSION_OVERRIDE=3.2 box86 ~/wine/bin/wine UT2004.exe (GALLIUM_HUD is optional and shows the performance, MESA_GL_VERSION_OVERRIDE may not be needed but I have on just in case some games don't start with the Pi's last GL version)

Performance was mediocre, and CPU was getting hammered, but that was just using the Direct3D renderer.

A screenshot of Face Classic on Unreal Tournament 2004. The game is running at 8FPS, and the CPU usage is at 85%.

I edited System/UT2004.ini (located in the UT2004 install folder, which is in .wine/drive_c/GOG Games/Unreal Tournament 2004/System), commenting the Direct3D line and uncommenting the OpenGL line:

[Engine.Engine]
;RenderDevice=D3DDrv.D3DRenderDevice
;RenderDevice=D3D9Drv.D3D9RenderDevice
;RenderDevice=Engine.NullRenderDevice
RenderDevice=OpenGLDrv.OpenGLRenderDevice
;RenderDevice=PixoDrv.PixoRenderDevice

And the game's framerate is a modest improvement, but only slightly (the last screenshot was just an unlucky shot):

A screenshot of Face Classic on Unreal Tournament 2004. The game is running at ~17FPS, and the CPU usage is much less than before, at about ~35%.

Though it depends on the map, with Face Classic (pictured) being somewhere in-between.

I've seen videos of people running UT2004 on the Pi 4, at a much higher framerate than I am, such as this.

I assume it's because there's been a native Linux port of UT2004, whereas I'm running it through WINE (which likely brings extra overhead). I'll investigate this soon!

Some more things I'm considering doing with my Pi is:

For now, I hope you've learned something cool reading this post! I'll continue to have fun trying out more emulator games in the meantime.

(Emulators are so cool... being able to run old programs and old operating systems... and even old games! Emulators have so much heart and care put into them, and there's such a huge library of semi-modern games to play on such low-spec devices. I love using old emulators on old hardware, too! Like my 2010 Android phone... I should totally blog about that!)