Jump to content


Crash on Linux with GOG downloaded games

  • Please log in to reply
1 reply to this topic

#1 pharaox

  • Member
  • 2 posts

Posted 20 July 2021 - 06:18 AM



I am trying to install Infinity Animations on Linux with BGT based on BG1 and BG2 downloaded from GOG. I have already successfully installed and used a number of mods in this setup (all of what's mentioned here except IA, and some more quests / NPCs) , none of the "megamods" though, and so I thought before trying them out I should install also IA as it's strongly recommended for these.


I downloaded the main archive and all additional archives and extracted them as instructed. With the WeiDU installer, I successfully installed the core component but then got errors stating that the content of the additional archives was missing, even though I could clearly see that it's there. I checked the tp2 file and saw that it uses the "Windows 1252" encoding, and so I assumed the WeiDU installer could not read the special characters from it correctly. Since these were only used in REQUIRE_PREDICATE FILE_EXISTS_IN_GAME checks, I simply commented all these checks out in order to install everything.


I started a new game, created a character, and then when entering the Candlekeep Inn I got a CTD:


Unhandled exception: page fault on read access to 0x00000058 in 32-bit code (0x009ca8a8).


Logging is enabled but baldur.err is empty. Since I have followed the proper installation order recommended here, and since I have a working setup with everything else except IA, I assume the crash is caused by IA, and somewhat related to the use of special characters and the "Windows 1252" encoding, as mentioned in the Readme.


I found out that to pass the right encoding via Wine I should use the LANG environment variable. I added the following line to the GOG start.sh script:


export LANG=en_US.CP1252


I also tried export LANG=en_US.ISO-8859-1; both locales are correctly generated and usable in my system.


This indeed got me somewhere - now the game crashed in exactly the same way but earlier, when loading the very first area (Candlekeep), right after the character creation screens. This confirmed my suspicion that the crash is somehow encoding related, but I am still clueless how to resolve the issue.


Anybody else got similar issues? My GOG setup is pretty standard and I suspect other people trying to install IA on a GOG-based BGT should encounter these issues as well. Tried to google similar issues but this got me nowhere. I would greatly appreciate any hints.

#2 pharaox

  • Member
  • 2 posts

Posted 21 July 2021 - 08:01 AM

It turned out that the issue was caused by unrar converting the filenames into UTF-8 when extracting the archives, so the special Windows 1252 characters (e.g. Ø) were replaced by their UTF-8 equivalents. This is the default behavior of all utilities capable of extracting rar files, and it's entirely sensible considering that UTF-8 is the standard on Linux and so non-Unicode characters in filenames, although possible, look like gibberish. However, because of this the IA installer complained of not being able to find the extracted files, and when I forced it to do its job anyway, it used the wrongly (from BG2's perspective) encoded filenames and this caused the game to crash.


The solution was to force unrar to preserve the original Windows 1252 (equivalent to ISO-8859-1) encoding, which I was eventually able to achieve by setting the right locale via the LANG environment variable, e.g.:


LANG=en_US.ISO-8859-1 unrar e "$MODS_DIR/IA_Fiends_Genies.rar" "$BG2_DIR/infinityanimations/content"


With this, the IA installer was able to find the archives and install all components successfully, and the game crash was also gone.


I am quite sure anyone attempting to install IA on Linux will encounter this issue, and the solution is very unobvious from my perspective. Maybe it's a good idea to add a sentence to either the Linux or the Troubleshooting parts of the Readme, perhaps with a link to this thread?