Table of Contents - Neverwinter Vault

16
Making custom armor and armor attachments for Neverwinter Nights 2 by reskinning existing models – A tutorial by Barrel of Monkeys Table of Contents: 1. Assumptions 2. Building your toolbox and setting things up 3. Terminology, naming conventions, and getting things to appear in game 4. Packaging your creations for public consumption 5. Tutorial 1: a simple arm band – diffuse maps, tint maps, simple normal maps 6. Tutorial 2: a fancy elemental armband – glow maps, complex normal maps 7. Tutorial 3: leather armor – minor changes to existing armor 8. Tutorial 4: peasant dress – making a new gown from scratch Part 1 – Assumptions made when using this tutorial This tutorial is written for hobby artists interested in making new armors for the game. The pacing will be fairly laid back and incremental with in depth discussions of the design steps I take to get from concept to finished armor. Experienced artists may just want to skim part 2, read part 3 and part 4 and then just jump immediately to making their own stuff. All of the demonstration images in the tutorials will be taken using Corel Painter 9.5, the CCArmorTutorial mod, and the various tools included in CCArmorTutorial_Tools.rar. I assume that users of this tutorial already know how to use a drawing program and that said program can do layered operations. I also assume that the user has basic proficiency with the NWN2 toolset and they are able to create items, and set the appearances of NPC’s. Finally, the user needs to know how to start the DM client, summon creatures and items, possess creatures, and jump to different areas. These tutorials only explain how to add new textures to existing models. It does not go into how to make new 3d models or animations.

Transcript of Table of Contents - Neverwinter Vault

Page 1: Table of Contents - Neverwinter Vault

Making custom armor and armor attachments for Neverwinter Nights 2 by reskinning existing models –

A tutorial by Barrel of Monkeys

Table of Contents: 1. Assumptions

2. Building your toolbox and setting things up

3. Terminology, naming conventions, and getting things to appear in game

4. Packaging your creations for public consumption

5. Tutorial 1: a simple arm band – diffuse maps, tint maps, simple normal

maps

6. Tutorial 2: a fancy elemental armband – glow maps, complex normal

maps

7. Tutorial 3: leather armor – minor changes to existing armor

8. Tutorial 4: peasant dress – making a new gown from scratch

Part 1 – Assumptions made when using this tutorial This tutorial is written for hobby artists interested in making new armors for the game. The

pacing will be fairly laid back and incremental with in depth discussions of the design steps I take to get

from concept to finished armor. Experienced artists may just want to skim part 2, read part 3 and part 4

and then just jump immediately to making their own stuff. All of the demonstration images in the

tutorials will be taken using Corel Painter 9.5, the CCArmorTutorial mod, and the various tools included

in CCArmorTutorial_Tools.rar.

I assume that users of this tutorial already know how to use a drawing program and that said

program can do layered operations. I also assume that the user has basic proficiency with the NWN2

toolset and they are able to create items, and set the appearances of NPC’s. Finally, the user needs to

know how to start the DM client, summon creatures and items, possess creatures, and jump to different

areas.

These tutorials only explain how to add new textures to existing models. It does not go into how

to make new 3d models or animations.

Page 2: Table of Contents - Neverwinter Vault

Part 2 – Building your toolbox, setting up a viewing module and working

directories

2.1 Tools you’ll need

• A drawing program that does layers: Examples include Photoshop, Gimp, or Painter. Both

Photoshop and Painter offer trial versions, and Gimp is free for download.

• A file converter that can convert image files to and from DDS: I’ve included DDS converter 2.1

with this tutorial.

• A way to copy the game models and reassign textures to them: MDB Cloner is included with the

tutorial.

• A way to generate UV layout maps which will be used for tracing paper. A 3D modeling

package usually has ways of generating the UV image, but for this tutorial I’ve included the beta

version of RunnerDuck’s MDB UV Ripper.

• A normal map generator: I prefer to use Crazybump to make my normal maps, but both

Photoshop and Gimp have plugins available for them that will generate normal maps from an

image. Crazybump beta 2.5 is included with this tutorial.

• Archiving software: software that can .rar or .zip up your files to make sharing them with others

easier.

2.2 The viewing module

Unfortunately, the toolset previews aren’t detailed enough to show how the textures will actually

look in game. We’ll use the toolset to look at rough drafts when we first start creating, but eventually

we’ll have to look at the armors repeatedly in game as we fine tune color and shading. I’ve included a

module called CCArmorTutorial inside the tutorial tools package. Copy the module to your

\Neverwinter Nights 2\modules\ directory located in your My Documents folder. This bare bones

module includes 3 rooms designed to test the model under various lighting conditions.

The ambient room is used to test the

diffuse and tint maps. It’s a brightly lit indoor

area with very few shadows.

Page 3: Table of Contents - Neverwinter Vault

The shadow room is used to test normal

maps. It’s a dark room with flickering light

sources that project in a mostly horizontal

direction.

The outside area is used to test aspects of

all the texture maps. It’s a typical outdoor setting

with a day cycle. The light projects in a mostly

vertical direction from the top.

Technique Note: You don’t need to restart the game or toolset every

time you make a change to a texture map. For the toolset, changing the

model to something else and then setting it back to the model you are

working on will force the new textures to load in the Armor Set tab.

While viewing your armor within the game itself, entering a different

area will force the new textures to load.

Page 4: Table of Contents - Neverwinter Vault

2.3 Making a working directory and unpacking game resources

You’ll need a place to store all the unpacked game resources and your work-in-progress image

files. Create a folder with 3 subdirectories.

Also, create a subdirectory inside your My Documents\Neverwinter Nights 2\override\ folder. This is

where we’ll be placing our modified MDBs and textures for the tutorials.

All the models and textures for the game are located in the Program Files\Neverwinter Nights 2\Data\

directory inside 2 zip files: NWN2_Models.zip for all the 3D geometry and NWN2_Materials.zip for

Page 5: Table of Contents - Neverwinter Vault

all the texture files. If you have space on your hard drive copy these 2 files to your nwn2work directory

and then extract them into the game models and game textures folders.

Part 3 – Terminology, naming conventions, and getting things to appear in the

game

3.1 Terms and definitions

MDB – The file format used to store the 3D geometry information of all the objects in the game.

DDS – The file format used to store texture images in the game. Heavily compressed and causes quality

loss in the image. Most drawing programs need a plugin to load and save this format.

TGA – An uncompressed image format that the game recognizes. Most drawing programs can load and

save TGA’s. Images need to be saved in 32-bit TGA format to work properly as textures in the game.

RGB – Red/Green/Blue color format used to describe a specific color

tint. If I use the expression RGB(130,157,204) , it means I want the

color represented by having the red channel =130, the green

channel=157, and the blue channel=204. The numeric range for each

channel ranges from 0 to 255.

HSV – Hue/Saturation/Value color format used to describe a specific

color tint. The hue indicates the actual color tone. The saturation

indicates how “warm” or “cool” the color is. The value indicates how

light or dark the color is. It’s easier to describe minute color corrections

in terms of HSV rather than RGB.

Texture map – This is the general term used when talking about one of the 2D image maps that hold the

coloring data for an MDB. There are 4 types of texture maps that the game recognizes: diffuse, tint,

glow, and normal. (They are described in separate definitions later on.) Common size dimensions for

these maps are 256, 512, and 1024 pixels square. Each map has 2 channels of data: RGB and Alpha. The

RGB section holds the color data that gets displayed, and the alpha channel holds a grayscale image

that’s used differently depending on what type of map it is.

Never directly modify the contents of the zip files in the Data directory. If you do, you run

the risk of messing up the game and then you will have to reinstall!

Page 6: Table of Contents - Neverwinter Vault

UV map layout - The UV map is the projection of the 3D model onto the

2D texture and shows us what parts of the 2D texture will actually be

displayed on the model. This image isn’t necessary for producing new

textures, but it certainly makes drawing easier knowing where the image

boundaries are on a texture.

Mesh – The 3d geometry of a model, not including its textures or UV maps. I use this term to refer to the

actual physical shape of the object I’m working on.

Diffuse map – The diffuse map is the main image map for an MDB. It holds the main visual texture on

its RGB channel and controls the transparency of a mesh with its alpha channel. The color white on the

alpha channel makes that area of the mesh solid, while the color black makes the area of the mesh it

covers transparent. The game doesn’t recognize partial transparency. The mesh is either visible (white)

or invisible (black). All MDB’s must have a diffuse map defined, or they will not work.

Tint map – The tint map tells the game which parts of the mesh can be custom tinted by the user in the

toolset. Each color, red -RGB(255,0,0), green -RGB(0,255,0), and blue -RGB(0,0,255), corresponds to a

different color tint. The alpha channel value determines the amount of color that gets added on top of the

original diffuse color, with white being the full amount and black being no tint added. Armor attachment

MDB’s (those that begin with A_) can use all 3 colors for any arbitrary tint, but armor part MDB’s

(those that begin with P_) can only use the colors blue and green for arbitrary tints. The color red is

reserved for the skin tone of the player or NPC. The tint map is optional.

Example: (from left to right) a) a diffuse map with an all white alpha channel. b) the texture

on an armband shown in the toolset. c) added a black dot to the alpha channel of the diffuse

texture. d) and now there’s a hole in the armband

The uv layout for an

armband

Page 7: Table of Contents - Neverwinter Vault

Glow map – The glow map tells the game which parts of the mesh should emit light. The color value

(the V in HSV) determines how bright the glow is. The alpha channel determines if an area glows

(white) or doesn’t glow (black). The glow map is optional.

Example: armband with 3 tints defined on the

map. Black areas of the alpha channel don’t

get tinted.

Tint map

Alpha channel of the tint map

Example: Glow map with

warning text and intensity dots.

glow map with an all

white alpha channel

V = 100%

V = 70%

V = 30%

V = 5%

Tip 1: Remember that a little V goes a

long way…if the value of a color is set

too high, the glow will drown out the

details of the diffuse texture.

Tip 2: It is possible to use a glow map

to fake a see-through material. (glass,

cloth, etc.) The trick is to find a value

range that doesn’t emit too much light.

Page 8: Table of Contents - Neverwinter Vault

Normal map – The normal map tells the game how shadows should form on the mesh and how much

light needs to bounce off the model. The RGB values of each pixel in the image correspond to the

direction the light has to bounce when it hits that location on the mesh. This allows an artist to create an

illusion of curves, cracks, and dimples on a surface that’s actually flat. RGB(127,127,255) is the neutral

tone and represents light bouncing directly off the actual surface of the mesh itself. While it is possible

to make minor color corrections to specific areas of a color map, it is more efficient to generate the maps

either with grayscale height maps or by having a high poly 3D model projected onto the lower poly

game mesh. In these tutorials, we’ll be making all our normals with grayscale maps. The alpha channel

of the normal map controls how much light gets reflected off an area of the mesh, with the color white

representing an extremely high gloss surface and black indicating no reflection at all. All MDB’s must

have a normal map defined, or they will not work.

3.2 File naming conventions

Custom armor creation uses 2 types of naming conventions, one for armor attachments (A_types) and

one for body parts (P_types). Head and hair MDB’s use a P_type naming system too, and I’ll describe

their layout as well even though this tutorial doesn’t cover the creation of heads or hair. The armor parts

must follow this naming convention for them to appear in the toolset.

Example: (from left to right) a) start with a grayscale image and run it through a normal

maker. b) The resulting normal map. c) Add a textured grayscale image to the alpha channel

of the normal map to control how much light bounces off the surface. d) The resulting effect

on the armband shown in the outdoor area of our test module.

Head and hair: P_***_type***.MDB

Race Gender index number

Example: P_HHM_Hair1.MDB (human male hair part 1)

Page 9: Table of Contents - Neverwinter Vault

race attachments body parts helms heads hair

Human HH HH HH HH HH

Halfling HH HH AA AA AA

Strongheart, halfling HH HH AA AS AA

Half-elf HH HH HH EH HH

Tiefling HH HH HH HT HT

Aasimar HH HH HH HA HH

Elf EE EE EE EE EE

Sun elf EE EE EE ES EE

Wood elf EE EE EE EW EE

Drow EE EE EE ED EE

Dwarf DD DD DD DD DD

Gold dwarf DD DD DD DG DD

Druegar dwarf DD DD DD DU DD

Gnome GG GG GG GG GG

Svirfneblin GG GG GG GS GG

Half-orc OO OO OO OO OO

gender symbol

male M

female F

armor prefixes description

CL Cloth

CP Padded

LE Leather

LS Studded leather

CH Chain

SC Scale

BA Banded

PH Half plate

PF Full plate

HD Hide

NK Naked

Body parts: P_***_**_type***.MDB

Race Gender Armor Prefix Index number

The index number for body parts ranges from 1 to 256.

Example: P_DDM_CL_Boots150.MDB (dwarf male cloth boots part 150)

Armor attachments: A_***_type***.MDB

Race Gender Index number

The index number for armor attachments ranges from 1 to 255.

Example: A_HHF_RUpArm24.MDB (human female right arm part 24)

Page 10: Table of Contents - Neverwinter Vault

3.3 Getting your new armor parts to appear in the toolset

Add your newly created MDB and all its associated texture maps to your My

Documents\Neverwinter Nights 2\override directory. If your MDB was named correctly and nothing

was wrong with the mesh, your new body part or armor attachment will appear automatically in the

appropriate armor set listing. Body part listings appear as one value less than their file index number.

Armor attachments appear as their file index number.

P_types description

P_***_Head*** Head

P_***_Hair*** Hair

P_***_**_Body*** Body

P_***_**_Helm*** Helm

P_***_**_Gloves*** Glove

P_***_**_Belt*** Belt

P_***_**_Cloak*** Cloak

P_***_**_Boots*** Boots

A_types description

A_***_LShoulder*** Left shoulder

A_***_RShoulder*** Right shoulder

A_***_LUpArm*** Left arm

A_***_RUpArm*** Right arm

A_***_LElbow*** Left elbow

A_***_LElbow*** Right elbow

A_***_LBracer*** Left bracer

A_***_RBracer*** Right bracer

A_***_LHip*** Left hip

A_***_RHip*** Right hip

A_***_FHip*** Front hip

A_***_BHip*** Back hip

A_***_LUpLeg*** Left leg

A_***_RUpLeg*** Right leg

A_***_LKnee*** Left knee

A_***_RKnee*** Right knee

A_***_LLowLeg*** Left shin (only appears when

boots are shut off)

A_***_RLowLeg*** Right shin (only appears

when boots are shut off)

A_***_LAnkle*** Left ankle (only appears

when boots are shut off)

A_***_RAnkle*** Right ankle (only appears

when boots are shut off)

A_***_LFoot*** Left foot (only appears when

boots are shut off)

A_***_RFoot*** Right foot (only appears

when boots are shut off)

Tip: Texture files don’t need to follow

this naming convention, only the MDBs,

but it’s usually a good idea to name the

texture files after the MDB that uses

them. Diffuse maps get named the same

as the MDB. Tint maps get a _T added

after the MDB name. Glow maps get an

_I added to the end, and normal maps

get a _N appended.

Example:

MDB: P_EEF_CL_Helm75.mdb

Diffuse: P_EEF_CL_Helm75.tga

Tint: P_EEF_CL_Helm75_T.tga

Glow: P_EEF_CL_Helm75_I.tga

Normal: P_EEF_CL_Helm75_N.tga

Page 11: Table of Contents - Neverwinter Vault

Part 4: Packaging your creations for public consumption

While the new textures are being worked on and modified, it’s convenient to use the override

directory to hold all the data. Once the changes are complete, however, custom content creators need to

decide how they want to package and distribute their content.

4.1 Override vs. Hak

Packaging an override version of your content is fairly straightforward. Simply throw everything

you’ve made into an archive file (.zip, .rar, etc.), distribute your file, and tell users to extract it into their

override folders. Pros: relatively simple to pack and use. Content added to the override folder

automatically gets used in every single module for the game, so there’s no need to worry about editing

modules to add your favorite outfits. Cons: You run the risk of filename conflicts when the user adds

other custom content. Because override content is used in all modules, it might break or interfere with

content that a module creator is trying to use.

Making hak packs from custom content requires a third party program like Tanita’s

NWN2Packer (found on NWVault). The hak needs to contain everything that would be contained in the

override version. This includes all the new MDB’s, the new textures, and any modified 2DA’s. Pros:

allows the end user to have better data control over what content gets used at any time. Everything is

contained inside one file, so there’s no risk of accidentally overwriting or deleting data when the user

adds new custom content. Cons: haks need to be specifically added to a module through the toolset

before they will work.

Using NWN2Packer to

make a new HAK:

1. Click the “New”

button to start a

new file.

2. Click the

“Import” button

to add files to

your HAK. You

can use CTRL-

A to add

everything in a

directory at

once.

3. Click “Save As”

and enter a

filename for

your new HAK.

Make sure you

put .hak at the

end of the name.

Page 12: Table of Contents - Neverwinter Vault

4.2 TGA vs. DDS

To make TGA textures simply save your images as TGAs from your drawing program of choice.

Pros: The quality of the image will remain just as you drew it. You don’t need a converter or plugin to

work on TGA’s. They can be loaded directly back into your drawing app. Cons: TGA files are

uncompressed. Therefore, they tend to be large. Lower end machines with older video cards might

notice a slowdown of the game because of the size of the textures.

DDS’s are generated either through a plugin directly from GIMP or Photoshop, or with DDS

Converter. All of the game armors should be saved using dxt5 compression with alpha and 9 levels of

mipmaps. Normal maps should be saved using the –dxt5nm –norm switches. Pros: File sizes are much

smaller than TGA. Cons: The compression causes some loss in quality to the image. This can especially

be a problem for normal maps because the colors in a normal map need to be precise.

Setting up DDS Converter

1. Click the “Options…”

button and set the DDS

fields according to the

type of texture you are

converting.

2. Set your output format

to make DirectDraw

Surfaces.

3. Select the images you

wish to change to DDS

and hit the “Convert”

button to change them.

Your DDS option

fields should look

like this when you

convert diffuse,

tint, or glow

maps.

Your DDS option

fields should look

like this when you

convert normal

maps. Add

-dxt5nm -norm to the extra

switches field.

Page 13: Table of Contents - Neverwinter Vault

4.3 Making prefab armors

Quite often, an end user just wants to have access to your shiny new armor without having to

muck about in the toolset. Armor creators can make things easier for their audiences by providing

prefabricated items in their downloads. First, create an item with the toolset choosing color and stats for

the item. Then under the blueprint listing, right click the item that you wish to make into a prefab. Save

the item to a file. Finally, include that UTI file with your download package.

4.4 Reskinning for all the races

A lot of the original armor MDB’s use the same textures across

more than one race. For example, armor P_**M_CL_Body14.MDB uses

the texture P_HHM_CL_Body14 for all of the races. If you know the

armor you are retexturing shares a texture with another race, it’s a

relatively simple matter to just clone the MDB’s of the other races and

include them with your release. That way, races other than the humans

can share in the custom armor bounty.

After all, half-orcs need clothes too…

Page 14: Table of Contents - Neverwinter Vault

4.5 Using new armor prefixes

Eventually, there will come a time when every index in all the armor prefixes is used up. At this

point, you can either reuse a number someone else has used and overwrite their content in the process or

create a new armor prefix and have all your body parts use that prefix. Right now (as of 1.05), the new

prefix name does not show up in the toolset properly, but the category still appears in the Armor Set tab

and the armors do work in game.

To add a new prefix, use the toolset to open

armorvisualdata.2da. The 2da editor is located under the view menu

tab in the toolset. Add a row to the 2da and enter the information for

your new prefix. Save the 2da, and include the modified 2da with your

release.

What the fields mean:

• Label – the name of the armor category. Any name containing more than one word needs to go

in quotes. Example: “Crazy Costumes”

• ToolsetName – the name that appears in the toolset. A number indicates the line from dialog.tlk

that should be used. Four stars **** indicate that the toolset should use the entry in the Label

field as the name. [currently broken] Otherwise, the word entered in this field gets used as the

Page 15: Table of Contents - Neverwinter Vault

armor category name. Any name containing more than one word needs to go in quotes. Example:

“Historic Replicas” [currently broken]

• Prefix – the letters that get added to a filename to have them show up in the toolset in this

category. Prefixes can be up to 12 characters long. Example: P_HHM_HR_Body05.mdb will

show up under the Historic Replicas main type as variation 4 for human males.

• Parent – this is the default visual appearance that is used when an armor of this category is

assigned to an item, but the item is used by a race or gender that doesn’t have an MDB for the

armor part assigned. The number corresponds to the row of an armor type with 1 = Cloth, 2 =

ClothPadded, 3 = Leather, etc. Four stars indicate that the category has no parent, and the visual

appearance will default to cloth.

4.6 Distribution

Where to post your work: Neverwinter Vault (http://nwvault.ign.com/) This site holds archives of mods,

tools, photos … practically everything pertaining to Neverwinter Nights 1 and 2. Their submission

system allows you to track the number of downloads and to receive feedback from your users. You’ll

need to register before you can upload files (Registration is free.)

What to include in the posting:

• A text file containing details of your release package. It could include such things as -

� Package title

� Author’s name

� Package synopsis – a short paragraph description of what the package contains

and who might find it useful

� Current version

� Version history – Explain what changed in each version

� Detailed content listing – List the actual toolset entries added, what’s tintable,

what races and genders are available, the prefab filenames, etc.

� Usage instructions – Tell users where the contents need to go and how to add the

prefabs to the game.

� Usage permissions – Explain who is allowed to use your work, if they’re allowed

to modify your textures or MDB’s and redistribute them, etc.

� Source credits – Give credit to the content creators that you derived your work

from. If you used an Obsidian MDB list the number here. If you used textures or

meshes from the community or elsewhere list the part and the authors here.

� Miscellany – special thanks, contact information, upcoming future releases, or

anything else you feel like telling people

• Include sample pictures of your armor taken from inside the game so users can see the armors

without having to download the package first.

• Either your HAK or the override subfolder whose contents include:

� MDB’s

� Textures – either TGA or DDS

� UTI prefabs

� Modified 2da’s

Page 16: Table of Contents - Neverwinter Vault

At least the text file and the content files should be archived together and posted for download. The

pictures might be nice to include if it doesn’t result in the archive being too large (25MB limit).

Part 5: Tutorial 1- a simple armband