Klaus on Tilde Town

Making OpenArena work again on Ubuntu 20.04 and Linux Mint 20

Although I don't consider myself by any means a true "gamer," I know how to appreciate some older classics, especially if they are also Free Software. Case in point, my Peertube Channel is mostly gaming footage, which includes one of my all-time favorites: OpenArena.

A fast-paced 3D first-person shooter based on the Quake 3 engine, there's plenty of fun to be had in playing OpenArena, even in machines with modest specs (I've played it successfully even in my 2006 machine). Single player has both campaign (think a StreetFighter progressive gameplay but shooting) and bots, and you can join a server to play against other people for a bigger challenge.

And out of such goodness, I was surprised to find out recently that my install of it on Linux Mint would fail to launch for some reason. It was silent, no flashing of a black screen or anything, so I opened it from the terminal just to check it out. Quite a few error messages were spewed, but the more pressing one was one that went like this:

(...)
Loading vm file vm/ui.qvm...
File "vm/ui.qvm" found in "/usr/lib/openarena/baseoa/pak6-patch088.pk3"
...which has vmMagic VM_MAGIC_USE_NATIVE.
... trying pak6-patch088/ui
Loading DLL file /usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so instead.
Loading DLL file: /usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so
Sys_LoadGameDll(/usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so) failed:
"Failed loading /usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so: /usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so: undefined symbol: __atan2_finite"
Failed to load DLL /usr/lib/openarena/baseoa/pak6-patch088/uix86_64.so.
----- Client Shutdown (Client fatal crashed: VM_Create on UI failed) -----
RE_Shutdown( 1 )
------- FBO_Shutdown -------
------- R_ShutdownVaos -------
------- GLSL_ShutdownGPUShaders -------
Hunk_Clear: reset the hunk ok
OpenAL capture device closed.
-----------------------
VM_Create on UI failed

Ok, not so bad, it's not an issue with the drivers or 3D renderers in this machine (which is quite weak on the GPU). But what is up with these libraries failing to load? They are the very ones that the package manager shipped!

After trying some things like "safe mode" in video and others, I decided to jump in and search around for a solution.

The Fix

My searching skills soon landed me in the package description page of OpenArena under Linux Mint, right here, where one of the comments had a set of steps that fixes the issue.

Long story short, the libs provided by the repository are for some reason out of date with respect to the latest version of the executable as provided by the repo, and they can't be loaded properly. This causes the crash before loading. To fix it, you must manually compile the latest versions of the game's libraries (gotta love Free Software and Linux, right? :)) and manually replace the old ones with them.

Here are the steps to fix it:

Clone the official OpenArena repo contaning the core game code:

mkdir openarena
cd openarena
git clone https://github.com/OpenArena/gamecode
cd gamecode

If you haven't got them already, install the required tools to compile programs from source (a standard Ubuntu/Mint/Debian install usually doesn't have them):

sudo apt install build-essential

Build the latest version of the libraries. It's surprisingly not very large and took less than 5min here:

make

Overwrite the existing old libraries of OpenArena with these ones you've just compiled yourself:

sudo cp build/release-linux-x86_64/oax/*.so /usr/lib/openarena/baseoa/pak6-patch088

Now run openarena and watch the initial screen load as expected. Happy gameplay!

Conclusion

I feel it's nice to be able to go "hands-on" with Linux every now and then. I've heard countless times complaints that go like "Linux will never make it into the mainstream because no one wants to fix things from a terminal!" and, as usual, I just go pfft...

The imperfections of this system are its charm as well, and when I do this sort of maintenance I feel like a gardener tending his crops. It does suck when things don't work, but when you understand why and you can actually turn around and fix them, the satisfaction is enormous.

What do you think about the state of Free Software gaming nowadays, even if it has to have some small hacks to work? Let me know on Mastodon!

(And by the way, happy late new year!)


This post is number #30 of my #100DaysToOffload project. Follow my progress through Mastodon!


Last updated on 01/26/22