Deployment and Installation of Custom Content in NWN2
There are several ways to get custom content into the game, but not all are
equal. Some have advantages over others and some can actually break your game
install making you unable to patch your game. This document will describe various
methods and highlight best practices.
Information valid for minimum game version: 1.04.
A note about NWN2 resource handling:
The game manages resources from a number of possible repositories. These repositories
include the .zip archives in the \data folder, resources contained in the .mod
file itself, resources placed in the Override folder, resources placed in a
campaign folder and resources contained in a hakpak associated to the module.
The game reads these resources in using a hierarchical methodology. This means
that resource repositories are placed in a "pecking order", so to
speak. In short, each repository has a priority status. What this means is that
the same piece of content placed in the repositories will be overridden by the
content in the highest priority repository. So, placing a placeables.2da file
into the Override directory will mean that that particular 2da is now the one
the game will use instead of the placeables.2da contained in the 2da.zip under
the C:\Program Files\Atari\Neverwinter Nights 2\Data folder. The Override
folder is higher up the pecking order than the .zip archives in the \data folder.
This is how we get content into the game without altering the base content
-- we place our content into a repository that has a higher priority than the
default resources. We can add new content this way and overwrite base content
all without ever messing with the default game resources.
Adding content to the .zip archives in the \data folder:
Okay, this is a big no-no. These archives are typically located under C:\Program
Files\Atari\Neverwinter Nights 2\Data and contain most of the data the game
uses. Model files, texture files, 2da files and lots of other types reside in
these .zip archives. The thing to remember about these files is that they are
Obsidian's files. They are Obsidian's to patch and maintain. And this means
that if you alter them in the slightest you can cause the patch process to fail.
The patch process relies upon comparing the file on your harddrive to a signature
the patch has for that file. Altering the file can and will alter the signature
which means the patcher won't know what to do with the file since it is different
than the file it has the instructions for patching. There is no reason or need
to alter these archives in any way. So, don't do it and don't tell anyone
else to do it.
Adding content to the Override directory:
This method is less harmful than altering the .zip archives; however, it is
not ideal. The Override directory is typically located at C:\Documents and
Settings\YOUR_LOGIN_NAME\My Documents\Neverwinter Nights 2\override. It
should be noted that another Override directory can be found at C:\Program
Files\Atari\Neverwinter Nights 2\Override but you should leave anything
under the install directory unaltered. Anything found in the install directory
should be able to be mirrored in the C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\ directory structure. The reasons for only
adding content to the My Documents version of the directories are:
- Working under a single path is easier.
- You don't have to worry about resources conflicting between the two directory
paths.
- Uninstalling the game will not uninstall any custom content you have installed.
Adding content to the Override directory is not ideal because you are dealing
with loose files. Managing masses of loose files can be cumbersome and time
consuming when you get a fair number of them. Also, loose files run the risk
of being overwritten when you place more content into the directory. If you
have several custom content packages you wish to install, then it becomes possible
for one package to overwrite some of the content of another package and this
will break the functionality of some of the content or even core game functionality.
Also, files added to the Override directory are active for any and all game
sessions the user launches. That is, they are active playing the Official Campaign,
they are active for any modules you download and play as well as any online
sessions you play. While this may be desirable in some situations, it also means
that you could be creating conflicts with other custom content in use by the
module or online world you are playing.
Adding content to the Campaign directory:
This is something I don't have any real experience with. Basically, it is a
module specific Override folder. I believe the main advantage is that a campaign
can carry over journal entries between modules that share the same campaign
folder. In terms of adding custom content, I would still recommend a hakpak
solution for integration of custom content into a campaign.
Adding content using a hakpak:
This is the preferred method of custom content distribution. A hakpak is simply
an archive file (like a .zip, but not compressed) which holds numerous other
files. hakpaks are placed in the C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\hak folder. Unlike the Override directory
method, hakpaks are only in effect for the module they are associated to. This
means they will not alter any game sessions where the module being played doesn't
have the hakpak attached to it. This makes hakpaks much more of a targeted approach
to custom content deployment; whereas, the override method is much more of a
blunt instrument approach.
This method also avoids the possibility of overwriting some of the files between
custom content packages. Since each hakpak contains all of the files for the
custom content package, there is no possibility of one hakpak overwriting the
contents of another. For example, you could have three custom content packages
for three different modules you downloaded with each hakpak containing a placeables.2da.
Using the Override method you will overwrite the placeables.2da twice when you
unpack the 2nd and 3rd custom content package into the Override -- this will
break functionality of package one and package two. Using the hakpak method
you will have three individual hakpaks sitting in your \hak folder and each
one will only become active when you launch a module that has the hakpak associated
to it. Otherwise, the haks sit innocently in the \hak folder not interfering
with each other or the base game install.
Creating and adding hakpaks:
A lot of misinformation seems to be floating about regarding hakpaks, so I'll
attempt to explain the basics as clearly as possible. As stated above, a hakpak,
at its simplest, is just an archive file. NWN2 did not ship with a tool to let
us create hakpaks, but we do have tools available to let us do this thanks
to the community. NWN2 style hakpaks are slightly different from NWN1 style
hakpaks -- NWN2 uses an updated version of the file format (v1.1 as opposed
to NWN1 v1.0). This means that the hak editor for NWN1 will not give us the
full functionality needed for creating NWN2 hakpaks (for example, it will not
accept any of the new file formats introduced in NWN2 [.mdb, .bbx, .pfx, etc.]).
So, we need a tool to do the job for us. ERFinder
by Tanita is the tool I have been using and it works very well.
There is also another tool I'm aware of called Encapsulated
Resource File Editor by Ranmanu, but I haven't experimented with
it too much. The process for using these tools is relatively straightforward:
you add your custom content files through the program interface and then save
as a .hak giving it a file name. Make sure the hak is in the C:\Documents
and Settings\YOUR_LOGIN_NAME\My Documents\Neverwinter Nights 2\hak folder.
Now, we have our hakpak, but a hakpak is not active unless it is associated
to a module. The process of associating a hakpak to a module is done through
the toolset. Open your mod in the toolset and go to View --> Module Properties.
In the properties tab you will see a listing for hakpaks. Click on it. A new
window will open. Click the Add button and a new entry will appear on the top
right. Click where it says FileName, navigate to your C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\hak folder and choose your hakpak. Press
OK, save your module and you're done. Whatever the hak adds or changes should
now be active in the toolset for that module as well as active in-game when
that module is played.
Multiple hakpaks:
Multiple hakpaks can be attached to a single module. They are added in the
same way as described above. As you add hakpaks you will see the list on the
top left of the hakpak interface panel grow. As mentioned above, hakpaks are
safer than loose files because you can never run the risk of overwriting a file
when installing multiple packages. However, this doesn't mean you don't need
to deal with resource conflicts at all. If you have two or more hakpaks that
contain the same resource, then you will have a resource conflict. The way this
is dealt with is the same as I described above regarding resource repositories
-- hakpaks are subject to a hierarchical priority system. The priority is determined
by the hakpak's position in the hak list displayed on the hakpak interface panel.
You will notice that haks are numbered from 0 onwards. * Currently, the
toolset will take the last hakpak listed as the highest priority hak on the
list. If you had three haks numbered 0, 1 and 2, then the hakpak listed as number
2 would be the highest priority. So, if hakpak number 2 had the same resource
as hakpak number 0 or hakpak number 1, then the resource from hakpak number
2 would be the one used.
The way resource conflicts between haks are resolved is through the creation
of a "master" or "control" hakpak and placing it in the
highest priority position. The idea here is to take your conflicting resources,
merge them and then place them in a hakpak. So, for example, we have two hakpaks that both contain a placeables.2da. The first hakpak adds a placeable
at line 2000 of the 2da and the second hakpak adds a placeable at line 2100.
We would create a placeables.2da where we copy line 2000 from the first hakpak's placeables.2da and a paste it in at line 2000 and then copy in line 2100
from the second placeables.2da. This way we have a single placeables.2da that
contains the entries from both hakpaks (Note: I'm omitting some steps for the
merging of 2da's [i.e. padding] as the subject is beyond the scope of this document).
We then place that new placeables.2da in our control hak and set that hak in
our hak list so it has priority over hak one and two.
Hakpak Issues:
* Note: The priority system is broken as of v1.04. The toolset should be taking
hakpak number 0 as the highest priority. This is the way the game engine reads
it, so when you want to run your module you need to move your haks to the opposite
order.
Sometimes you will find a resource instance or resource type that will not
function from a hakpak. This list is shrinking as Obsidian has been correcting
these issues. If you find something that does not work from a hakpak let Obsidian
know -- they can't fix it if they don't know about it. It should be said that
I have added tiles, placeables, base items, visual effects, GUI .xml files,
.dds textures and more all through the hakpak system alone. So, while you may
find some items that won't function at this time, the problem is not nearly
as wide spread as I have seen some declare it to be. For example, I have seen
"2da's do not work from hakpaks". This is plainly incorrect.
I believe nwn2_deities.2da is not working from a hakpak right now, but that
is far from saying no 2da works from a hakpak. Also, some items that won't work
from a hakpak also don't work from the Override. This is likely because those
resources are from specialized folders like the UI folder. Obsidian also seems
to be working on adding this content to be supported through the hak system
(i.e. the UI .xml files work from haks).
Haks currently aren't loaded until after a player creates a character. This
means any changes to the character creation process you make via a hakpak aren't
in effect until it's too late. Obsidian has stated they will be fixing this
so that all content will be loaded before the player hits the character creation
screen.
FAQ:
Q: I'm just a player. What do I do with haks?
A: Place them in your C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\hak folder. When you downloaded the hak it
probably came in a .zip or .rar file -- you need to unpack it and place the
file(s) with a .hak extension in the folder. You don't need the .rar or .zip
in that folder.
Q: I'm a player and a builder. What do I do with haks?
A: Place them in your C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\hak folder. When you downloaded the hak it
probably came in a .zip or .rar file -- you need to unpack it and place the
file(s) with a .hak extension in the folder. You don't need the .rar or .zip
in that folder.
Q: I'm a player, a builder and a custom content developer. What do I
do with haks and how should I develop content?
A: Place haks in your C:\Documents and Settings\YOUR_LOGIN_NAME\My
Documents\Neverwinter Nights 2\hak folder. When you downloaded the hak it
probably came in a .zip or .rar file -- you need to unpack it and place the
file(s) with a .hak extension in the folder. You don't need the .rar or .zip
in that folder. You can use the Override directory for developing your custom
content as it easier to add/remove files from it than updating a hakpak numerous
times as you make changes. Note that if a file is in a hakpak associated to
a module, then adding that same file to the Override will do nothing for that
module as hakpaks take priority over the Override folder. Best practice is to
develop your content first using the Override directory and a test module with
no haks associated. Then, when your project is complete, package the files from
the Override into a hakpak, associate the hakpak to your test or demo module
and remove the files from the Override. When everything checks out (play your
demo module, open the module in the toolset to see that your content is present,
etc.), package your hak into a .rar or .zip file along with a demo module to
showcase your work, if you wish. You should provide a version number for your
content, a readme file and also ensure your hakpak has a unique name or prefix
(to avoid conflicts with other hak creators). For example, I preface my hak
names with "Heed_". Your initials or anything else fairly unique to
yourself should do.
Enjoy!
Heed. Heed House 2
|