How to install BG2 Tweak pack into BGEE, BG2EE and IWDEE on Linux + modfix script
jde33
Member Posts: 24
THREAD UPDATE: Tweak pack no longer work on BG:EE + SoD dlc since it's release. (v2.0)
A list of the working mods is here The method will continue to work for IWD 1.4 and may work for BG2:EE 2.0 - If your running into Case Trouble with your mod for BG:EE there are some possible alternate solutions in the thread.
--
If your trying to install mods into BG:EE, BG2:EE or IWD:EE from Steam on Linux, and they don't work.. this is probably the thread your looking for.
I spent several hours tracking down why, what and how to fix this while trying to install the BG2 Tweak Pack from gibberlings3.net on the 3 installed games from Steam. - The trouble with most of these mods seems to be they were written on (primitive) OS's that are case insensitive for file names.. and even the game itself being some 15~ years old and created with w32/fat in mind has this problem with the original files. (Beamdog.. really? You need to fix that and make everything lower case.)
WeiDU on Linux uses a utility to try to fix this but it's not very good.. it's called "tolower" and what it does is recursively renames all your files to lower case. There is no way to roll it back and it actually breaks the Steam version of the games (by altering the libpath) if the mod your installing patches the binary chitin.key file. So after trying a few different things, suffering through many reinstalls and segfaults and straces trying to figure out what the game was looking for and what files should be where I decided to write a script to recursively link all the default files to a lower and a upper case version of their name. This seems to work so I'm going to share and give you a guide here.
One note of caution.. this isn't exactly a clean solution to the problem.. it is however non-destructive unlike tolower. It also modifies your file system so the usual disclaimer applies here. The script is set to operate on data, lang and override folders.. you'll have to edit the script if you need it to work on something else. This may work for other mods but if a mod for some ungodly reason uses MixeD caSE in the file names that it expects.. your pretty much screwed.
Step 1: Install WeiDU on Linux.
Download the Linux binaries: http://www.weidu.org/~thebigg/
The original instructions from G3 are here: http://www.gibberlings3.net/readmes/readme-bg2tweaks.html
Do not follow them, they are just here for reference.
Step 2: Download stuff
Download the BG2 Tweak Pack here.
(The same pack is used for all EE games, despite being called BG2 Tweak Pack)
http://www.gibberlings3.net/bg2tweaks/index.php
And get my script here.
https://mega.nz/#!Hst1kZ6Z!gVCwIoXU6THZu-l4jnWqhIUc0kXe1CzQ5iMkaw2t69s
Step 3: Extract everything.
Locate your game folder.
Should be something like ...?? /steamapps/common/Baldur's Gate Enhanced Edition/
You can find out where you installed it in Steam.
Open a terminal to that folder and copy the files you downloaded into it.
Extract the Tweak Pack and my script in the game folder.
tar -xzvf lin-bg2_tweaks-v16.tar.gz
tar -xjvpf modlink.tar.bz2
Step 4: Fix and patch
You should take a look at the script to see what it does, it's not rocket science but its good to know what its going to do. Essentially its going to crawl through your data, lang and override folders and create UPPER and lower case symbolic links for all bif and tlk files.
Run the modlink.sh script.
./modlink.sh
(modlink.sh will dump out a bunch of errors about links existing and not being able to remove stuff, this is expected behaviour.. I hope >.> .. You only need to run it once. Also modlink.sh takes the place of tolower, you no longer need to or should run tolower.)
Then install the mod via
weinstall bg2_tweaks
That should pretty much do it..
If some ppl want me to work on getting their mod Linux compatible, or altering my script to get it to work with their mod just hit me up. I'll see if I can spring the time to help you.
Rock on guys.
-- JD sysadmin extraordinaire
A list of the working mods is here The method will continue to work for IWD 1.4 and may work for BG2:EE 2.0 - If your running into Case Trouble with your mod for BG:EE there are some possible alternate solutions in the thread.
--
If your trying to install mods into BG:EE, BG2:EE or IWD:EE from Steam on Linux, and they don't work.. this is probably the thread your looking for.
I spent several hours tracking down why, what and how to fix this while trying to install the BG2 Tweak Pack from gibberlings3.net on the 3 installed games from Steam. - The trouble with most of these mods seems to be they were written on (primitive) OS's that are case insensitive for file names.. and even the game itself being some 15~ years old and created with w32/fat in mind has this problem with the original files. (Beamdog.. really? You need to fix that and make everything lower case.)
WeiDU on Linux uses a utility to try to fix this but it's not very good.. it's called "tolower" and what it does is recursively renames all your files to lower case. There is no way to roll it back and it actually breaks the Steam version of the games (by altering the libpath) if the mod your installing patches the binary chitin.key file. So after trying a few different things, suffering through many reinstalls and segfaults and straces trying to figure out what the game was looking for and what files should be where I decided to write a script to recursively link all the default files to a lower and a upper case version of their name. This seems to work so I'm going to share and give you a guide here.
One note of caution.. this isn't exactly a clean solution to the problem.. it is however non-destructive unlike tolower. It also modifies your file system so the usual disclaimer applies here. The script is set to operate on data, lang and override folders.. you'll have to edit the script if you need it to work on something else. This may work for other mods but if a mod for some ungodly reason uses MixeD caSE in the file names that it expects.. your pretty much screwed.
Step 1: Install WeiDU on Linux.
Download the Linux binaries: http://www.weidu.org/~thebigg/
The original instructions from G3 are here: http://www.gibberlings3.net/readmes/readme-bg2tweaks.html
Do not follow them, they are just here for reference.
LinuxThe instructions tell you to extract the files into /usr/bin, this works but its poor form to do so. /usr/local/bin or ~/bin are saner choices. (You can add a directory of your choosing to your executable path by doing "export PATH=$PATH:/new/path" and/or adding that to your ~/.bash_profile)
Download the latest version of WeiDU for Linux from weidu.org and extract (at least) the WeiDU, weinstall and tolower executables in a $PATH directory (E.G. /usr/bin). Following that, open a terminal, cd to your BG2 installation directory, run `tolower' and answer Y to both queries.
You can avoid running the second option (linux.ini) if you've already ran it once in the same directory. To save time, the archive is already tolowered, so there's no need to run the first option (lowercasing file names) either if you've extracted only this mod since the last time you lower cased file name. If you're unsure, running tolower and choosing both options is the safe bet.
After that, run 'weinstall bg2_tweaks' from your game installation directory to install or uninstall the mod.
Step 2: Download stuff
Download the BG2 Tweak Pack here.
(The same pack is used for all EE games, despite being called BG2 Tweak Pack)
http://www.gibberlings3.net/bg2tweaks/index.php
And get my script here.
https://mega.nz/#!Hst1kZ6Z!gVCwIoXU6THZu-l4jnWqhIUc0kXe1CzQ5iMkaw2t69s
Step 3: Extract everything.
Locate your game folder.
Should be something like ...?? /steamapps/common/Baldur's Gate Enhanced Edition/
You can find out where you installed it in Steam.
Open a terminal to that folder and copy the files you downloaded into it.
Extract the Tweak Pack and my script in the game folder.
tar -xzvf lin-bg2_tweaks-v16.tar.gz
tar -xjvpf modlink.tar.bz2
Step 4: Fix and patch
You should take a look at the script to see what it does, it's not rocket science but its good to know what its going to do. Essentially its going to crawl through your data, lang and override folders and create UPPER and lower case symbolic links for all bif and tlk files.
Run the modlink.sh script.
./modlink.sh
(modlink.sh will dump out a bunch of errors about links existing and not being able to remove stuff, this is expected behaviour.. I hope >.> .. You only need to run it once. Also modlink.sh takes the place of tolower, you no longer need to or should run tolower.)
Then install the mod via
weinstall bg2_tweaks
That should pretty much do it..
If some ppl want me to work on getting their mod Linux compatible, or altering my script to get it to work with their mod just hit me up. I'll see if I can spring the time to help you.
Rock on guys.
-- JD sysadmin extraordinaire
Post edited by jde33 on
2
Comments
Thanks for the script.
I hit a problem similar to yours, eg. after having installed bg2_tweaks I have a segfault, using the GOG version on linux.
Is your script working for this case? In fact I did something very similar: I created a "ghost" arborescence which symlinks everything exactly, while tolowering the original game folder (I kept a backup of course...).
I now have a "game_symlink" and a "game_tolower" folders, and I launch start.sh targetting game_symlink as if it was the original "game" folder. I'm not sure I'm clear?
Anyway, I hit a segfault. The coredump gives the following stack trace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x087b4017 in fontGetDefaultSize ()
[Current thread is 1 (Thread 0xf6ef3700 (LWP 3458))]
(gdb) bt
#0 0x087b4017 in fontGetDefaultSize ()
#1 0x08761e4d in CVidFont::SetResRef(CResRef const&, int) ()
#2 0x08258d2a in CBaldurChitin::PreLoadFonts() ()
#3 0x0875dc98 in CVidMode::ActivateVideoMode() ()
#4 0x08744da2 in CChitin::InitializeServices() ()
#5 0x08749a43 in CChitin::WinMain() ()
#6 0x0824fd0d in main ()
So, I cannot really play with the mods installed. If I use the orifinal folder though, the one I did a backup of and that I didn't edit in any way, I can launch the game (well, duh..), and I can also copy the modded override folder inside and play! So, I get the few rule tweaks I wanted. However, the dialog.tlk got changed or something and I now have "Illegal: xxxxxx" for all the items descriptions. Pretty annoying.
So, in this case, would your script actually permits to entirely play? Is it actually different from what I did? It seems pretty similar.
I haven't flushed out all cases and all mods and I'm sure there are some problems to be found.. but for me its pretty much broken now as these mods won't (by in large) apply to the Siege of Dragonspear update. (confirmation on that for BG2:EE 2.0?) IWD:EE 1.4 will still work tho.
Beamdog also put in a mention in the patch notes that they fixed the patching for mods on various platforms so it could be that we won't even need this anymore on future mods. I'm not sure why they didn't lowercase everything though they have the power to do this and that would fix every mod on every platform as Android has the same problem. Currently some files have ALL UPERCASE, lower case, and Mixed Case file names. Part of the pain I guess developing on Windows and then porting.. Dev's (and moders) don't think about these things. Visual Studio is available on Linux now so maybe that will help people reliant on that tool.
Also, Steam can be configured to use a separate partition, so if you use that you don't even have to copy. You let Steam install your IE games in the ntfs partition, so you also get the updates.
Thanks, but I don't want to mess with my partitions just for one game. And using ntfs I'd be forced to defrag once a while .
Nah, I made a small script that does pretty much the same thing as the one presented in this thread (I proposed it elsewhere, you can probably find it in my history or something). It works pretty well and so far I was able to install mods on BGEE, BGIIEE and IWDEE.
Also, as I mentioned, this can also be done without partitions: you just create a loopback file formatted with ntfs. I have yet to try it, though, but there's no reasons it wouldn't work (it does work for virtual machines, for example).
Of course, you are free to use a script that requires manual handling: I, using Steam, am very happy to be able to use mods and update BG seamlessly
If your looking for a filesystem, I believe ZFS can be mounted in a case insensitive way via casesensitivity flag. I haven't tried it but what you'd do is create a dataset for your BG folder, or steam folder. (tank/games/steam) set the casesensitivity flag to insensitive, and install the game into that dataset. You probably need to set the flag before you install the game as most ZFS flags work that way, not sure about this one though.
(He's joking btw, but any filesystem that uses extents would need defrag.. thats.. like all of them basically even ext4. Not that anyone would but ya)
I think the ZFS dataset would prob be the slickest way to do it tho.. no loopback, no partitions, no mounting.. you would however need to have a ZFS drive in your rig.
I didn't know about ZFS datasets. That is definitely the best way to handle this (if it works as you are suggesting - will have to check that :P). Very cool!
Drive 1 - Ext4 / + swap
Drive 2 - ZFS tank
ZFS mount /mnt/tank
mkdir /mnt/tank/games/
make dataset Steam on /mnt/tank/games
In steam create Library on /mnt/tank/games/Steam but don't install yet.
Set casesensitivity flag to that dataset
Install BG in Steam
Snapshot ZFS so you can rollback if you mod fails without reinstalling. (zfs snapshot -r tank/games/steam@bgvanilla1)
test test test. rollback as needed (zfs rollback tank/games/steam@bgvanilla1)
Something like that.. I guess one would have to be fairly versed in ZFS to know how to do that stuff but if you know it you should get my drift. ZFS also isn't the fastest filesystem out there for gaming (its faster than NTFS tho) so you may want to put new games on to ext4
I had understood that "ZFS Datasets" were a sort of user-space filesystem, so I wouldn't have to create a partition or a loopback - just configure an existing folder in my ext4 FS to be "formatted" as ZFS. That sounded very clean for this particular application (a Steam library).
If I still have to create a partition/own another drive, what do I gain compared to ntfs?
I mean I could talk about ZFS's features and the like but that's kinda not the point. The reason we play games on Linux at all is because we want our working environment to be a particular way and we don't want to dual boot or use some other crap workaround. We use our computers for more than just BG or games after all. If that working environment for your desired system includes a powerful file system like ZFS in its image and design then you have a solution builtin for dealing with this. If you want to use loopback devices, samba shares, or whatever else than thats up to you as well.
All I'm doing is sharing the information for how it can be done.. it's up to you to implement it the way you want. ZFS can be case insensitive and that way is fairly slick and you get a lot of power and control ability to manage your data but you may prefer a simpler setup.
I personally won't do it, since I only use a small 20GB partition for BG games and ntfs is enough. But it's good to know the possibility is there.
Anyhow back to this thread.. I intend to fix this and do a write up on it but I'm expecting a patch from Beamdog and I'm hoping they include a system for mods that doesn't involve weidu.