For the record, here are the steps I've been using to convert NWN tile sets to NWN2. There may be a better approach, but this has been producing the results I wanted.
To start with, all of the tileset mdl files are loaded into a working directory, along with the texture files. (See the import_mdl_tutorial_v1.0.pdf file for details on how to import mdl files and NWN textures into Blender.) I usually need to convert the texture files into a .dds file suitable for NWN2. (I usually open the .tga file in gimp then export using the gimp-dds plugin with DXT3 compression and generating mipmaps.) Texture files are typically 512x512 or smaller.
The tiles will have names like 'tcn01_a20_01', where the tcn01 is the set prefix and the a20_01 is the tile identifier. Each tile may have a large number of component parts, with names that may not help in identifying their role. What are called metatiles in NWN2 will usually consist of sets of tiles that need to be joined together--they are typically in the higher letter ranges such as j01_01, k01_01, l01_01, j01_02, and so forth.
1. First, I choose a name and letter code for the tile set port. This code is used on every tile and all of each tile's component parts. The convention for the prefix is: TL_XX_YYYY_##, where XX is your letter code, YYYY is the tile type, and ## is the tile variant (which begins with 01). Important: make sure the XX part is completely unique across all NWN2 tilesets and mods. Duplicate part names result in tiles and placeables displaying parts from other tiles or placeables... generally not a good thing.
2. I go through all the useful .mdl tiles, importing them then saving them as .mdb files with the appropriate NWN tile name. The size of the tiles in NWN is 10x10m in the X-Y directions, compared to 9x9m in NWN. Thus, prior to export, I select all of the parts, then do a 's .9' command, scaling everything down by x90%. I can always do this later if I forget, but it is easiest to do it now. When all of the tiles have been converted, I save off a copy of the directory for later reference (and in case I screw up and need to recover).
3. The NWN walk meshes can be completely unsuitable for use in NWN2. (I.e. they are uneven and won't bake properly.) Hence the next step is to build a common walk mesh template that will be used for all of the tiles. I start with an existing walk mesh from one of the standard NWN2 tilesets, then try it against several imported tile models, tweaking and modifying the walk mesh accordingly. It only needs to work with the majority of the tiles; the remainder can be fitted by modifying the interior vertices. (Stair tiles, for example.) When finished, I export just the walkmesh to a template .mdb file.
- The template walkmesh should be completely flat and level with your normal floor height, and 9x9 in size. You can always modify a copy for uneven tiles such as stairs.
- I always make sure there are vertices along each edge where the standard door will go: at +0.9 and -0.9 from the midpoint.
- The vertices along every edge must be in the same locations on all sides, or the walkmesh won't bake. To ensure this, I build one side then make clone copies and rotate them into place. I then merge the copies together and remove doubles, resulting in a symmetrical walk mesh.
- There is a hard limit on the number of walkable faces allowed per tile: about 127-128 faces. If a placeable in a tile results in more than this amount, then the tile won't bake. For this reason, I try to keep the number of walkable faces below 100. This may mean that I use a modified walkmesh with a reduced number of faces for the relatively open tiles, such as the Open Floor tile or the tiles with just columns.
4. In some cases the tileset may use several textures for the floor surface. If the textures are 512x512, I look for those four textures that are the most frequently used across the tile set, then merge them together into a single floor texture. As a result, I'll need to tweak the UV mapping all of the floor textures. But the effort is worth it since I can then switch floor textures. (The UV remapping may just involve scaling it down my 50% then shifting by 256/512/1024 in the appropriate directions... or it can get a lot messier.)
5. Now I start working on individual tile models. The C2 mesh created by the import can be deleted--tiles don't need it. The floor faces of the C3 mesh can be removed, leaving only the side faces. The walk mesh will need to be replaced with your imported template. In the materials tab, I now set the unwalkable faces of the walk mesh to match the position of the other tile parts and change the other faces to the appropriate surface type. I may need to move some walk mesh edges about and perform splits and rotations on some faces to get a good match, while being careful not to change the edge vertices.
In order for interior area FoW to work properly, I've found that it is important to have the outer part of the C3 mesh within about 0.5 units of the edge of the tile, covering the entire length of the side (with the exception of the door opening). The ends of these faces should line up with the outer C3 mesh on neighboring tiles. You may need to test your tileset to make sure that FoW is working properly.
6. Next, I look for parts that can be combined. These are groups of parts that have the same textures and serve common roles across the tile, such as sideboards or beams. Merging these groups together into single parts will significantly cut down the number of objects you need to work with. A list of 20-30 can often be reduced to less than 10. Note that sometimes you don't want to combine certain parts, such as separate sections above and below the fade line for the roof. Once its done I have a much cleaner set of parts to work with.
7. I rename the parts using the prefix that matches the file name. (Important: the name of every part of every model must be unique within NWN2, or I can end up with some tiles showing parts of other tiles in the game, leaving a module in a complete mess.) The following naming conventions are used by the game engine:
- TL_XX_YYYY_##_F -- floor (or use TL_XX_YYYY_##_RF if I need an irregular floor shape to rotate with the tile).
- TL_XX_YYYY_##_R -- roof
- TL_XX_YYYY_## -- main wall component
- TL_XX_YYYY_##_W -- walk mesh
- TL_XX_YYYY_##_C3 -- the C3 collision mesh
For the remainder of the parts, I usually put a OBJ_ prefix in front of the name to avoid confusion. However, doing so may cause issues with texture swapping. In particular, a texture can show as swapped in the toolset, but not in the game. If you are concerned about texture swapping, it is best to keep the number of parts to a minimum: one of each type. Also, don't mix _F and _RF parts in the same tile.
8. Under the materials tab, I set the Ambient and Diffuse colors to appropriate settings. For some non-floor/ceiling parts I enable shadows so that they will show shadowing in the game. If a part forms a section of the walkable floor but is not in the Floor part (the one with the _F suffix), I enable Projected Textures on that part (by adding _PT to the material name). Important: I always check the normals for every part to make sure all faces are directed toward the exterior (the tile interior); usually these are set correctly unless I added faces. The roof normals should be pointing downward and the floor upward.
9. If there are any door openings, I import a door hook point template then clone and rename it for multiple openings. For a perfect fit, the standard door openings are set to (-0.9, 0.0), (-0.9, 2.7), (0.9, 2.7), and (0.9, 0.0), with the other (X or Y) coordinate set to 4.5.
10. I export the MDB tile model then use a hex editor to go through and modify the texture file names to the set I'm going to use in NWN2. These are found in each of the parts with the RIGD identifier. For the black borders I use the 'tl_xx_blacktexture' texture and normal map.
11. The texture files all need to have normal map files built. This I do via the normalmap plugin for GIMP. (I often get good results with Wrap enabled, Min. Z = 0.02, Scale = 6.0, and a Filter of 3x3 or 5x5.) To avoid moiré effects, texture files should be exported with mipmaps generated, along with compressed mode. (BC2/DXT3 is considered good for textures with a 1-bit alpha channel.) I might also add a tinting texture. Whatever tint settings get applied to the walls are also used for the ceilings, so I build the tint maps accordingly.
After I add the exported tile and the textures to a hak file then modify the appropriate 2da files (tiles, tileset, and tile texture files), the initial tile is ready for a trial view in my toolset, which can help me spot any defects.
12. I re-import the tile and perform any UV mapping work that is required as a result of texture file changes. This may take some patience, but the end result is worth it.
13. Tile edges typically have a black texture cap at the roof level. I like to expand on this part a little to match how it is used in the other tilesets. The end result has a vertical surface with normals facing outward, blocking the player from seeing in through the sides. I usually set the ambient color to black, and give it a name like TL_XX_YYYY_XX_###_CAP for easy identification.
I do another export then perform a final check in the toolset, fixing any issues I see. Sometimes I need to go back make revisions when I try different tiles in combination with each other. Door placement also needs to be checked.