Page tree
Skip to end of metadata
Go to start of metadata

Introduction

Part-based models are typically player models, which refer to multiple independent model pieces which make up the idea of that model and bind them to their respective position. Instead of a single model, with a set appearance, these models aim to provide more flexibility, as they are able to swap out parts of an otherwise 'static' model. Therefore we could also say, that models that consist of multiple parts (part-based) are pre-requisites to Dynamic Models.


In this page we will get into the origins of dynamic models to give ourselves an general understanding of why and how this practice grew common in design decisions and compare it to the traditional static models.


You will learn the basics of what makes up a phenotype, how they are named, what parts their respective reference .mdl contains and where to find it with the NWNExplorer. Additionally we will take a look at something that is called a 'Supermodel' you might have encountered so far on your modding journey and will close this up with a short introduction into our first animation. This tutorial does not cover texturing your model or working with the .plt.

Confusing Terminology

Most Models in Neverwinter Nights are Part-Based Models, which means: A model that consists of multiple parts. In one way or another, they can be replaced during the model creation inside Blender / Max or later on in the game (equipping). However, those models which design decision is to be able to change their appearance, are called Dynamic Models. All models that can not change their equipment whatsoever are Static Models (Usually NPCs, Enemies, Bosses, Buildings, Terrain etc.). While it is easier for Static Models, technically speaking, it is possible for both, the Dynamic Models and the Static Models, to have one or more Single Models applied to their body.


Therefore we can conclude that:

"Dynamic" or "Static" defines the state of models, which is a Game Design Decision. They describe if a model can change parts of their appearance throughout the game, or not. How a model is handled in the game to be displayed correctly. It is a choice of Mechanics (Coding / Ruleset) and Dynamics (Process / Behaviour).

An example for this is the Creature Wizard which allows dynamic adjustments for these slots: Head, Neck, Torso, Biceps, Forearm, Hands, Pelvis, Thighs, Shins and Feet - with the additions of Wings and Tails that can be attached to the model. This is the 'Naked Body', without armor or accessories of a model. Armor replaces these mentioned slots with another bodypart dynamically, that means generally speaking, if you would be restricted by design to always walk around naked without ever changing anything to your model, your character is actually a 'static' model by definition. Since we, however, got the option to replace at least one part, it is 'dynamic'.

Part-Based Models and Single Models are Visual Design Decisions. They describe how a model is structured, broken apart in multiple pieces, or as a single mesh. How a model is created and distributed. It is a choice of Dynamics (Process / Behaviour) and Aesthetics (Feel / Visual Impression). A part-based model is the idea of an entity fragmented into it's parts and assembled. A single model is simply the entity. A branch is a branch. But once attached to a tree, we don't think about the branch, we see the tree.

Naturally, the human body has two arms, two legs, a torso, a neck and head. Now, we could leave it at that and try to animate it, but we wouldn't get so far as we aren't really sure what an arm or leg is - we also have a chest and pelvis after all. If we were to animate our body like that our arms and legs would just move in straight lines and our torso would just swing in it's entirety, which is weirdly robotic. To have something natural, we need to break these pieces further apart. Our arms have biceps and forearms and hands. Our legs have thighs and shins and feet. The torso is made up of a chest and pelvis. Now with that in mind, we can animate the human body in it's entirety without getting too much into details like the jaw, fingers, toes, ears and all these other parts. The more you fragment your pieces however, the more obvious it becomes. That's why we can see our character's joints so clearly. A single model on the other hand doesn't care about parts. It exists as it's own entity and to replace it would just meant to change the whole model. This allows us to have smooth and seamless, organic transitions and gives us complete control over the appearance of the model.

To understand this, let us take a look at this model from the NWN: EE gamefiles: "c_karandas.mdl"

Now here is a question: Which model is part-based and which one is a single model? Can you tell the difference? I can not. At least not from this perspective, but if we turn it around ...

Ahh, now we can clearly see that the left one must be part-based while the right one is a single model. After all we can see the fragmentation between the two joints where the head and chest would be. The right one has a clean definition and does not break the immersion of a body with connected parts. But actually, the answer "Left is Part-Based, right is a Single Model", is wrong. Why? We could maybe see that in an animation, but instead, we will remove the fancy lighting and environment and take a look at their actual structure.

We have been fooled! The left model AND the right model are actually part-based! Now, we can kind of understand, how the left model was probably moved around, rotated and placed in shape by moving all these parts to make that posture. We can even count his parts now and see that he is actually missing a neck model. Well, the design decision for him was to not include a neck model at all, it would have looked weird anyway that's why he has that bulcky, unmoving neck. But he is also tied to a supermodel, which is something that applies animations onto him to have the same walk, stand, combat, emote and even riding animations. But wouldn't a missing neck make him glitch out or have his head appear weirdly stretched? Nope. Because we haven't seen the inside of that model yet.

Click on the image to see the gif

What you see there is called a "dummy". The mesh is wrapped around that object beneath like a skin and is controlled like a bone. This neck piece basically translates all the animations of the supermodel onto it. However, this is for another tutorial about skinmeshes, that's why we won't touch upon the model on the right side as well.

Dynamic Model


Let's get back on track and talk about the dynamic model and why it is so popular.

The Dynamic Model technique is not specifically a technique only used by BioWare themselves, but it is generally a well known and well established practice in RPGs and a favoured design decision in games that aim for accessability and customization, that are not technically speaking RPGs. For example the Sims Franchise. Here, the base model of a sim is being cut into pieces directly by the clothing they wear. They have special weights which bloat or shrink the clothing to fit the muscle and bodyfat. Simple. 

The level of control, and how many parts are used can vary. While in TES4: Oblivion you were able to change your chest and lower body pieces independently, in Skyrim, the armor you wear replaces some parts of your upper body, arms and legs, thus having less options than it's spiritual predecessors.

In Morrowind, you were able to customize basically everything as if it's a detachable toy. Head, chest, upper arm, lower arm, hand, shoulder, legs, feet. In Neverwinter Nights this is even more broken apart into the pelvis and neck and additional stuff like wings, tail and cloak. Let that sink in for a moment, this is a lot to process.

Origins

Going far back in time we could say that DnD is probably the first Roleplaying Game that has ever been published - and back then, only as a tabletop experience. Dungeons and Dragons was always in some form an inspiration for games that had the player take up a role of someone in a virtual environment. Character Sheets are 

And derived from the Pen-and-Paper style, Dungeon Crawler like MUDs which were purely text based, allowed the player to pick up weapons with their own descriptions, wear armor to enhance their defensive capabilities and even describe the way their character looks - until of course it also went online - and thus the father of all 3D MMORPGs came to life: Meridian 59. While still not using any kind of complete body appearance for your character, you could change their face and your character's weapons changed with your weaponry and armor and the players you encountered had the appearance they had chosen for themself and had also visually worn the clothing that was years back in other games just a fancy item stored in an equipment slot. While sprite based, meaning 2D, this was already the early stage of a part-based model. Then Tibia and Ultima Online came, RuneScape and all those great classics and with it Neverwinter Nights a year after. And here we are, in the belly of the beast.

Should I use Dynamic Models?

Since you are working with a toolset provided by BioWare I will assume that you are probably also a fan of BioWare's other games. I for one am a huge fan of Dragon Age: Origins for it's groundbreaking design decision to be able to play different races and customize their appearance - and of course wear the armor I like. Now adding up on top of that, you also get your own epic, interactive story and can even change the clothes and armor of your companions! Let's go a bit into more recent years.

Dragon Age II was all about the Story of Hawke. Rather than to stick with the previous, grand formula of an extensive character editor, BioWare made the purposeful decision to shrink their story down to Kirkwall and a handful of other areas and stick with just a single race to pick. You also find yourself often times entering the same area your quests lead you into, with different enemies at day or night. There is also something peculiar about your companions: You could not customize their appearance anymore - only upgrade it. Why? - Not just because of a more shortened production time. The developers were able to concentrate more on the style of the game, their flashy animations and impact. While you had still complete control over your character's appearance, your companions remained memorable by having a distinct set of clothing.

This also improved the overall appearance of the animations. The peak of it all was in fact Dragon Age: Inquisition, as it ultimately combined the feel of Origins with the style and memorable looks of your companions and your character into one. Now when you equipped your companion in Dragon Age: Inquisitions, they did not wear the same armor you would wear when you equipped it - instead they had their own appearances.

With these examples we can now see a pattern of techniques we can go by, maybe you have other games in mind that might suite your style? You don't need to go by the standards of Neverwinter itself, most likely not, if you're all on your own. Remember, that you can always re-use and adjust pre-existing models, and you should, if this is one of your first modules.

Let us take a look at the Pros and Cons of working with and using Part-Based Models (Dynamic Models) compared to Static Models.

Dynamic Models

ProsCons
Pays off on the long runRepetitive and tedious workflow
Rich selection of appearancesLots of small models in different files
"It Just Works" once you're doneNeeds good pre-planning on the model's appearance
Rich amount of animations to go by using a supermodelMight not look good with the standard a_ba supermodel

Doesn't grow monotonous as fast with the variety of equipment

Loss of a distinct character model
Easy creature creation over the wizardTime consuming Trial-and-Error Phase
Players can express themselves or their character through their appearance however they want. Cool and gritty? Yes. Silly and joyful? Yes.Models might not fit in their appearance (Major clipping or unexpected size differences → Rework)
Create your own style and texture every part uniquely & integrate your custom models as craftable optionsRainbow Pimp Gear Effect - Aka. "Stats are more important to me than the pair of rabbit ears on my head"
Nobody can delude you in your plans once you get the ball going. Experiment and play around with the possibilities & grow with the experience of part-based modelling. Diving into the cold water will help you grow. Once you get the hang of it, you will have your own archive of resources and be able to speed up your workflow

Dependent on a supermodel to form their appearance.
→ Restrictive and Frustrating for Beginners
→ +200 Animations to remake from scratch (40~50 to get your supermodel 'workable')
→ Needs support for every previous armortype or body becomes invisible when wearing the item

Static Models

ProsCons
More time to concentrate on other things (Story)Creating a model takes time and you will likely want to repeat it's visuals to not have wasted 12 hours for a single fight
Models which are similar or varieties of another can use the animations of a supermodel and therefore speed up the process of creating variantsYou will likely want to add variations for your model and therefore take away some bits of their "uniqueness"
You can fake a supermodel by copying some animations and then add in unique ones. Flexibility is your advantageYou will make more entries in your appearance.2da
You can always switch the appearance of the creature with a script entry and create the illusion of a vast varience. For example having unique models for heavy, medium and light armor. Level 5 Items may look simple while Level 20 Items show their progress.Created Models don't always fit into premade supermodels and require their own sets of animations, this is most often true if your creature is not humanoid
Characters become more memorable and recognizeable for their unique and unchanging appearance thanks to their Informed EquipmentNo display of equipped armor on creatures that are your followers / henchmen. Only their stats change
If you plan your textures right you can use seamless, repetitive textures for other creature projects over and over and back your workflow up with a heavy resource of useful textures to combine. Applying a fur texture on hair for example or using a wooden wall on a shoulder armor piece.You will want to use different textures for your creature variants and will sometimes have to go past a simple recolor or will need to adjust UVs to the texture or vice versa
You will grasp the concept of creating Part-Based Models without ever having to create one as the models in Neverwinter are all based on "parts" and will eventually like to try out the different workflow. Freedom is a big part in static modelling due to it's single file focused workplace.Adjusting Models to Supermodels when you're trying to make them more unique can be very hard, you will eventually find yourself creating phenotypes and need to find a way to make your models work without having parts explode off their position.
If you are ready and feel comfortable with the way creatures are made you will eventually want to take a look over the files: c_karandas.mdl, t_karandas.tga and c_hezrou.mdl. This might blow your mind and make you think differently on how to plan your models. This. Is really good stuff - and you could quite likely make any Part-Based Model appear inferior in comparsion.TGA files of Neverwinter Nights are usually very small and if you add in higher resolutions or more detailed textures it might break the base game's appearance.

Phenotypes, Body Parts & how to find them

Before we create something of our own, I want to share some more informations about the difference between Player Models and Creatures.

Phenotype

Phenotypes are simply variations of the base phenotype "0", you could say that a phenotype is the template of a body.

  • phenotype 0 = Normal Body
  • phenotype 1 = Skinny Body (Unused)
  • phenotype 2 = Large Body

Each phenotype has bodyparts bound to their definition, that's why body parts of the phenotype 0 are thinner than phenotypes of 2. The body parts prepared by BioWare are re-meshed, larger types of the phenotype 0. All phenotypes are bound to a supermodel that controls their placing & animations. You could technically swap out the feet with the hands and the game would show you the atrocity you just created. You can also create your own phenotypes but only to a maximum of 20 (seet phenotypes.2da below). Keep in mind that the mounted once also take up space in this list, so if you just add a single phenotype to it you will want to also create a mounted version of it, otherwise your phenotype switches it's whole appearance if you sit on a mount. So for each new phenotype you actually need to edit 3. This means you can effectively only create 4 more phenotypes, 5 if you use the unused skinny phenotype as well.

Supermodel

A supermodel is a model that contains all necessary body parts as an idea that will be replaced by the body parts listed in _type including wings, tails, cloaks and shoulders. Additionally the weaponry is bound by an empty axes node to their hands and the shield is parented to the forearm. The spell impact follows the chest which means that projectiles aim for the chest, there is also one for the head. Hand conjure describes the place where the visual effects will be shown once the player casts something. The head conjure is above the player's head and shows visual effects above them. The head conjure is also responsible for the name above your character's head in the game. Your chest and pelvis are parented to the root dummy which origin point should overlap precisely with the body parts. Take a look at the file a_ba or a_fa which are the standard player supermodels some humanoid creatures also refer to. You can create custom animations up to a count of 70.

Naming

Now there is a special kind of naming going on for the player and for the creatures. While creatures are simply described as c_* with * being whatever you like to put in (max. 16 characters), players and creatures made with the creatures wizard have a special ordered name which you need to follow. 


pxy0_typeID

Defines the entry after this letter as
properties of a part-based model / player

Points x to m/f, male or female
defined in the gender.2da list..
This toggles the sex of the model

Points y to the race
defined in appearances.2da.

Base Races (Changeable, but know the consequences):

A = hAlfling
D = Dwarf
E = Elf
G = Gnome
H = Human
O = Half-Orc

Points 0 to the phenotype defined in the phenotype entry. Digit only.

0 = Normal
1 = Skinny //unused
2 = Large
3 = Normal_M //mounted
4 = **** //unused
5 = Large_M
6 = N_Joust_M //normal
7 = **** //unused
8 = L_Joust_M

Checks the name of a body part defined in the .mdl file's model name.

The names are hardcoded as described in caparts.2da, There are more names hidden in creature's .mdl to get an idea how you could name yours.

Numerical Identifier starting from 000, note that if you create new armor you need to adjust it for all phenotypes, otherwise the bodypart just disappears on equipping.
Can be changed to:Not changeable.

Only m or f.

b, o and n for "both", "other" "none" appear to be blocked for the default races using the creature wizard. 

This was tested with additional
pbx0, pox0, pnx0.mdl files.
Not tested with Custom Races.

For more informations:

gender.2da

Only a SINGLE alphabetical letter, no digit allowed.
Some Windows-1252 symbols are allowed, see below.

Any subsequential letters before the next entry will be ignored but count on to the max. name length of 16 characters, so don't do it.

Legal Symbols:

! $ % & ( ) [ ] 
{ } # ' + - , ; = @ ` ^ ~

Illegal Symbols:

´ € „ ƒ … † ‡ ‰ Š ‹ 
Œ Ž • ™ › Ÿ ¡ ¢ £ ¤
¥ ¦ § ¨ © ª « ¬ ® ¯
° ± ² ³ µ ¶ · ¼ ½ ¾
¿ À Á Â Ã Ä Å Æ Ç È
É Ê Ë Ì Í Î Ï Ð Ñ Ò
Ó Ô Õ Ö × Ø Ù Ú Û Ü
Ý Þ ß ÷ þ

For more informations:

appearance.2da
racialtypes.2da

Due to there being hardcoded engine limitations only 0 - 20 (21 entries) can be used. Reusing an unused one (such as "skinny", line 1) may work but not sure. Lines 3 to 20 are PHENOTYPE_CUSTOM_X.

For more informations:

phenotype.2da

The basic ones are:

_belt
_bicepl / _bicepr
_chest
_footl / _footr
_forel / _forer
_handl / _handr
_head
_legl / _legr
_neck
_pelvis
_shinl / _shinr
_shol / _shor

For Phenotype 2 there is
also:

_beard

You can create body parts as you like and animate skinmeshes more precisely with this, fingers, toes, faces etc. but keep in mind that if you derail from the a_ba, a_fa that you will likely have to create your own supermodel.

For players though you should stick to VFXs.

Since you can't add new armor types, the above mentioned technique is best applied on High Polygon Creatures since they are static models and ignore equipped Armor. I will link a tutorial to this later on.

For more informations:

caparts.2da
Rigged Fingers
Wemic
Eligio's Custom Content Guide 3
Rigging in Blender

Only digits allowed, limit unknown, but probably until you hit the 16 characters mark.

Appearance.2da

We know that the player is dynamic and creatures are static. But how does the game know it, too? Let's get into the magic of 2da.
Open up NWN Explorer, press ctrl + s, write appearance.2da into the search bar and hit enter. We will double click on it and take a look inside.

Appearance.2da is your domain and playground. If you've never opened a 2da before: It's just columns and rows, the worst thing you could do is cause an error - and your game files are always safe because the Toolset checks all your hak files and uses these files as a priority when it builds the interface entries for your module once you load it up. You just can't break anything. That's why we will now hit right click and export the text file. You can really use any text editor to edit the .2da. The file name extension is just important for the Toolset to recognize it's existence. If you would change the extension to .txt don't forget to name it back to .2da or you will just have an useless .txt file in your hak and will spend a needless amount of time trying to figure out why the toolset does not accept your changes.

All the informations you see in the appearance.2da are crucial for the game to know if the model is a dynamic model or a static one. If it's a player, or a creature.  If you ever want to add in another creature just edit one of the free lines defined for the user.

Finding a head

The first issue most will encounter when they try to find a head is that they don't really know what they need to look for other than "head". They might stumble over the dwarven head first, but where are the human ones? Well, luckily we now have a table to go with as mentioned above. So to put this into practice we will now once again press ctrl + s and look for pmh0_head001.mdl. Press right click on ASCII Model and export text, however save it as .mdl rather than .mdl.txt. Now go to your model editing tool, for this tutorial we will be using Blender with the plug in NeverBlender.

A new head

I like the head of the creature karandas very much and since it's already textured, we will simply take the head and import it, of course you can model your own head for this tutorial.
Delete the old head or edit it. Name your new head pmh0_head082_g - the g stands for 'geometry', do your UV Mapping & Texture it the way you see fit. Also rename the root dummy to pmh0_head082Your new head should be parented to the root dummy of pmh0_head001. This ensures that the head will be planted on top of the neck (defined by it's origin point) when it is combined with it's other parts in the supermodel. Check "Render" for your model so it is seen in the game and also check shadows. If you encounter a weird bug that stretches the shadows, check out Model Shadows. Now, your model's hierachy should look something like this. I will convert the texture to .PLT so that it accesses the color schemata in the creature wizard. Your texture should also be name exactly like the root dummy, meaning pmh0_head082.

Packing it up

Your new head should be packed up in a .hak using the official nwhak.exe. Your files should look something like this. Load up your module and add in your custom content in the module properties. Your module will now reload.

Our first head!

Now that we've imported the model over the .hak, we can open up the creature wizard and create a new human creature. Since we want to show a playable race it will be the simple human template. In the creature wizard we open up the appearance tab and choose our head pmH0_head082. You should now have your new head ported in.

Of course there are issues we could fix here as the head's neck is just way too bulky, we could adjust the overall head size in Blender once again and see if it fits, but for this fix you would really have to edit the head itself a little. I put the skin of the dragonkin into the 'skin' tab, the teeth into 'hair' and the eyecolor into 'tattoo1'. You could of course expand this further on and add tattoo 2 to the scales so it looks more like the original .tga of Karandas. As a practice you might want to port over Karandas as a playable addition yourself and fix the model! I uploaded the important .hak to the vault. You can download it here and take a look at the file: Part-Models Tutorial: Karandas' Head

Animations

This page is in the making ...

  • No labels

1 Comment

  1. The information about "Line Limits" for phenotype.2da being set to 0-20 is wrong. There are numerous projects that use lines beyond 20 and models in those slots work fine. For example, Project Q utilizes phenotypes 21, 30-33, 39-43, 46, 54-58, 65-71, and 80-86, while Sanctum of the Archmage series of modules utilize lines 45 and 47-53. I believe that the actual line limit for the 2DA is 255 (0-254), although I have not personally tried line numbers with three digits (e.g., pmh101, etc.).