Making Hexwave work on Steam Deck!

Hi there! Welcome to another Hexwave blog.

Hexwave currently only works on Linux, which is currently a blessing in disguise as the Steam Deck runs on Linux and, as I want to make Hexwave run on the Steam Deck, now is a great time to get it working! So, how do we do that? Well, the process was more complicated than anything I've dealt with before.

See, Hexwave is made to be extremely flexible. You should be able to compile it, take the compiled binaries, throw it on an older/newer machine, and run it perfectly fine (there will be pre-compiled versions too). However, with the way FFmpeg is currently linked, this doesn't work.

If Computer A has FFmpeg 0.0.59 and Hexwave is compiled on Computer A, but Computer B has 0.0.60, Computer B will refuse to run Hexwave, as it's looking for 0.0.59. This is exactly what was happening when I was trying to run Hexwave on the Steam Deck, as FFmpeg on the Steam Deck is more up-to-date than the version in Debian 12 Stable.

Now, there are two solutions for this:

- Load FFmpeg at run time and just look for the generic syslink

- Statically build FFmpeg with the project.

I chose to statically link FFmpeg. The reason for statically linking FFmpeg is down to making sure nearly every system will be able to run the project and eliminating any libraries needing to be installed just to use Hexwave.

In the future, I will most likely use the first solution mixed with the second solution as that means exporting to other platforms becomes incredibly easy (because with this, it's a complicated process).

So, I downloaded FFmpeg from GitHub, built out all of the libraries statically (.a), put them into the project and.... oh. That didn't work. Hexwave now generates undefined references. What's wrong? Well... I don't know really know why in specific, other than being told by a friend "statically linking libraries usually never goes well, avoid it at all costs". So what now? Luckily, you can build .so files rather than .a files and I know .so files work because that's what we're currently using! So I repeated the process again, built out all the libraries dynamically this time, put them into the project and.... It worked!

Hexwave was running off the Steam Deck!


This was great too, it now means you can do exactly what I wanted and run it from any system!

Comments

Popular posts from this blog

The idea behind making Hexwave.

Saving & Loading for Hexwave.