Merging Tilesets

From NWN1 Custom Content Guide

Jump to: navigation, search

Contents

[edit] Why Merging ?

Since the toolset accepts multiple haks why would you want to combine 2 (or more) hakpaks in one ? The answer is simple : each hakpak might hold files which must be unique through a module, basically the 2DA files.

Haks are read and loaded one by one in a module, using the order set in the Custom Content dialog of the module. The first 2DA file read by the engine will be the one kept. Futher 2DA (of the same name) won't be read at all.

If you want to use 2 haks that refers the same 2DAs files (like doortypes.2da, loadscreens.2da...) you must take each similar file and create a new one containing the data of both original ones : it's Merging2DA which includes renumbering lines and updating files which refer those lines (palette files).

[edit] Notes before starting

[edit] Type of Tileset Haks

If you surf on the vault you will see ton of hak concerning tilesets.

Original Tileset 
a new tileset, that do not modify existing tiles or tileset at all.
Replacing (or Overriding) Tileset 
the tileset is meant to replace an existing, usually bioware, tileset. Usually it's to change the textures, or to fix bugs.
Re-textured Tileset 
such tileset copies existing tileset into new ones and only change the textures. It's a way to totally change the ambiance of an existing well-known tileset to something totally new : castle interior with white marble or draperies, jungle forest in place of bioware forest, egyptian type crypts, etc. Be careful, because a lot of retexturing, especially early made haks, are overriding not duplicates.
Tileset Add-On 
such hak adds tiles to an existing tileset (bioware, or community made). For the add-on to work, it needs to provide full working .set and .2da files (see below for problems when merging haks).
Super Tileset 
denotes a single tileset that provides a lot of tiles and options. Might have been built by adding tons of add-ons made by various people to the tileset made by the original owner.
Tileset Combo, Merger or Mega Tileset 
a hak file which contains more than one tileset. Combo is more for small ones (2 to 6 ?), Mega is for like, say, 10+.

[edit] Bioware Tilesets

As of NWN 1.65 with SoU and HotU the bioware tilesets are :

Tileset CodeNWNSoUHotUToolset displays as
TCN01 xxxCity Exterior
TDC01 x..Crypt
TDE01 xxxDungeon
TDM01 x.xMines & Caverns
TDR01 .x.Ruins
TDS01 x..Sewers
TIB01 ..xBeholder Caves (why not TDB then ?)
TIC01 x..Castle Interior
TID01 ..xDrow Interior
TII01 ..xIllithid Interior
TIN01 xxxCity Interior
TMS01 x..Micro Set
TTD01 .x.Desert
TTF01 x..Forest
TTI01 ..xFrozen Wastes
TTR01 xxxRural
TTS01 .x.Rural Winter
TTU01 ..xUnderdark

The naming format starts with T for Tileset, followed by a 2 letters indictating the tileset itself (i.e. C for City, D for Dungeon (underground areas), I for Interior, T for Terrain (Exterior)), then 2 numbers for a variation. So you can have two types of Rural tilesets called TTR01 and TTR02 and have TTR02 look totally different (i.e. in the .SET it would reference different models for the same tile).

[edit] What needs attention ?

If you combine 2 haks working on 2 different sets, the only files you have to pay attention to are :

If you work on tileset add-ons working on the same tileset, you will need to pay attention to :

If you work with retexture haks, they might override some of bioware files, for example the door models (xxx_udoor_nn.mdl and .wok). You will have to rename those files (in model files, the file name is also referenced inside the file itself, so renaming isn't that easy) and most probably change some .set or .2da files (for doors, you'll have to create or update doortypes.2da or genericdoors.2da and update .set files).

Some tilesets hak include non tileset related content, like placeables, or creatures. In this case, you also have to merge those files.

[edit] Merging Strategies

There are two ways of providing a merge for two existing haks :

  • create a new hak containing the resources of both original haks, with updated 2da and palette files.
  • create a new small hak providing only the content which needed merge. Place this new merge hak above the both original haks in the module.

Which way you pick depends mostly on the haks you want to combine and whether some of them are already distributed with your module/PW. I think in most case the second is better :

  • if the original file change, without touching their 2DAs, you won't need to re-merge. If the 2DAs changed, it's still possible to update your 'on-top' hak. It's especially adviced with haks provided by community groups (CEP) which tend to evolve often.
  • if people already downloaded the first hak, they don't have to download a new full hak containing what they already have, plus new material. They only download the second hak, and your merge.
  • only drawback is regarding resource shared by both haks, like textures. Since you don't touch the original, a file which exists in both haks will exist twice in your module (only the first read is taken, but the second one takes space at least on disk).

[edit] NWN Version Issues

SoU and HotU and patches comes with modified version of .set or 2da files. If you work with a new tileset built on previous versions of NWN (1.29-, SoU only, etc.), you will probably only have to check for 2da changes. If you work with tileset additions to existing bioware tiles, you will have to check for .set files too.

[edit] CEP Issues

Despite CEP comes with no tileset, it can collide with custom tileset haks, because some will provide sounds or placeables.

As of 1.50, CEP does not provide loadscreens, or skies.


[edit] Let's Merge

[edit] General Procedure

From now on, I'll refer to 'first hak' and 'second hak' the two haks you want to merge. 'Original haks' mean those two haks before being merged. 'Result hak' will be the hak resulting from succesfully merging orginal haks.

I usually proceed by extracting the content of both original hak to 2 different directories (hak1, hak2) - with NWN Explorer or NWHak, then creating a new directory for the result.

The general procedure will be to copy every non conflicting file to the result directory, and then fix every conflict aspect (.2da or .set files appearing in both original haks, bioware overriden files, etc.). The sections below will consider conflict issues and guide you into creating fixed files for your result directory.

[edit] Possible Conflict Issues : .Set

TODO : look into tilset Palette file issues ?

  • 2 tileset used the same tileset code
  • one hak is a add-on to bioware tilesets
  • one hak is a add-on to the other hak

[edit] Possible Conflict Issues : Loadscreens

Merging loadscreens is very easy. Check loadscreens.2da for information on what is a loadscreen and how they are defined in a hak.

Loadscreens only take place in loadscreens.2da file. Each line will refer to a tga files pair (the loadscreen and a thumbnail image). Line numbers must be unique. I would assume they need to appear in ascending order (you don't write down line 200 before you write line 150), you can create empty lines (filling all columns but the line number with stars ****) and seems you can skip numbers (you don't need to create empty line for numbers you don't use). Some say that you can't have more than 250 loadscreens, but I have seen tilesets using line numbers 300+ (maybe it works because the total number of non empty **** lines is lower than 250 ?). Tileset specific lines do not need to be consecutive (see how bioware inserted non drow interior loadscreens between drow02 and drow03 screens).

  • both haks provide different, tileset specific loadscreens

Take loadscreens.2da from both your haks. Compare the non bioware lines (in the end). If non line number conflicts, simple add the lines from the second one at the correct place in the first file. If some line number conflicts, you have to renumber some of the conflicting lines. The line numbers are NOT used in the hak outside the loadscreens.2da file. So the only side effect of changing the line numbers is that if you take a module that used one of the original haks, and in one of its areas it used a specific loadscreen (non-random), and that loadscreen happen to be one of the conflicting lines, then using the module with your new combo hak instead will change the loadscreen image for that area.


  • one hak override some of bioware loadscreen files (tga)
  • both haks provide different loadscreens images but with the same file name

[edit] Possible Conflict Issues : Doors

TODO : check into palette files issues ?

  • both haks provide doors (i.e. doortypes.2da or genericdoors.2da)

With doortypes.2da, just renumber the lines, then look in the .set file for Type=xxx lines (inside [TilennnDoormm] sections) : change the door type numbers according the renumbering made in doortypes.2da. note : with doortypes.2da you must have each line numbers (as opposed to with loadscreens.2da)

  • one hak override some of bioware door models

[edit] Possible Conflict Issues : Skies

  • both haks provide specific Skies

[edit] Possible Conflict Issues : Textures

  • one hak override bioware texture files (tga, dds)
  • both hak come with name conflict in texture files
  • one hak provide dds file to match the other hak tga files

[edit] Possible Conflict Issues : Minimaps

?

[edit] Possible Conflict Issues : Areag.ini

?

Personal tools