You can sign up to get a daily email of our articles, see the Mailing List page!

The sad case of Trine on Mesa and Linux in 2019

By - | Views: 30,309

A year or so back I was planning on writing a congratulatory article to show my appreciation to Dave Airlie for fixing a long standing bug in Mesa that prevented users of older AMD Radeon HD cards from enjoying Trine Enchanted Edition on the free graphics stack. Bug 91808 resulted in a variety of graphical artifacts which, while not interfering with the gameplay, still put me off using that version of Trine.

After several years and a great deal of evident frustration on his part, Airlie was able to track down the root of the problem and at long last was able to push a fix to master in May 2018. Airlie and developers like him are often the unsung heroes of FOSS development, and I wanted to give him a well deserved public pat on the back for his effort in fixing a bug which would only have affected such a small number of people.

Unfortunately my research into this led me down an entirely different rabbit hole when I discovered the report for Bug 66067. A much more subtle misrendering of the game's colours and lighting, this bug is present in both Trine 2 and Trine Enchanted Edition. Unlike the previous instance where it was an issue in the drivers that was the culprit, this issue is present in the game binaries themselves.

Trine Enchanted Edition when affected by Mesa bugs 91808 and 66067.

Unlike the proprietary vendor drivers provided by Nvidia and AMD, the free Mesa stack as a rule does not implement application specific fixes and instead adheres more strictly to the standards outlined by Khronos Group and other similar bodies. There are a number of reasons for this, mostly relating to adhering to a higher standard of code quality, and thus limiting the maintenance overhead for the FOSS developers.

In developing their games Frozenbyte made certain mistakes related to texture sampling and shadow sampling which were not technically in line with specifications, but are still accommodated for by most vendor drivers. The result is that the game will only render correctly for AMD users on Mesa when provided with specific patches that allow it to mimic the same incorrect behaviour found in the proprietary blob.

Applying these patches is nontrivial for the uninitiated, but through the use of Arch Build System I was able to spin my own Mesa packages to play through my copies of both Trine Enchanted Edition and Trine 2: Complete Story as the developer originally intended. The proper solution would be for Frozenbyte to patch their games to adhere to the correct Cg standard, but that now seems very unlikely.

Trine Enchanted Edition rendering correctly with a patched Mesa.

Frozenbyte was an early adopter of Linux, first through the porting house Alternative Games and then later through their own in-house development starting with Trine 2. The Humble Frozenbyte Bundle in April 2011 was the first Humble Bundle I ever purchased, and I got a lot of enjoyment from their games through the first half of our soon to close decade. As recently as 2016 their game Shadwen was released with full Linux support.

Since then a lot has changed over at Frozenbyte. The studio no longer has the same depth of Linux savvy programmers it once had, and following the release of Shadwen has been teaming up with publishers more intent on the console market. Its last three titles have all lacked Linux support, and with the release of Trine 4: The Nightmare Prince last month, the series is no longer fully represented on our platform.

Lacklustre Linux sales and internal restructuring following the lukewarm reception on all fronts to the third release in the franchise Trine 3: The Artifacts of Power appear to have taken Frozenbyte out of the Linux market for good. With even their old games struggling to run well on the Mesa graphics stack, it marks a sad end to a series that once provided so much colour to our platform.

UPDATE: Daniel Scharrer got in touch in the comments to provide some technical clarifications and share his LD_PRELOAD hack that solves the problem at the application rather than the driver level.

Those wanting to try the series can find Trine: Ultimate Collection on either or Steam. Note that as stated before Trine 4: The Nightmare Prince does not currently have Linux support.

Article taken from
34 Likes , Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG and Humble Store. See more here.
About the author -
author picture
Hamish Paul Wilson is a free software developer, game critic, amateur writer, and farm labourer living in rural Alberta, Canada. He is an advocate of both DRM free Linux gaming and the free software movement alongside his other causes, and more information on him can be found at his homepage where he lists everything he is currently involved in:
See more from me
The comments on this article are closed.
Page: «5/5
  Go to:

s8as8a 5 Jan, 2020
Quoting: HamishTry launching the game outside of Steam by changing into the directory and launching the game from a terminal like so:

cd "~/.steam/debian-installation/steamapps/common/Trine/_enchanted_edition_/"
sh trinefix.c ./

That works for me with the Humble Store versions I was using.
Thanks again for the response.

I didn't occur to me to run it from outside of Steam, but it's good that you said that because now I have an error message.:
user@debian:~/.steam/debian-installation/steamapps/common/Trine/_enchanted_edition_$ cd ~/.steam/debian-installation/steamapps/common/Trine/_enchanted_edition_/
user@debian:~/.steam/debian-installation/steamapps/common/Trine/_enchanted_edition_$ sh trinefix.c ./ 
[trinefix] attached to sh: 0x7f6a4c55a3b0 (nil) (nil) (nil)
[trinefix] attached to mkdir: 0x7fb91f2a53b0 0x7fb91f2a5490 (nil) (nil)
[trinefix] attached to readlink: 0x7f64dce143b0 (nil) (nil) (nil)
[trinefix] attached to dirname: 0x7f9297e023b0 (nil) (nil) (nil)
[trinefix] attached to chmod: 0x7faf3ee403b0 (nil) (nil) (nil)
./bin/trine1_linux_launcher_32bit: error while loading shared libraries: cannot open shared object file: No such file or directory

Do you know how to deal with that, by any chance?
Hamish 6 Jan, 2020
Do you have the libgtk2.0-0 package installed? It provides the library.

EDIT: And make sure you have the i386 package since it is a 32-bit application.

Last edited by Hamish on 6 January 2020 at 3:55 am UTC
s8as8a 8 Jan, 2020
Quoting: HamishDo you have the libgtk2.0-0 package installed? It provides the library.

EDIT: And make sure you have the i386 package since it is a 32-bit application.
I didn't have it, so I installed it, but then, after re-running the command, I recall it saying that I needed some other so.0 file which is available only from the libpng12-0 package (sorry, I'm not at that computer at the moment to give the exact error message), but as can be seen here ( ), libpng12-0 is not available in Debian testing / bullseye. (I don't think that libpng16-16 ( ) would work and I tried getting jessie / oldoldstable's version of libpng12-0, but I think there were dependency problems that couldn't be resolved with apt-get install -f because the dependencies sought are too old. (I was thinking about getting the deb file for libpng12-0 from unstable / sid's repository, but as shown on the link I gave, there is only a deb file in unstable / sid's respository for the arm64 architecture.))

I guess I can just wait for when I get my next GPU (in the not-so-near future) (because my current GPU doesn't support Vulkan) and then play it with Proton? I'm in no rush to play them; I was just thinking of playing them with friends of mine a few days ago, but that time has passed. ;)
Eike 8 Jan, 2020
Do a "locate" on the missing library. AFAIR, it is contained the Steam runtime. (If you don't have locate installed, install it and run updatedb before doing the locate. It's a useful tool.)
dpanter 8 Jan, 2020
Quoting: EikeDo a "locate" on the missing library.
This is the way. ^_^
s8as8a 10 Jan, 2020
Quoting: EikeDo a "locate" on the missing library. AFAIR, it is contained the Steam runtime. (If you don't have locate installed, install it and run updatedb before doing the locate. It's a useful tool.)
I already use locate, but I didn't know that the Steam runtime had the library, so thanks!

In case anyone else is having this issue, what I did was go to the directory of the game, run ln -s /home/user/.steam/debian-installation/ubuntu12_32/steam-runtime.old/lib/i386-linux-gnu/ and then run sh trinefix.c ./, and it works now! I even got it working throuh the Steam client by putting sh trinefix.c ./ as the command (instead of sh trinefix.c %command%)! :D

I also got Trine 2 working by doing the same thing, except in the Trine 2 directory and replacing with in the command.

Also, thanks again, Hamish. :)

Last edited by s8as8a on 10 January 2020 at 12:50 am UTC
s8as8a 10 Jan, 2020
Quoting: dpanter
Quoting: EikeDo a "locate" on the missing library.
This is the way. ^_^
Is that a reference to "The Mandalorian", by any chance? ;P
Hamish 10 Jan, 2020
Yeah, I figured it would work fine from within Steam once I saw it was a library issue rather than anything to do with the LD_PRELOAD hack. All's well that ends well. ^_^

Last edited by Hamish on 10 January 2020 at 7:08 am UTC
While you're here, please consider supporting GamingOnLinux on:

Patreon, Liberapay or PayPal Donation.

This ensures all of our main content remains totally free for everyone with no article paywalls. We also don't have tons of adverts, there's also no tracking and we respect your privacy. Just good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.
Livestreams & Videos
Community Livestreams
Latest Forum Posts