STAR WARS™ Knights of the Old Republic™

STAR WARS™ Knights of the Old Republic™

40 ratings
Knights of the Old Republic Part 1 on Linux with Steam Play / Proton (Quick 'n Dirty Guide)
By Abn0mad
Unlike Knights of the Old Republic Part 2, Part 1 does not run natively on Linux and hasn't received any fixes or updates since... well forever I guess. Thanks to Steam Play / Proton however - this is a quick fix :)
   
Award
Favorite
Favorited
Unfavorite
KOTOR 1 on Linux - Quick 'n Dirty Fix
Step 1: Enable Steam Play for all titles in your game library.

Click on Steam in the upper left corner of the Steam window and click Settings. Click on Steam Play at the bottom of the list on the left side of the window that pops up and enable Steam Play by default like so:

---
---

Step 2: Fix the default KOTOR configuration settings

Open up your favourite terminal and edit the KOTOR configuration file like so:

vi ~/.steam/steam/steamapps/common/swkotor/swkotor.ini

or like so:

nano ~/.steam/steam/steamapps/common/swkotor/swkotor.ini

Then scroll down to the graphics section of the file and add or edit the lines there like so:

---
---

Pay extra attention to the lines:

Height=768 Width=1024

and:

EnableHardwareMouse=1 FullScreen=0 AllowWindowedMode=1


The first of which determine the window size and the latter of which allow the game to start properly.

---

Step 3: Disable Steam Overlay

Although not strictly necessary - I have noticed that the game becomes considerably more stable after disabling the Steam Overlay in game.

To do this navigate to KOTOR in your library, right-click and select properties. Then uncheck "Enable the Steam Overlay while in-game" like so:

---
---

That should do the trick, allowing you to play KOTOR 1 on Linux :)

Note 1: As the game hasn't been updated, it is a 4:3 ratio game - not 16:9 or 16:10

Note 2: It is possible to press Alt+Enter to enter full screen, although effects may vary depending on your setup. The game may run nicely full screen, but may also appear shifted up or down or have mouse control shifted in a weird way. I recommend playing it in Window mode. (This also comes in handy with when playing with a walk-through).

Enjoy :)

---

End Result (@ 1024x768 (higher is possible)


---
15 Comments
qlivion Dec 7, 2024 @ 12:01pm 
Thank you Abn0mad. I find Steam and Bioware should reward you financially.
SigmaSquadron Sep 13, 2021 @ 3:26pm 
Do note that the script below will only work on X11-based graphical stacks. For distros on Wayland, you're better off with UNIWS and a HUD mod.
Abn0mad  [author] Aug 17, 2019 @ 11:11pm 
Put Nobozarb's desired effect in a more universal solution,
Copy-Paste all between --------- :

---------

sudo bash -c "cat > /usr/bin/wine_resfix.sh" << EOF
#!/bin/bash

ACTIVEMONITOR=\$(xrandr --listactivemonitors | awk '{print \$4}')

game_mode() {
xrandr --output \$ACTIVEMONITOR --set "scaling mode" "Full aspect"
xrandr -s \$1
}

desktop_mode() {
xrandr --output \$ACTIVEMONITOR --set "scaling mode" "Full"
xrandr -s \$1
}

case "\$1" in

on)
game_mode \$2
;;
off)
desktop_mode \$2
;;
*) echo ""
echo "Usage: "
echo ""
echo "\$0 on \"desired resolution; e.g. 1024x768\""
echo ""
echo "\$0 off \"normal resolution; e.g. 1920x1080\""
echo ""
;;
esac
EOF

---------

Run:

sudo chmod +x /usr/bin/wine_resfix.sh

Simply add to launch options in steam:

wine_resfix.sh on 1024x768 && %command% && wine_resfix.sh off 1920x1080
Abn0mad  [author] Aug 17, 2019 @ 6:10pm 
@Nobozarb - You're welcome, happy you got it working in your preferred way and thanks for posting back the results :woodlehappy:
Denendaden Aug 17, 2019 @ 2:50pm 
Thanks! I really appreciate your help. I'm very new to this type of stuff but I was able to figure out how to get it working. If anyone comes across this in the future I had two files, .kotorres_on.sh and .kotorres_off.sh, with .kotorres_on.sh setting it to the correct resolution and scaling mode, and .kotorres_off.sh undoing those changes, and then in the Steam launch options I had ~./.kotorres_on.sh && %command% && ~./.kotorres_off.sh
Abn0mad  [author] Aug 17, 2019 @ 8:15am 
@Nobozarb - You're welcome - and nice addition;

That could be wrapped in an on- off type script using (case $1 in ...) with on / off options, or as separate scripts and then attached to launch options in the Steam game menu like:

myscript on && %command% && myscript off

or as:

myscript_on && %command% && myscript_off

as launch option. See my Systemshock 1 guide for a similar solution using a timidity script to enable MIDI audio.
Denendaden Aug 17, 2019 @ 7:05am 
Thanks! I found that then it will stretch the game to fit the screen. In case anyone comes here in the future wanting to do what I did, the following worked to instead just have black edges around the screen:

1. Open a terminal
2. Run 'xrandr' to see what port the monitor is plugged in to (in my case HDMI-A-0)
3. Open a text editor
4. Type the following:
xrandr --ouput [result of step 2] --set "scaling mode" "Full aspect"
xrandr -s 1280x1024 (or whatever resolution you want to play the game in)
read -s
xrandr -s 1920x1080 (or whatever resolution your screen is normally in)
5. Save the file as .kotorres.sh or whatever you want

Now you can just open a terminal and type 'bash .kotorres.sh' and the display will change to the correct resolution, you can play the game, and then when you are done you just close out of the game, go to the same terminal window, and press the Enter key and the resolution will change back.
Abn0mad  [author] Aug 15, 2019 @ 7:44am 
@Nobozarb - temporarily set you desktop resolution to one of the following resolutions (640x480, 800x600, 1024x768 and 1280x1024) and adjust the game configuration to match. The shifting should be gone. After playing restore your desktop resolution to normal. It's a dated game, so it only supports lower resolutions I'm afraid and Wine doesn't play well with scaling between high desktop resolutions and low game resolutions.
Abn0mad  [author] Aug 8, 2019 @ 7:23am 
@ReasonablyTall HD 4K - just add the resolution lines yourself under [Graphics Options] - you can copy the ones in the guide. Remember that this is an old game, so it only supports dated resolutions such as 640x480, 800x600, 1024x768 and 1280x1024.

To be added as:

Height=768
Width=1024

---

The off-center display is due to a Wine limitation which pretty much requires the app / game to have the same resolution as the desktop (this only applies to fullscreen mode though).
ReasonablyTall VR Aug 8, 2019 @ 4:31am 
My .ini doesn't have the height, width, allowwindowmode options. Disabling fullscreen allows the game to start, and I get the splash screens, but when the main menu loads it's 70% off screen to the north. Anyone any idea on how to fix?