Check out our Monthly Survey Page to see what our users are running.
We do often include affiliate links to earn us some pennies. See more here.

The sad case of Trine on Mesa and Linux in 2019

By - | Views: 40,095

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 GOG.com or Steam. Note that as stated before Trine 4: The Nightmare Prince does not currently have Linux support.

Article taken from GamingOnLinux.com.
34 Likes
About the author -
author picture
Hamish Paul Wilson is a free software developer, game critic, amateur writer, cattle rancher, shepherd, and beekeeper living in rural Alberta, Canada. He is an advocate of both DRM free native Linux gaming and the free software movement alongside his other causes, and further information can be found at his icculus.org homepage where he lists everything he is currently involved in: http://icculus.org/~hamish
See more from me
The comments on this article are closed.
47 comments
Page: 1/5»
  Go to:

vskye Nov 19, 2019
That's sad. I have Trine and Trine 2 in my library and have enjoyed them, and was looking forward to trying out the rest of the series.
Hamish Nov 19, 2019
Quoting: vskyeThat's sad. I have Trine and Trine 2 in my library and have enjoyed them, and was looking forward to trying out the rest of the series.
Just to be clear, Trine 3 does have Linux support at least. I have not played it though due to still having an older graphics card without OpenGL 4 support.


Last edited by Hamish on 20 November 2019 at 1:34 am UTC
Shmerl Nov 19, 2019
May be there is a way to release an LD_PRELOAD hook just for the needed functions, to avoid building full blown custom Mesa?

As for Frozenbyte, basically they have no Linux developers left in the studio, according to their own words.
eldaking Nov 19, 2019
I would say this story is a good example of the benefits we could have from games being FOSS. The game has a longstanding bug that should be fixed on the game code (rather than worked around in drivers), but the developer has no Linux developers left to fix it and not really any interest in the Linux copy. However, technical savvy users have found the bug and identified what fix would be needed, and are even willing to do onerous stuff like recompiling the entire graphics driver to solve it. But they have no access to the game source code and no way to distribute the fix if they had (yes, it would be necessary; we couldn't rely on the developers maintaining the game, after all).


Last edited by eldaking on 19 November 2019 at 11:43 pm UTC
Purple Library Guy Nov 20, 2019
Quoting: eldakingI would say this story is a good example of the benefits we could have from games being FOSS.
Even open source game engines would presumably help a lot. Hopefully Godot for instance will gradually become more and more competitive and see wider and wider use.
seven Nov 20, 2019
does trine 4 run on proton?
Hamish Nov 20, 2019
Quoting: sevendoes trine 4 run on proton?
ProtonDB and/or the Wine AppDB are your friend:
https://www.protondb.com/app/690640

I am slightly curious if buying the Ultimate Collection counts as a Linux sale, even with Trine 4 included. A way to vote with your wallet perhaps.
Hamish Nov 20, 2019
Quoting: eldakingI would say this story is a good example of the benefits we could have from games being FOSS.
I had thought of mentioning this, but I could really turn this topic into an article in and of itself.

The original Unreal Tournament is stuck with a similar issue on Mesa that makes the old native build unable to launch. Enemy Territory: Quake Wars is plagued with the wchar bug when using modern versions of glibc.

Playing both of these games through WINE is now often easier than doing so natively, due to it being a stable environment. Both modern Windows and Linux are moving targets.

Frozenbyte released some of its source code in the past as part of the Humble Frozenbyte Bundle, although I doubt they are likely to do so again any time soon.


Last edited by Hamish on 20 November 2019 at 1:50 am UTC
Hamish Nov 20, 2019
Also, the more I look at the second screenshot in the article, the odder the shield appears to me. You can see both of the knight's arms, so unless the wizard is using his levitation powers, it must be standing on its own.


Last edited by Hamish on 20 November 2019 at 1:54 am UTC
x_wing Nov 20, 2019
Quoting: HamishJust to be clear, Trine 3 does have Linux support at least. I have not played it though due to still having an older graphics card without OpenGL 4 support.

But your GPU has supports up to OpenGL 4.5 (at least with core profiles).

I believe that the only real workaround for this games is D9VK or gallium-nine. Although what a pity.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring 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.