My objective was to create a pretty half-elven head for one of my NPCs. Anyone who has tried making a female half elf character in NWN2 will understand why I need a new head model. The ones that come with the game are all pretty... pretty ugly. There are a number of heads that are available at the Vault, but none of them are appropriate for my NPC.
With no prior experience and no patience to read tutorials, I jumped right in and fiddled with my 3D software. I decided that the best way for me to learn how to create character heads is to examine and tweak the ones that come with the game. This strategy opened up a whole new vista of awe and wonder -- awe over the labyrinthine interface of the 3D software and wonder over why my tweaked models won't show in the toolset. Among the many questions that arose over the next several days are the following:
- When I try to convert a file from MDB to OBJ, why does the resulting model look like a broken accordion?
- Where's the command to apply textures to a 3D model?
- Why are the textures on my model upside-down?
- What's the right way to attach a skeleton to a skin mesh, and why does the skeleton disappear when I export the model as an MDB file?
- When I put my model in the override folder, why does my game crash?
After a few days of frustration, it dawned on me that maybe I should have tried making a non-animated placeable instead. Duh.
I thought of backtracking a bit to practice 3D modeling by creating and texturing a box. Setting up the box mesh was easy enough, but I couldn't bring myself to texture it. I don't need a box in my game. I need a pretty face for my half-elven NPC. The toolset already has boxes and crates aplenty, but old Diogenes would sooner find an honest man in classical Greece than a pretty half elf in NWN2.
While frowning at the box mesh that I had created, a flash of inspiration came upon me. Using my 3D software, I had learned how to realign the vertices of a skin mesh to change the appearance of any head model, but I had not learned how to properly attach bones to the skin mesh. If I can change a model's appearance and save it as an MDB file, I can hack into the original model and adjust its vertices to match the model that I had tweaked. Since the bones of the original model are already attached to it, I won't have to attach the bones myself.
Fortunately, the format of MDB files is documented at the NWN2Wiki. Using this information as a reference, I was able to create a set of C++ functions to hack into MDB files. Having found a way to create new head models, all I had to do was to find a female half-elven head and change its appearance.
Because I wanted a pretty face to tweak, I downloaded the Oblivion to NWN2 hakpak by Gleeman. This hakpak contains a number of heads and hairstyles that were created by other modders for Bethesda's Oblivion and converted by Gleeman for use in NWN2. Using ZBrush, I changed the appearance of one of the models from the hakpak to suit my needs. Below are a couple of image captures of the software. The one on the left shows how Gleeman's model originally appeared. The picture on the right shows what the model looked like after I applied cosmetic surgery.
To see how the new model looks in the game, I took screenshots of her in two very different areas in my module. These screenshots appear below.
Having developed an unusual but effective workflow for creating new character models, I'll be making more of them in the days to come.