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.
Do you have the libgtk2.0-0 package installed? It provides the libgtk-x11-2.0.so.0 library.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 ( https://packages.debian.org/search?keywords=libpng12-0 ), libpng12-0 is not available in Debian testing / bullseye. (I don't think that libpng16-16 ( https://packages.debian.org/search?keywords=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.))
https://packages.debian.org/buster/libgtk2.0-0
EDIT: And make sure you have the i386 package since it is a 32-bit application.
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. ;)
Do a "locate" on the missing library.This is the way. ^_^
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.)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/libpng12.so.0 and then run sh trinefix.c ./trine1.sh, and it works now! I even got it working throuh the Steam client by putting sh trinefix.c ./trine1.sh as the command (instead of sh trinefix.c %command%)! :D
Edit:
I also got Trine 2 working by doing the same thing, except in the Trine 2 directory and replacing trine1.sh with trine2.sh in the command.
Also, thanks again, Hamish. :)
Last edited by s8as8a on 10 January 2020 at 12:50 am UTC
Is that a reference to "The Mandalorian", by any chance? ;PDo a "locate" on the missing library.This is the way. ^_^
Last edited by Hamish on 10 January 2020 at 7:08 am UTC
See more from me