The nostalgia bug recently bit me and I thought it might be fun to play some KOTOR2, with mods of course! After a bit of tinkering I think I have a working mod set up running on Linux. I thought that my experience might be useful to someone else attempting to install mods on Linux or a maybe a Steam Deck.
A fair warning though, I have not had time to play test yet beyond running around on Peragus so there could be issues that I haven't discovered or steps that I forgot that I did. I'll try to update if I run in to any issue but I'm not promising anything, I have a nasty habit of spending days modding a game only to never actually play it when I'm done!
First install the native Linux version of KOTOR2:TSL from steam
Next download the latest KOTORModSync (currently 1.0.2) https://github.com/th3w1zard1/KOTORModSync
- linux-x64.zip
- KOTOR.Modbuilds.Rev10.zip (Contains KOTOR2_Full.toml modlist we will be using)
The install directly can be found at ~/.local/share/Steam/steamapps/common/Knights of the Old Republic II/
All regular game assets are in the subdirectory 'steamassets', this is where mods will be installed, not in the main game install directory
Run the game once to make sure it runs properly, I'm using Arch Linux with Hyprland(Wayland compositor) so I needed to add 'SDL_VIDEODRIVER=x11 %command%' to my launch commands to get it to run properly.
The kotor2.ini found in the steamassets directory is not used, delete it.
The correct kotor2.ini is found at ~/.local/share/aspyr-media/kotor2/swkotor2.ini
Create a symlink to it in the steamassets directory
ln -s ~/.local/share/aspyr-media/kotor2/swkotor2.ini swkotor2.ini
Backup you KOTOR2 directory in case you make a mistake:
tar zcvf kotor2.tar.gz Knights\ of\ the\ Old\ Republic\ II
You can restore with
rm Knights\ of\ the\ Old\ Republic\ II
tar zxvf kotor2.tar.gz
Open KOTORModSync and load the installation file (KOTOR2_Full.toml)
Create a directory to store mods in (I use ~/Games/KOTOR2Mods/)
Go through the mod list and download each mod to you mod directory from the link. Make sure to download The Sith Lords Restored Content Mod as a zip from the google drive link and not the regular exe installer. There are also a few cases where if you download a mod form ModNexus instead of DeadlyStream the name of the zip file will not be correct and needs to be renamed.
As of writing this there are 2 issues with this mod list, this first one is with 'Reflective Lightsaber Blades' (New_Lightsaber_Blade_Model_TSL). currently the included version of Holopatcher has issues reading info.rtf files with non UTF-8 encoding and a error window will pop up. This does not actually appear to affect the installation of the mod and can be ignored. This issue will be fixed in the next relese.
The second issue is with 'Improved AI' and requires some work. For some reason the zip file you download contains the mod compressed into a self extracting 7z file. KOTORModSync does currently not appear to be able to extract self extracting 7z files on Linux.
My Solution was to extract the mod manually, repack it as a 7z file and alter the install instructions (7z on linux can handle 7z SFX exe files just fine).
unzip imporvedai.zip
cd Improved\ AI/
7z x Modified\ AI.exe
7z a ModifiedAI.7z Modified\ AI
Move the new 7z file to you mod dir and change the mod install instructions to:
1. Extract <<modDirectory>>\ModifiedAI.7z
2. TSLPatcher <<modDirectory>>\ModifiedAI\Modified AI\Install AI Tweak.exe 1
Set your mod directories. Mod Location is the mod dir you created (~/Games/KOTOR2Mods/ for me) and Kotor Directory should be '~/.local/share/Steam/steamapps/common/Knights of the Old Republic II/steamassets/'
- Run pre install validation, if there are any issues detected you will need to fix them. You can find a log file in the KOTORModSync directory that can help you troubleshoot issues.
- Choose 'Mock case-insensitive filesystem'
- Run 'Fix duplicate files/folders'
- Click 'Start the install' and cross your fingers, hopefully you set up everything correctly and installing mods should complete successfully. This takes quite a while.
- All files in steamassets need to be lowercase, in some cases files installed by the mod will have uppercase lettering. There is probably a better solution but I created the following script and ran it in each directory that contained files that needed to be renamed. Be VERY careful not to run it from any other directory:
# !/bin/bash
for file in *; do
#Suppresses all errors as not to spam errors when file does not need to be renamed
mv -v "$file" "$(echo $file | tr '[:upper:]' '[:lower:]')" 2>/dev/null
done
I was going to try and use Reshade shaders with vkBasalt but unfortunately that was to much for my poor laptop's integrated graphics but it did seem like vkBasalts SMAA anti-aliasing worked better the KOTOR2's build in AA so I stuck with it.
To get vkBasalt to work with KOTOR2 on my set up I need to run it through gamescope.
Install gamescope, I'm using gamescope-git from AUR but regular gamescope from extra my work for you. If you're trying to follow this guide on a steamdeck you should already be using gmescope. See https://wiki.archlinux.org/title/Gamescope
Once you've installed gamescope add 'gamescope -h 1080 -H 1080 -f -- %command%' to your steam launch options and make sure you can launch the game
Install vkBasalt fro AUR
yay -S vkbasalt
copy the default vkbasalt config file to your KOTOR2 dir
cp /usr/share/vkBasalt/vkBasalt.conf.example .local/share/Steam/steamapps/common/Knights\ of\ the\ Old\ Republic\ II/vkBasalt.conf
Enable SMAA and whatever else you want (I you are going to give reshade shaders a try then the best source of shaders seems to be here: https://github.com/gripped/vkBasalt-working-reshade-shaders)
effects = cas:smaa
Enable vkBasalt by adding 'ENABLE_VKBASALT=1 VKBASALT_LOG_FILE="vkBasalt.log"' to your steam launch options. My finally launch options look like this:
SDL_VIDEODRIVER=x11 ENABLE_VKBASALT=1 VKBASALT_LOG_FILE="vkBasalt.log" gamescope -h 1080 -H 1080 -f -- %command%
And that's it! I hope this will be of some use to somebody