Star Wars: Knights of the Old Republic
Knights of the Old Republic
Oh, I don't mind, I rather enjoy fixing (or breaking) stuff like this, It almost seems like the game may be rendering the black bar *in front* of the text, since you can click on it but cannot see it. One would think that with a vert resolution of 768 there would be no problem as the game runs natively at 1024x768 without display errors. So it seems like you are right about it being hard coded. At least we tried :D
Knights of the Old Republic
Note that UniWS can perform the hex edits needed for the movies (which do work, I made a typo before), it just needs the appropriate groups added to the patches.ini file. I have included these below. I'll PM Ibrin tomorrow to update the patches.ini with these (if he doesn't see this post before I get to him). But for now I need to sleep :wink:
Here's the new groups for the 800x600, 1024x768, and 1600x1200 interface sections.
Here's the entries for 1280x960 and 1280x1024 interfaces Same thing, just needed different prefixes becuse there are more groups for these two.
Here's the new groups for the 800x600, 1024x768, and 1600x1200 interface sections.
Code: Select all
;movies edit 1
p4modfile=swkotor.exe
p4undofile=swkotorc.undom1
p4sig=800200007515813DD8D17800E001
p4sigwild=00000000000000
p4xoffset=0
p4yoffset=12
p4occur=1
;movies edit 2
p5modfile=swkotor.exe
p5undofile=swkotorc.undom2
p5sig=80020000C7442410E001
p5sigwild=0000000000
p5xoffset=0
p5yoffset=8
p5occur=1
Here's the entries for 1280x960 and 1280x1024 interfaces Same thing, just needed different prefixes becuse there are more groups for these two.
Code: Select all
;movies edit 1
p6modfile=swkotor.exe
p6undofile=swkotorc.undom1
p6sig=800200007515813DD8D17800E001
p6sigwild=00000000000000
p6xoffset=0
p6yoffset=12
p6occur=1
;movies edit 2
p7modfile=swkotor.exe
p7undofile=swkotorc.undom2
p7sig=80020000C7442410E001
p7sigwild=0000000000
p7xoffset=0
p7yoffset=8
p7occur=1
Knights of the Old Republic
Note that UniWS can perform the hex edits needed for the movies (which do work, I made a typo before), it just needs the appropriate groups added to the patches.ini file. I have included these below. I'll PM Ibrin tomorrow to update the patches.ini with these (if he doesn't see this post before I get to him). But for now I need to sleep
I was thinking of doing this but was worried about other localization versions being different. Do you think it would be best to seperate the movies from the rest? Or leave the original entries intact and have additional ones for the movies?
Knights of the Old Republic
I was thinking of doing this but was worried about other localization versions being different. Do you think it would be best to seperate the movies from the rest? Or leave the original entries intact and have additional ones for the movies?
Presumably that hex string is from a code block that's the same regardless of the localization. If it's not present, UniWS will just skip it.
I'm confident we can make it a part of the existing edits safely.
- skipclarke
- Founder

- Posts: 7358
- Joined: 13 Oct 2003, 05:00
Knights of the Old Republic
I've uploaded the new patches.ini within the uniws.zip file. Just so I'm clear, this adds support to get the movies in widescreen, and more resolutions for the HUD?
Knights of the Old Republic
I've uploaded the new patches.ini within the uniws.zip file. Just so I'm clear, this adds support to get the movies in widescreen, and more resolutions for the HUD?
Movies only.
Knights of the Old Republic
I've uploaded the new patches.ini within the uniws.zip file. Just so I'm clear, this adds support to get the movies in widescreen, and more resolutions for the HUD?
Yeah movies only Ibrin, sorry if I wasn't clear. Basically it does all three hex editing steps that Tanuki descrived in the first post now. Fixing the hud as Malakaius did is not a hex editing process.
Knights of the Old Republic
Sorry to double post and bump this up again, but I just wanted to remind the appropriate people that the confirmed solution and the detailed report should be updated to note that UniWS will now perform all hex edites neccessary.
Knights of the Old Republic
hello
I do not manage to have the hud has 1280x1024
or I have 800x600 or 1680x???? I have the bottom of the hud which disappears
can somebody help me?
thank you
P.S.
sorry for my bad english :oops:
I do not manage to have the hud has 1280x1024
or I have 800x600 or 1680x???? I have the bottom of the hud which disappears
can somebody help me?
thank you
P.S.
sorry for my bad english :oops:
Knights of the Old Republic
sorry for my bad english
That is no crime as this is the WWW. However, we cannot understand your problem.
What resolution are you trying to play KOTOR in?
Knights of the Old Republic
i have 22" in 1680x1050
it is ok resolution 1680x1050
my probleme is HUD
i follow step by step but "up hud" ok and "down hud" disappear
and impossible 1280x1024
800x600 or 1680x????
link:
http://www.hiboox.com/lang-fr/image.php?img=mik0hljx.jpg hud 800x600
http://hiboox.com/lang-fr/image.php?img=d75cae1g.jpg hud 1680x????
it is ok resolution 1680x1050
my probleme is HUD
i follow step by step but "up hud" ok and "down hud" disappear
and impossible 1280x1024
800x600 or 1680x????
link:
http://www.hiboox.com/lang-fr/image.php?img=mik0hljx.jpg hud 800x600
http://hiboox.com/lang-fr/image.php?img=d75cae1g.jpg hud 1680x????
Knights of the Old Republic
i have 22" in 1680x1050
it is ok resolution 1680x1050
my probleme is HUD
i follow step by step but "up hud" ok and "down hud" disappear
and impossible 1280x1024
800x600 or 1680x????
OK. The HUD you need to use for your resolution is 1280x1024.
Is the UniWS not working? Are you selecting the 1280x1024 HUD?
Have you tried this...?

Knights of the Old Republic
yes execute uniws !!
and
use hex editor
my problem persiste !!
said me what I must change in his lines to have 1680x1050 with a HUD has 1280x1024
3D 20 03 00 00 75 12 81 7C 24 08 58 02 00 00 75 5B B8 01 00 00 00 C2 08 00 3D 00 04 00 00 75 12 81 7C 24 08 00 03 00 00 75 42 B8 01 00 00 00 C2 08 00 3D 00 05 00 00 75 1A 8B 44 24 08 3D C0 03 00 00 74 07 3D 00 04 00 00 75 21 B8 01 00 00 00 C2 08 00 3D 40 06 00 00 75 12 81 7C 24 08 B0 04 00 00
3D 00 04 00 00 B3 29 88 9C 24 D4 01 00 00 74 71 3D 00 05 00 00 74 30 3D 40 06 00 00
2D C0 03 00 00 74 1A 83 E8 40
thanks :)
and
use hex editor
my problem persiste !!
said me what I must change in his lines to have 1680x1050 with a HUD has 1280x1024
3D 20 03 00 00 75 12 81 7C 24 08 58 02 00 00 75 5B B8 01 00 00 00 C2 08 00 3D 00 04 00 00 75 12 81 7C 24 08 00 03 00 00 75 42 B8 01 00 00 00 C2 08 00 3D 00 05 00 00 75 1A 8B 44 24 08 3D C0 03 00 00 74 07 3D 00 04 00 00 75 21 B8 01 00 00 00 C2 08 00 3D 40 06 00 00 75 12 81 7C 24 08 B0 04 00 00
3D 00 04 00 00 B3 29 88 9C 24 D4 01 00 00 74 71 3D 00 05 00 00 74 30 3D 40 06 00 00
2D C0 03 00 00 74 1A 83 E8 40
thanks :)
Knights of the Old Republic
3D 90 06 00 00 75 12 81 7C 24 08 1A 04 00 00 75 5B B8 01 00 00 00 C2 08 00 3D 00 04 00 00 75 12 81 7C 24 08 00 03 00 00 75 42 B8 01 00 00 00 C2 08 00 3D 00 05 00 00 75 1A 8B 44 24 08 3D C0 03 00 00 74 07 3D 00 04 00 00 75 21 B8 01 00 00 00 C2 08 00 3D 40 06 00 00 75 12 81 7C 24 08 B0 04 00 00
3D 00 00 00 00 B3 29 88 9C 24 D4 01 00 00 74 71 3D 90 06 00 00 74 30 3D 00 00 00 00
2D 1A 04 00 00 75 1A 83 E8 00
3D 00 00 00 00 B3 29 88 9C 24 D4 01 00 00 74 71 3D 90 06 00 00 74 30 3D 00 00 00 00
2D 1A 04 00 00 75 1A 83 E8 00
Knights of the Old Republic
Just a little update here. I've been talking with Malakaius and between the two of us, I think we've nailed down that the missing text problem occurs when the lower letterbox pane is less than 100 pixels.
The problem is the height of the letterbox bars appears to be linked to the overall screen aspect. So at 1360x768 bars are much thinner than they are at 1024x768, despite the pixel height being the same. At 1360x768 the lower letterbox bar is only 93 pixels, hence it has the problem. At the custom resolution I setup, 1530x864, the lower bar is 104 pixels, hence that resolution works ok.
This appears to be hardcoded into the game, Malakaius tried decreasing the space used by the dialog options, but it seems the game wants to reserve 100 pixels regardless.
------
Malakaius helped me figure out how to edit the hud. It's an easy process once you know what to do, but it is tedious and time consuming.
I had planned on creating custom huds for all the typical widescreen resolutions, but due to the effort involved and since I'm not sure there's even any demand, I decided not to. However, if requested, I will breifly explain how make the necesarry edits yourself.
In any case I've got it sorted out quite nicely for my custom res.

The problem is the height of the letterbox bars appears to be linked to the overall screen aspect. So at 1360x768 bars are much thinner than they are at 1024x768, despite the pixel height being the same. At 1360x768 the lower letterbox bar is only 93 pixels, hence it has the problem. At the custom resolution I setup, 1530x864, the lower bar is 104 pixels, hence that resolution works ok.
This appears to be hardcoded into the game, Malakaius tried decreasing the space used by the dialog options, but it seems the game wants to reserve 100 pixels regardless.
------
Malakaius helped me figure out how to edit the hud. It's an easy process once you know what to do, but it is tedious and time consuming.
I had planned on creating custom huds for all the typical widescreen resolutions, but due to the effort involved and since I'm not sure there's even any demand, I decided not to. However, if requested, I will breifly explain how make the necesarry edits yourself.
In any case I've got it sorted out quite nicely for my custom res.

Knights of the Old Republic
Someone requested it, so here are the instructions.
Use UniWS to patch Kotor to your desired widescreen resolution. For the sake of this example, choose the 1024x768 interface regardless of whether or not it's the best suited to your chosen resolution. It doesn't matter since you'll be completely changing it anyway.
First you need to download two tools: Kotor Tool (click download on top right of page) and K-GFF. Kotor Tool requires .NET 1.1, which you can get here.
1. Install Kotor Tool. K-GFF is just a simple executable, extract it somewhere where it's handy.
2. Run Kotor Tool, it will ask you to locate your Kotor install directory, do so.
3. You'll see a treeview of the files stored in Kotor's content archives. Expand BIFs, then gui.bif, then GUI Elements
4. Highlight the file mipc210x7.gui and then click the extract button, save it to somewhere handy.
Note: The various mipc2***.gui files are the different HUDs for the different resolutions. In this case, because I specified you choose the 1024x768 interface in UniWS you should extract mipc210x7.gui. Had you chosen 1280x960 in UniWS, you'd need to extract mipc212x9.gui, and so on.
5. Run K-GFF and open the exported file. Choose "All Files" in the file type dropdown to access it. What you'll see is a kind of ugly long list of structures with various properties. Each one of these structures corresponds to an element on the HUD. Each structure has an EXTENT section under which you'll see 4 properties HEIGHT, LEFT, TOP, WIDTH. These define the position, in plain old pixel values, for the hud element. Here's an example of what you're looking for; you'll be editing a lot of these:
6. Basically now you just have a bunch of busy work ahead of you. First we'll get everything lined up with the bottom of the screen. You need to scroll through the file slowly and look for anything where the TOP value is greater than 600, which means it's one of the hud elements at the bottom of the screen. You then need to offset this value by the difference in height between the interface resolution and the resolution you're using.
For example, say your resolution is 1680x1050, since we're using the 1024x768 interface, that's a +282 pixel difference in height between the two resolutions. So you just add 282 to anything where the TOP value is over 600. In the picture above, we'd change the TOP value to 958 (676 + 282).
Just highlight the entry in the treeview, then type the new value in the section on the right.
7. After editing all the TOP values you may want to save the file at this point and test it in game. All you need to do is put the file the Override directory in your Kotor install directory (the Override directory should already exist by default).
8. Next we want to get the menu buttons and action buttons (medkits, etc) lined up with the right side of the screen. Same basic concept. Look for anything where the LEFT value is greater than 700 and adjust by the difference between the width of the interface resolution and your chosen widescreen resolution.
Again say you're using 1680x1050, that's a +656 width difference with 1024x768. So if the LEFT value for an entry was 840, you'd change it to 1496 (840 + 656).
9. At this point you can probably save the file and be happy. However, if you want it to be 100% perfect you'll need to adjust the combat command queue which should show up centered. Look for entries where the LEFT value is between 400 and 600. In this case, you want to adjust by half the difference in width.
E.g. The width difference for 1680x1050 is 656 as said above, half that is 328. If the original LEFT value is 498, you'd change it to 826 (498 + 328).
10. Lastly, you'll also want to center the combat message box. There's two structures related to this and they both have LEFT values of 198. Look for the TAGs: LBL_CMBTMSGBG and LBL_CMBTMODEMSG. These are the first and fourth structures in the file respectively. Adjust these by half the difference in width as you did in #9.
That's it. As described in #7, just save the file, put it in your Override directory and you'll be good to go.
------
Special notes:
-As far as I know, the interface size that you choose in UniWS affects only this on screen interface that we're editing here. It does not affect the menu screens and other 2D overlays (Pazaak, etc). In fact those are a constant size even in the normal game (and thus are tiny at high resolutions). So, if your editing the interface, it should matter what interface size you choose in UniWS as long as you work off the right interface file.
I suggest you work off the 1024x768 interface just to keep things standard. That way, theoretically, if we get edited interfaces for all the typical widescreen resolutions based on the 1024x768 file, we can just remove all the other interface options from UniWS and instead provide the appropriate files with it.
-This will not fix the missing tooltips. Haven't bothered to go through that yet, I will do so later. AFAIK the tooltips are just for the menu buttons at the top right of the screen, they're easy enough to identify by icon anway. The action buttons still have tooltips regardless.
-This is for Kotor 1 only. Kotor 2 uses dynamic hud placement which should put the icons in the correct positions even for non-standard resolutions (though they do stretch).
-Hardcoding the interface positions and providing a different file for each supported resolution is a really "ghetto" way of doing things, if you'll pardon the vernacular. I'm surprised Bioware programmed it this way. So much more inefficient and inflexible than having one resolution indepedant hud layout which then places the elements dynamically based on the active resolution - that's pretty much how every other game does it.
Use UniWS to patch Kotor to your desired widescreen resolution. For the sake of this example, choose the 1024x768 interface regardless of whether or not it's the best suited to your chosen resolution. It doesn't matter since you'll be completely changing it anyway.
First you need to download two tools: Kotor Tool (click download on top right of page) and K-GFF. Kotor Tool requires .NET 1.1, which you can get here.
1. Install Kotor Tool. K-GFF is just a simple executable, extract it somewhere where it's handy.
2. Run Kotor Tool, it will ask you to locate your Kotor install directory, do so.
3. You'll see a treeview of the files stored in Kotor's content archives. Expand BIFs, then gui.bif, then GUI Elements
4. Highlight the file mipc210x7.gui and then click the extract button, save it to somewhere handy.
Note: The various mipc2***.gui files are the different HUDs for the different resolutions. In this case, because I specified you choose the 1024x768 interface in UniWS you should extract mipc210x7.gui. Had you chosen 1280x960 in UniWS, you'd need to extract mipc212x9.gui, and so on.
5. Run K-GFF and open the exported file. Choose "All Files" in the file type dropdown to access it. What you'll see is a kind of ugly long list of structures with various properties. Each one of these structures corresponds to an element on the HUD. Each structure has an EXTENT section under which you'll see 4 properties HEIGHT, LEFT, TOP, WIDTH. These define the position, in plain old pixel values, for the hud element. Here's an example of what you're looking for; you'll be editing a lot of these:
6. Basically now you just have a bunch of busy work ahead of you. First we'll get everything lined up with the bottom of the screen. You need to scroll through the file slowly and look for anything where the TOP value is greater than 600, which means it's one of the hud elements at the bottom of the screen. You then need to offset this value by the difference in height between the interface resolution and the resolution you're using.
For example, say your resolution is 1680x1050, since we're using the 1024x768 interface, that's a +282 pixel difference in height between the two resolutions. So you just add 282 to anything where the TOP value is over 600. In the picture above, we'd change the TOP value to 958 (676 + 282).
Just highlight the entry in the treeview, then type the new value in the section on the right.
7. After editing all the TOP values you may want to save the file at this point and test it in game. All you need to do is put the file the Override directory in your Kotor install directory (the Override directory should already exist by default).
8. Next we want to get the menu buttons and action buttons (medkits, etc) lined up with the right side of the screen. Same basic concept. Look for anything where the LEFT value is greater than 700 and adjust by the difference between the width of the interface resolution and your chosen widescreen resolution.
Again say you're using 1680x1050, that's a +656 width difference with 1024x768. So if the LEFT value for an entry was 840, you'd change it to 1496 (840 + 656).
9. At this point you can probably save the file and be happy. However, if you want it to be 100% perfect you'll need to adjust the combat command queue which should show up centered. Look for entries where the LEFT value is between 400 and 600. In this case, you want to adjust by half the difference in width.
E.g. The width difference for 1680x1050 is 656 as said above, half that is 328. If the original LEFT value is 498, you'd change it to 826 (498 + 328).
10. Lastly, you'll also want to center the combat message box. There's two structures related to this and they both have LEFT values of 198. Look for the TAGs: LBL_CMBTMSGBG and LBL_CMBTMODEMSG. These are the first and fourth structures in the file respectively. Adjust these by half the difference in width as you did in #9.
That's it. As described in #7, just save the file, put it in your Override directory and you'll be good to go.
------
Special notes:
-As far as I know, the interface size that you choose in UniWS affects only this on screen interface that we're editing here. It does not affect the menu screens and other 2D overlays (Pazaak, etc). In fact those are a constant size even in the normal game (and thus are tiny at high resolutions). So, if your editing the interface, it should matter what interface size you choose in UniWS as long as you work off the right interface file.
I suggest you work off the 1024x768 interface just to keep things standard. That way, theoretically, if we get edited interfaces for all the typical widescreen resolutions based on the 1024x768 file, we can just remove all the other interface options from UniWS and instead provide the appropriate files with it.
-This will not fix the missing tooltips. Haven't bothered to go through that yet, I will do so later. AFAIK the tooltips are just for the menu buttons at the top right of the screen, they're easy enough to identify by icon anway. The action buttons still have tooltips regardless.
-This is for Kotor 1 only. Kotor 2 uses dynamic hud placement which should put the icons in the correct positions even for non-standard resolutions (though they do stretch).
-Hardcoding the interface positions and providing a different file for each supported resolution is a really "ghetto" way of doing things, if you'll pardon the vernacular. I'm surprised Bioware programmed it this way. So much more inefficient and inflexible than having one resolution indepedant hud layout which then places the elements dynamically based on the active resolution - that's pretty much how every other game does it.
Knights of the Old Republic
stevedroid - very cool, thank you for your hard work and for sharing it with us.
I followed your instructions for KOTOR2 up to step 6, then I realized that there really is a lot of work involved having to calculate and change all of those values manually. It must be a good 30-60 minutes worth of work.
Here's a request to whoever may be inclined: a program that would automate this process. I wouldn't think it difficult, but my programming skills leave much to be desired. Ask the user for their desired resolution, read the file, do the calculations, save the file, and bring home the bacon.
I followed your instructions for KOTOR2 up to step 6, then I realized that there really is a lot of work involved having to calculate and change all of those values manually. It must be a good 30-60 minutes worth of work.
Here's a request to whoever may be inclined: a program that would automate this process. I wouldn't think it difficult, but my programming skills leave much to be desired. Ask the user for their desired resolution, read the file, do the calculations, save the file, and bring home the bacon.
- skipclarke
- Founder

- Posts: 7358
- Joined: 13 Oct 2003, 05:00
Knights of the Old Republic
The WSGF would pay a bounty to anyone who can roll the res hack and the HUD hack into one program for both KOTOR and KOTOR2. Not sure of the time it would take. I would want this to support all common resolutions, including Surround resolutions. That is, except for 1280x720, which isn't playable.
Not sure what this would take, so I'm not sure what it would be worth. PM me if interested.
Not sure what this would take, so I'm not sure what it would be worth. PM me if interested.
Knights of the Old Republic
Here's a request to whoever may be inclined: a program that would automate this process. I wouldn't think it difficult, but my programming skills leave much to be desired. Ask the user for their desired resolution, read the file, do the calculations, save the file, and bring home the bacon.
Meh it's around and hour of work, 1 time, for maybe like 3-4 resolutions; that's not a lot of work. Once one person does them it's done. The idea is that someone would do the res they need, then its done and make available for everyone else. Then someone else does one of the other resolutions, etc.
It would take a lot more effort and time to code a program to automate this process - so it'd be kind of pointless.
If no one else can be bothered to invest a measly hour of their time, I'll do at least 1680x1050 and 1920x1080 this upcoming weekend.
Who is online
Users browsing this forum: No registered users and 3 guests

