Monday, August 25, 2008

Pretty Model Hacked

Over the past several days, I took a break from area design to try my hand at 3D modeling, something that I've never done before. The closest that I have come to creating 3D models was to retexture several NWN2 placeables. Emboldened with my success in this endeavor, I figured that the logical next step is to try to create a new character head. Stands to reason, right? Right.

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.


Liso said...

Wowies Frank! That is gorgeous!!! I can not wait to see her in game! About time we have some beautiful elves! IMO they should be :)


dirtywick said...

That's really nice.

Frank Perez said...

Hi, Michele and Dirtywick. I'm glad you like the new model. :)

Liso said...

She would look extra awesome in the armor Jonny made for me! hehe

"wink" if you want it that is :)

Jclef said...

Nice work, Elysius!

Jason said...

Wow, now that's some impressive tenacity. Nice to see people get in there and figure things out rather than just whining about what's not available. :-)

That right hand shot of the face kind of reminded me of Linda Blair in The Exorcist, but maybe that's because I've got Halloween modding on the brain. LOL. That's not an insult by the way, she looks great.


Frank Perez said...


*gasp* That awesome armor... Why, yes, I would love to have the armor file. Pretty please with sugar on top... :D

Liso said...

@ Frank.

It would be nice to see it featured in someones module.
I'll get Jonny to finish the last bit of rigging on it, have it fit the half elf. I will be thrilled to see her sporting the nifty digs!


Josh said...

Looks great, Elysius! About time, we have some pretty elves. Obsidian just keeps saying that's the way WotC wants em. Well, that makes me wonder whether everyone at WotC is just plain ugly! :D

As a side note, I'm almost familiarized myself with ZBrush enough to start a project, I hope :) Still have to toy with creating an actual object within the program still.

E.C.Patterson said...

Nice job Frank! The head looks great. I'm impressed that you were able to figure all this out.

Barry The Hatchet said...

Great job Elysius. I'm sure there are modellers out there that would be interested in the details of your work flow to re-model existing heads.

Frank Perez said...

Hi, everyone. I'm happy to receive positive feedback on my first 3D model.

I'll give more detailed accounts of my workflow in future posts so that others may benefit from the things that I've figured out thus far.

Anonymous said...

I want to port models from oblivion to NWN2 any in depth tuts?

Anonymous said...

I want to port models from oblivion to NWN2 I have blender and I know how to use it a bit but what are the steps I need to take in order to make it work. Could someone direct me to a tut?

Frank Perez said...

Sorry, I don't know how to mod Oblivion, so I can't sau how to import it to NWN2.

Castingbar said...

Any chance to get a download of this face model?

Frank Perez said...


I don't have the file anymore. Sorry.