NWN EE userpatch.ini unofficial FAQ
Grymlorde
Member Posts: 121
Disclaimer -- I do not have nor ever had any affiliation with Beamdog or BioWare. What follows is in no way official. It is just a collection of experiences from the members of Neverwinter community and my own.
What is the userpatch.ini?
Userpatch.ini is an initialization file in plain text format that tells NWN.exe to load a set of haks before a module is loaded. This is done for every module, similar to the override folder. In 1.69, this file was called nwnpatch.ini. With EE you can still use nwnpatch.ini but it does not appear to load any GUI elements whereas userpatch.ini will do so.
Why should I care about userpatch.ini?
Because it is a clean and easy way to upgrade the visual appearance of the game. Don't like the standard goblins? No problem, load up Cervantes' Creature Compilation and now all goblins look a lot better (IMHO). Don't like the astroturf-looking fake grass in the rural tileset? Load up BioRural from Zwerkules or Toro's Expanded Rural and get a much, much better looking rural tileset (IMHO). Another consideration is that there is performance boost from preloading haks rather than filling up the override with individual files. In v1.69, having too many files in the override became an issue. This might be fixed in EE or might now.
Awesome! How do I set it up?
Create a text file using your favorite text editor (e.g. Notepad) in your Neverwinter Nights directory (e.g. \My Documents\ Neverwinter Nights) and save it as "userpatch.ini" Then add the following lines:
Note that the order is important. The first hak is loaded first, the second is loaded second and so on. The second hak overrides the first, the third overrides the second, and so on. This is important to know because some haks have some overlap with others. So if you like LoW's ghouls better than the one in Cervante's hak, then make sure you load Cervantes' hak before you load Low's Ghoul hak.
Updating your nwn.ini file
In order for NWN to know that it has a userpatch.ini to use, you must first change your nwn.ini file. Find the "[Alias] section and copy & paste the path to the hak files and rename "Hak=" to "Patch=":
Are there any limits?
Yes! In NWN v1.69 (might be different in EE) there is a limit of 56 haks that can loaded in total -- this includes all the haks in the module itself. There does not however, appear to be a limit in the size of an individual hak itself.
Are there any bugs or issues with this method?
In 1.69 (not yet tested in EE), all haks had to have significantly different names. According to PsteMarie, “x4_females” were originally named “x4_anatomy1,” “x4_anatomy2,” and “x4_anatomy3” respectively; it appeared that only “x4_anatomy3” was loading. This would seem to indicate some sort of hardcoded value that the engine limits the number of strings the engine reads from the filenames in patch.ini. If the files are the same name up to this string value, only the topmost file is in the hierarchy is loaded."
What about the override folder? Is it obsolete?
It just might be... I'll leave it to others to make a case for still using the override folder.
Warning for Builders!!!
It should be obvious, but it's worth saying -- If you build your module with userpatch haks instead of including haks in the module, then that content will NOT appear when you distribute your module. Not only that, but it will load in the toolset without warning the user that a particular hak is required. My advice is to include all haks in your module that you need rather than counting on the user loading them in the userpatch.
There is no patch directory! Do I have to create one?
No you do not. In 1.69 you either had to copy your haks into the patch directory or change the nwn.ini file to have the patch point to the hak directory. In EE, the nwn.ini file defaults to pointing patches to the hak directory.
Credits & Thanks
Thanks to @virusman, Dagesh, @Pstemarie, @Shadooow , & Bannor Bloodfist for contributing to the original discovery and discussion on the old social.bioware boards. Thanks also to @Symphony for telling us to use userpatch.ini instead of nwnpatch.ini and to @Proleric for discovering that userpatch.ini loads UI elements whereas nwnpatch.ini does not.
What is the userpatch.ini?
Userpatch.ini is an initialization file in plain text format that tells NWN.exe to load a set of haks before a module is loaded. This is done for every module, similar to the override folder. In 1.69, this file was called nwnpatch.ini. With EE you can still use nwnpatch.ini but it does not appear to load any GUI elements whereas userpatch.ini will do so.
Why should I care about userpatch.ini?
Because it is a clean and easy way to upgrade the visual appearance of the game. Don't like the standard goblins? No problem, load up Cervantes' Creature Compilation and now all goblins look a lot better (IMHO). Don't like the astroturf-looking fake grass in the rural tileset? Load up BioRural from Zwerkules or Toro's Expanded Rural and get a much, much better looking rural tileset (IMHO). Another consideration is that there is performance boost from preloading haks rather than filling up the override with individual files. In v1.69, having too many files in the override became an issue. This might be fixed in EE or might now.
Awesome! How do I set it up?
Create a text file using your favorite text editor (e.g. Notepad) in your Neverwinter Nights directory (e.g. \My Documents\ Neverwinter Nights) and save it as "userpatch.ini" Then add the following lines:
[Patch] PatchFile000=XYZ PatchFile001=Another Hak PatchFile002=Yet_Another_HakWhere "XYZ" is a particular hak you wish to pre-load. Note that there is a blank line between [Patch] and the first PatchFile entry and between the first and subsequent PatchFile entries.
Note that the order is important. The first hak is loaded first, the second is loaded second and so on. The second hak overrides the first, the third overrides the second, and so on. This is important to know because some haks have some overlap with others. So if you like LoW's ghouls better than the one in Cervante's hak, then make sure you load Cervantes' hak before you load Low's Ghoul hak.
Updating your nwn.ini file
In order for NWN to know that it has a userpatch.ini to use, you must first change your nwn.ini file. Find the "[Alias] section and copy & paste the path to the hak files and rename "Hak=" to "Patch=":
Hak=C:\Users\YOURNAME\Documents\Neverwinter Nights\hak Patch=C:\Users\YOURNAME\Documents\Neverwinter Nights\hakNote that your actual path may look different from this. Just ensure that "Patch" points to the exact same place as "Hak" does.
Are there any limits?
Yes! In NWN v1.69 (might be different in EE) there is a limit of 56 haks that can loaded in total -- this includes all the haks in the module itself. There does not however, appear to be a limit in the size of an individual hak itself.
Are there any bugs or issues with this method?
In 1.69 (not yet tested in EE), all haks had to have significantly different names. According to PsteMarie, “x4_females” were originally named “x4_anatomy1,” “x4_anatomy2,” and “x4_anatomy3” respectively; it appeared that only “x4_anatomy3” was loading. This would seem to indicate some sort of hardcoded value that the engine limits the number of strings the engine reads from the filenames in patch.ini. If the files are the same name up to this string value, only the topmost file is in the hierarchy is loaded."
What about the override folder? Is it obsolete?
It just might be... I'll leave it to others to make a case for still using the override folder.
Warning for Builders!!!
It should be obvious, but it's worth saying -- If you build your module with userpatch haks instead of including haks in the module, then that content will NOT appear when you distribute your module. Not only that, but it will load in the toolset without warning the user that a particular hak is required. My advice is to include all haks in your module that you need rather than counting on the user loading them in the userpatch.
There is no patch directory! Do I have to create one?
No you do not. In 1.69 you either had to copy your haks into the patch directory or change the nwn.ini file to have the patch point to the hak directory. In EE, the nwn.ini file defaults to pointing patches to the hak directory.
Credits & Thanks
Thanks to @virusman, Dagesh, @Pstemarie, @Shadooow , & Bannor Bloodfist for contributing to the original discovery and discussion on the old social.bioware boards. Thanks also to @Symphony for telling us to use userpatch.ini instead of nwnpatch.ini and to @Proleric for discovering that userpatch.ini loads UI elements whereas nwnpatch.ini does not.
Post edited by Grymlorde on
13
Comments
Additionally, there are some game resources, that only seem to go into effect if placed in a hak instead of in the override folder.
To this date, for checking work in game, instead of using the override folder I use a hak called override.hak that's in my patch folder, which allows me to turn off my work in progress at a moment's notice if I need to go be a dungeonmaster for an afternoon on short notice.
Thanks for the post @Grymlorde .
My installation did not automatically have a PATCH path in nwn.ini, and it took me a while to notice this as I tried in vain to get userpatching to work.
Add this underneath [Alias]
PATCH=patchpathhere
This was not the case in 1.69 as you could see what the patch hak modified when you opened a module in the toolset. It may not be the biggest deal, but it was still nice to be able to see what things will really look like in-game when designing in the toolset.
This is done at the resource level, so if the resources are not identical, the module versions prevail, except for any resources which are only in the patch hak.
D :\Beamdog\00829
My PATCH entry in C:\Users\calg\Documents\Neverwinter Nights\nwn.ini
PATCH=C:\Users\calg\Documents\Neverwinter Nights\hak
My userpatch.ini:
[Patch]
PatchFile000=MageWeapons.hak
PatchFile000=MageWeapons
The purpose of the userpatch.ini is to overwrite existing content, not to add new content. To add new content, you need to edit the module in the toolset and add the haks. For example, I like Cervante's Creature Override Compilation and use that because I prefer the way those monsters look rather than the stock NWN ones. I also like the footman's mace in CEP but there's no way to add it to a module without editing the module itself.
You can use Project Q as a patch hak as it overwrites existing content.
@Sylvus_Moonbow Thank you, I think i'm gettin it now. I tried the PRC and it comes with modified original campaign files (.nwm). I put those in the right places, but when I go to create a character my device (Android) hangs at gender. I tried using project Q, but no dice. The OC campaigns have to be modified right? I saw that project q, i think 2.0 comes has modified oc's. Will those work with 3.0?
Thank you guys for trying to help. There should be a sticky thread or something that lays this out better.
https://forums.beamdog.com/discussion/comment/970346
The higher number patches are loaded later, so, overlap, in the form of recurring file names, in later loaded content will replace earlier files with the same name entirely. This isn't much different from what might happen if you "dragged and dropped" a bunch of files on your computer to the same folder, and chose "replace all" for each action. The newer files replace the pre-existing ones.
In the toolset, these "newer" files would be in .hak packages at the top of the "Custom Content" window list, but in userpatch.ini, these would be the .hak packages with the highest numbers, at the bottom of the list.
The new settings.tml different file you're looking at doesn't have or need anything regarding patch haks.
Everything is the same as per the guidance above.
PS: In the old days, the conventional wisdom (according to my notes) held that "when overwriting standard game resources, TGA files belong in the override and DDS files belong in a hak. For some reason, TGA files in a hak will NOT overwrite standard resources. Likewise, DDS files in the override will NOT overwrite standard resources." Is this still an issue in the EE?
The only restriction I'm aware of is that (last time I checked) .tga files don't work in a patch hak (which is different from a regular hak). That might have changed now.
When texture files have the same name (apart from the .dds or .tga suffix) the rule for which file trumps the others is
DDS in override >
TGA in override >
DDS in ERF (hak, patch-hak, texturepack) >
TGA in ERF (hak, patch-hak, texturepack) >
DDS in BIF >
TGA in BIF
if I've understood the developers correctly.
This is different from the resource hierarchy for all other files, which you can see in game - enter developer debug mode (CTRL-SHIFT-F12) then check Resman.
My personal recommendation is that outside of certain cases (like icons), you should avoid TGA, and use it for prototyping content in /development or /override, convert to DDS to make sure it still works and looks good in /development and /override, and then package into .hak. Or in this case, Patch Hak.
A lot of the confusion about the hierarchy before was that there was no format hierarchy, it was a time hierarchy. Patch haks were loaded after overrides so they replaced them. Module haks were loaded after base game assets, so those replaced also, when there were name collisions.
Texturepacks somewhat screwed things up here since they were loaded / unloaded at random times, causing a lot of confusion for overriders with TGA's and DDS's, so we're lucky they are no longer a factor.
For creation I've personally stopped using TGA all-together (except for icons and other no-DDS assets), and do everything in PNG with Blender and Gimp etc, keep PNG masters, and export my PNG's to /development as DDS's to test content, before exporting those PNG's to DDS for haks. The superiority of the DDS format, however, is worthy of a separate topic.
TR
However, it’s most likely that you just needed to use higher resolution textures for specific details, and TGA is a dead anchor in that department.
My textures are all DDS unless they are used for animated textures like water and lava or the small map icons.
The old version of biomines still has a few TGA textures that could be DDS.