Creating and Importing Portraits for NWN

Started by Conan The Conqueror, January 10, 2009, 06:02:25 AM

Previous topic - Next topic

Conan The Conqueror

There has been a lot of talk recently about portraits in NWN, and I thought it would help everyone if there was some light shined on the matter. The overall purpose of this is let people know the "how" of things and to also tidy up the Custom Portrait mish mash that is out there in the NWN community.

(some of you might notice the following is borrowed in bits and pieces from the Bioware guide...thank you Robin Mayne & Derek French)

Neverwinter Nights allows you to customize your character in many ways. Adding your own custom portrait is one way for you to take character customization to a new level.

This document will describe the simple steps needed to:

   1. Create a custom portrait
   2. Import a custom portrait into the game
   3. Understand how custom portraits work in Multiplayer

Creating A Custom Portrait
   

Step 1. Using an image editor of your choice (I recommend Irfanview) that supports the Targa (.tga) format, create a new blank image 256 x 512 pixels in dimension. Example software includes Photoshop and Paint Shop Pro.

Only the top portion of the image is displayed in the game, so that the actual size of your portrait is 256 x 400 pixels. The bottom portion of the image MUST be blank and unused.



Areas of the image:

    * canvas is the entire image
    * portrait is the area used by the game
    * blank is the unused area (but required)

Step 2. Create your custom portrait, whatever it may be, in the 'portrait' area. Remember, even though the total size of the canvas is 256 x 512 pixels, only use the top 256 x 400 pixels as diagramed above for the portrait itself.

Step 3. Now you need to create five versions of the portrait for the game to use. You have already created the largest version, so you can just resize it to make each of the four other smaller versions.

The dimensions of the five versions needed are:

256x400 (on a 256x512 canvas) - used for the Player Character Bio
128x200 (on a 128x256 canvas) - used for the character sheet
64x100 (on a 64x128 canvas) - used for the in-game portrait
32x50 (on a 32x64 canvas) - used for the party members and radial menu
16x25 (on a 16x32 canvas) - used for the chat thumbnail

(Irfanview has a neat canvas function where you can just make the original image and then add the required canvas size to the bottom. For example start with 256x400 and then under the Canvas option add 112 to the bottom side. This gives you the desired Canvas of 256x512)

Step 4. You must save the images as Targa (.tga) files, (selecting the '24 bits' and 'uncompressed' options of your software). Compressed Targa files will not work in NWN. The filenames for the five versions must follow this pattern:

(Note: This is where I deviate a lot from the original guide. The sample naming convention they provide will in no way sort your portraits by gender or race. In the end it is a big crap pile that takes forever to sort through. So now we get to clean things up a bit...)

po_RACE_GENDER_NUMBER_h.tga (for the 256x512 canvas)
po_RACE_GENDER_NUMBER_l.tga (for the 128x256 canvas)
po_RACE_GENDER_NUMBER_m.tga (for the 64x128 canvas)
po_RACE_GENDER_NUMBER_s.tga (for the 32x64 canvas)
po_RACE_GENDER_NUMBER_t.tga (for the 16x32 canvas)

RACE:
Dwarf = dw                                
Elf = el                        
Gnome = gn
Halfling = ha
Half-orc = or
Human = hu

GENDER:
Male = m
Female = f

NUMBER:
(1-999) See sample below.

Where the prefix "po_RACE_GENDER_NUMBER_" is a name you create, is 1 to 15 characters in length, and the same for all five versions. (Note:: If you go beyond 15 characters in length the portrait will be 'broken' and show up as all white)

The 'h', 'l', 'm' ,'s', and 't' that follows the prefix indicates the size of the image (Huge, Large, Medium, Small, and Tiny).

So for my sample portrait, I created these five images:

po_el_m_17_h.tga
po_el_m_17_l.tga
po_el_m_17_m.tga
po_el_m_17_s.tga
po_el_m_17_t.tga

I chose the number "17" because in the portraits.2da file there are 16 or so portrait entries for Elven males. This way it would not conflict or override any existing default NWN portrait. (Later there will be a mention of the triple digit system to completely avoid conflicts) Each race/gender has its own number of portraits from 6 up to 55 in some cases. The exception being humans who also have a single entry for male and female number 99.

The standard max number entries for the various races/genders are approximately as follows:

Dwarf Male = 10
Dwarf Female = 10
Elf Male = 20
Elf Female = 20
Gnome Male = 10
Gnome Female = 10
Halfling Male = 10
Halfling Female = 10
Human Male = 55 (Also has a 99)
Human Female = 40 (Also has a 99 entry)
Half-orc Male = 10
Half-Orc Female = 10

These are just 'caps' that you can start after to avoid any conflicts. I will be testing a triple digit system to see if NWN can handle it to avoid conflicts altogether. Example: po_el_m_171_h.tga

As you can see, the images all have the same prefix of "po_el_m_17_" (since it is 11 characters in total, it obeys the rule of being no more than 15 characters), and I also have each of the five versions - 'h', 'l', 'm' ,'s', and 't'.


Importing A Custom Portrait

Step 1. Importing your custom portrait is easy to do. Simply copy the five versions of the portrait into your 'portraits' directory where you have installed Neverwinter Nights.

Step 2. Now you can select your portrait when you are creating a new character. Note that your custom portrait will be available for both male and female characters, unlike the original portraits in the game that are male/female specific. If you follow the above naming convention they will be properly sorted.

There is only one way that you can have them sorted by race as well as gender:

A. You have put all of your portraits in the override folder. This will place them with their appropriate race. This can cause a bit of clutter in your override folder and make it a bit difficult to manage the overrides you may or may not already have in there, but there's a good chance your override folder is a mess already!

B. You have to edit the portraits.2da file and add a line for every custom portrait you wish to add. This is tedious, I know, but it is the only way of having your portraits properly sorted by both race and gender. (I am currently in work with some others in our community for the creation of a new EFU Portrait pack that would adhere to the above naming convention and also would include a properly edited portraits.2da file. You can begin giving me gold in game if you wish as a thank you >_>)

Using Custom Portraits in Multiplayer

When you are playing multiplayer and using a custom portrait, the portrait that people will see for you depends on if they have that same custom portrait in their 'portraits' directory as well. (It will look for portraits of the same filename.)

In order for other players on a server to see your portrait, they have to have the exact same file as you do in their portraits folder. If they do not have the file, or have a different portrait that shares the same name, they will not see your portrait. They will either see the default 'faceless' portrait or they will see what other portrait they have that shares the same filename as yours.

It is here that I think the big picture was missed when custom portraits were introduced to the community. There was never any promotion of the correct naming system so people often just named a portrait with whatever came to mind. Cluckythenoob_H.tga for example, while amusing, does not sort the portrait in any desired fashion. When creating your character it is sorted alphabetically starting at the end of the default (or properly named) portraits.

I hope this guide will help anyone who wishes to use custom portraits or make portraits themselves. As always, I am free to offer advice on portraits or help in the creation of them. Everyone has different tastes, but it's generally better to see the portrait that someone has for their character.

Conan The Conqueror

Note: After tinkering with portrait files and 2da's I've come to the conclusion that the Portraits folder is actually useless if you want your portraits sorted by Race and Gender.

Once you have portrait files in your portraits folder, they will show up for both genders regardless of what you name them or what you do to the portraits.2da file.

If you are not worried about them being filtered by gender, they will still be neatly organized by the standard naming convention which will make them much much easier to look through when you are creating a character. You also could leave them in your portraits folder and not worry about further cluttering up your override folder.

So as a quick summary of what was mentioned in the above post, if you want to have your portraits filtered/sorted by both Race and Gender:

1. You have to have no files in your portraits folder
2. All of your portraits files and an edited portraits.2da must be in your override folder together.

This makes the overall process a bit of a pain in the ass, but once a standard is established, adding/sorting/using portraits will be much much smoother.