How to: GOG linux games on uConsole (Hammerwatch)

I figured out how to run one of my favorite games on the raspberry pi CM4 uConsole, and it took a lot of searching so I wanted to consolidate what I learned. This might be like sooo obvious to some but I am a windows guy learning linux so if there are others like me, this might help!

Also I keep forgetting how I did this so I want to write it down for myself

Tested on: Good Old Games Linux installer for Hammerwatch on a CM4.

Also works on: other games from GOG like FTL and Into The Breach

First barrier (broadly applicable): opening hammerwatch_1_41_23456.sh

Symptom: I try ./hamm* and get Permission Denied so I try sudo ./hamm* and get command not found

Solution: instead run unzip hamm* -d /usr/games/hammerwatch

Explanation: honestly not sure exactly but I think this is just a zip file with a script tacked onto the beginning for extraction and install. Somehow raspian knows what to do, so we extract the files to our games folder. This works for basically EVERY linux gane from GOG and is almost the only required step

Second barrier: These games are for x86_64 type architectures and we are on an ARM processor.

Symptoms: I forget the exact error message but if you try to run any of the game files the console will be like "not compatible with your system " Or maybe it was ā€œcommand not foundā€ instead. Iā€™m leaning more toward it-was-a-really-vague-error. If someone goes through this and can tell me exactly Iā€™ll edit it in.

Solution: Install Box64 which is a tool/emulator that converts x64 instructions to ARM instructions. I like box64 because the performance hit from using it seems pretty small and it kicks in on its own rather than you having to keep track of a separate emulator app. Itā€™s still slower than native but itā€™s better than nothing!

The following instructions build and install box64 from source on uConsole. I got the instructions from Run x64 Software on a Raspberry Pi using Box64 - Pi My Life Up however I will type up the TLDR version.

cd;
sudo apt install git build-essential cmake;
git clone https://github.com/pitSeb/box64.git;
cd ~/box64;
mkdir build;
cd build;
cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo;
make -j$(nproc);
sudo make install;
sudo systemctl restart systemd-binfmt;

Boom you now should have Box64. Note that this process actually takes quite a while and it especially hangs at the 100% mark during the build. Be patient!

Third barrier: when I run /usr/games/hammerwatch/data/noarch/start.sh it STILL says its not compatible with my system, even though box64 is kicking in!

The reason this happens is the bundled launch scripts are not expecting an aarch64 processor so they go to the default case and try to run the 32 bit (x86) version of the game! What!

Solution: modify the scripts to include aarch64. Now, I am lazy so I granted all the permissions on all the hammerwatch files first with sudo chmod -R 777 /usr/games/hammerwatch but if you donā€™t do that youā€™ll need to do these edits via command line with sudo.

Go into /usr/games/hammerwatch/data/noarch/game and open the file RunHammerwarch with your favorite text editor. Youā€™ll see a line that says something like: if [ "$ARCH" == "x86_64" ]; then
Change it to
if ( [ "$ARCH" == "x86_64" ] || ["$ARCH" == "aarm64" ] ); then

And save that file.

Now the launch script will correctly use the 64 bit version of the game when it sees your processor type.

Fourth barrier: now when you try to run the game you get a bunch of console output but execution fails due to who knows which error. Well one especially useful tidbit in the log is Magic number is wrong: 542

Solution: this is apparently some bug with a thing called ā€˜monoā€™? I donā€™t know the specifics but I do know that to fix it we go back into our RunHammerwatch file and change the last line to be

export 'TERM=xterm' && ./Hammerwatch.bin.${ext} $0

This has something to do with telling (mono?) What terminal to use to run the following script.

If you do all that successfully, and youā€™re working with a factory default image, and you didnā€™t make any mistakes, run

/usr/games/hammerwatch/data/noarch/start.sh

And you should be greeted with fanfare and something looking like this:

You will probably have to go in and turn off some of the lighting and blurs and shadow effects to get a decent frame rate but it runs really well once you zero in the graphics settings. I was even playing two-player local co-op with an attached xbox one controller.

You can run many of the linux games on GOG following this process except you only have to install Box64 once and I think most of the games donā€™t need that weird mono fix.

If anyone sees typos in my instructions feel free to let me know! I tried to be really REALLY verbose on this writeup so that I could include as many of the things I tried to google while figuring this stuff out. Ultimately most of this is online but you have to wade through a lot of search results and do a lot of fruitless google searching.

5 Likes

I found that PiKiss works well on the CM4 Bookworm Debian distro for quickly installing Box64/Box86. Iā€™d recommend it for setting up Box86 + WINE if youā€™re interested in playing old Windows games, as it can be a little challenging to set up manually on ARM.

Yeah unfortunately on the bookworm image I tried I had a lot of very difficult to diagnose performance issues on basically all of the box64 emulated programs I wanted to run, so ultimately I reverted to the factory image which has been working well.

I actually did try piKISS a little bit ago, I think in an attempt to run quake, or maybe halflife, I do remember, but ran into issues with those as well. I donā€™t remember if that was while I was on the factory image or bookworm though. Interestingly after I install the games I move on. Iā€™m not really in it to play I guess, more to figure out the puzzle of running it.

My next project is compiling GZDoom from source for aarm64 and seeing how that runs. I got it running with box64 but performance wasnā€™t great.

Hello,

Iā€™m totally newbie than sorry for my basic question:
What is Hammerwatch and how to get it?

Iā€™m trying to install Thimbleweed Park GOG version on a raspberry Pi 4/5
This seems to be the solution, many thanks, but this Hammerwatch is what I miss I think.

Alrready tried to install with BOX64 only and the game qui after few seconds from startā€¦

Ops, I just realized that Hammerwatch is the gameā€¦ sorryā€¦ Then I will try the rest.

Yeah I could definitely try to help if you knew what kind of error message you were getting. I know some games I have tried have audio library incompatibilities or other issues like that which I donā€™t have a good general fix for.

1 Like

Many thanks Philip, I will try asap and let you know :pray:t2:

Doesnā€™t Lutris work? Thatā€™s how I install and run my GOG games on Steam Deck.

I donā€™t remember if I tried lutris before going down this path but if it works Iā€™m sure anyone interested in this thread would be happy to know.