Part One - Altering the Head, Hands and Body .dfm files
As most people will know by now, an NPC is made of a number of models. These are normally the Body, the Head, the Hands and one or two props (glasses and hats). The body, the head and the hands are all dfm files, the props are 3db files, all found in the various sub directories inside of the Character directory in Freelancer.
So lets start with editting the look of a head as that is a one piece texture. Find a head which in Freelancer matches the shape of the head you want to create (we won't be editting the shape itself) and copy it to a working folder (I find it easier to have a working folder for doing this sort of stuff). It will be named something like ge_female1_head.dfm and will be found in DATA\CHARACTERS\HEADS. Once you have a copy, open the dfm file up in the UTF Editor.
Suddenly, the dfm looks like a scary place to be in comparrison to a lot of files that you could open up in a UTF editor. However, for this tutorial, lets not worry about most of the stuff (most of it is mesh data dealing with which mesh connects with which mesh at which point). What we are looking for is the good old Texture Library. Opening it up will reveal normally four texture groups which are usually the teeth, the eyes, the highlight of the eyes and the actual head texture. Unless you want to change the teeth and eye textures, don't worry about those for now (if you do want to alter them, the process is the same as for altering the the actual head texture). Open up the head texture tree, normally called something like ge_female1_head02.TGA.
And suddenly, we find that this texture actually has nine levels of detail! This is far more levels of detail than even ships or stations get given in Freelancer. The texture files are labelled MIP0 to MIP8, however, we won't need to extract them all. Select the MIP0 and Export it to your working folder with the file name like example0.tga. IMPORTANT: you must add the .tga tag at the end. It is also advisable to add the 0 at the end of the file name as it will make things a little easier a bit later on.
Right, now you have tga texture file for the face, open it up in your favorite image editting program and.... err... that is one ugly picture! What you should be looking at is a two dimensional texture of the skin that is wrapped around the mesh (basically, it looks like some psycho killer has skinned your poor NPC). Now comes the fun part, altering it.
Using the image as a base, use your texturing know how to alter to your hearts content. Things that you can NOT alter are:
The location of the eye sockets
Where the hair on the head will be
Where the mouth is
Where the ears are
Where the nose is.
These are defined by the shape of the mesh. You could change them in the texture file, but it will look very odd later when applied to the mesh later on. So your work will need to go around these bits. Some ideas of what you could do include:
Change the skin / hair / colour / tone
Add tatoo's or other warpaint markings
Give male faces (and female if you are really odd) stubble, beards and moustaches.
Make other exotic alien markings (for example, if I were making a Star Trek mod, a couple of darker skin lines on the nose ridge could be used to turn the head into a Bajoran head).
Once you have finished making your alterations, save your work and we will now look at creating the nine levels of detail. Each level of detail is a seperate image that is basically smaller than the previous image. The sizes of the various levels of detail are:
MIP0 = 256x265
MIP1 = 128x128
MIP2 = 64x64
MIP3 = 32x32
MIP4 = 16x16
MIP5 = 8x8
MIP6 = 4x4
MIP7 = 2x2
MIP8 = 1x1
As you can see, each level off detail is exactly 50% smaller than the level of detail before it. This makes things so much easier for us. From you original image, scale it down by 50% in your imaging program and save that one as example1.tga (or what ever file name you are using). The use that scaled down version and scale it down by 50% again and save it as example2.tga. Repeat with each one until you reach example8.tga which will be only 1 pixel by 1 pixel across.
IMPORTANT: Do NOT convert your .tga into .dds format. It will not work.
Now we return back to the UTF editor and back to where you exported the tga from to begin with. Selecting MIP0 again in the texture library, click import and import back into it example0.tga. Then select MIP1 and import example1.tga and so on until you have imported all of your tga's into their corresponding MIP's. Now your textures is imported, save the file with a unique file name ending in the .dfm tag at the end (for example, my_head.dfm). Move this head then from your working folder to the Freelancer directory. You could place it in the Heads directory with the rest of the heads, but personnally, I prefer to make a new folder in the Characters directory and put all my custom body parts in there.
Right, before we get onto how to incorporate the body parts into the game's ini files and creating props (which includes more exotic alien heads), lets take a quick look at the other two body parts, hands and bodies.
Hands are relatively simple, just remember there is a left hand and a right hand, though the textures for each set are exactly the same for the left and right hand (even in orientation). The only difference between the two is obviousily the shape. You create your new textures in exactly the same way as you would the head, remembering the basic outline can not be changed. However, the texture you use for one hand can also be used for the other which saves having to do it twice.
Bodies are a little bit more complex to alter but are basically the same as heads again. When you open up a body .dfm in the UTF editor, you will find there are normally three textures. Export the MIP0 of each of these and have a look at all three in your image editting program. You will see that each one deals with a different part of the body. Again, you can't alter the shape of the clothes and the body, but you can alter the appearance. Very handy if you are creating a genre specific mod based on things like Star Trek, Star Wars, Babylon 5, Farscape etc... where the clothing and uniforms have a unique appearance different to those in Freelancer. Using these three images as a base, create your new image with the clothing textures in exactly the same places as they appear in the original texture. You will then need to create the 9 levels of detail as mentioned above for each one and import the 27 textures into the body dfm in the same way.
Just a quick note: I found that in the ku_kym_body_gen.dfm that there is a forth texture which when extracted looks like a head texture. However, the actual face is not important in this body, the mesh just uses the texture to colour the skin that is visible on this body on the upper chest. If you are creating an alien species who has a different skin colour and is going to use this body, you will need to alter the skin colour on this texture as well (and do the nine levels of detail) as I did with my
Twi'lek. Otherwise, just leave it alone. There may be more bodies like this as well that I haven't found yet.
Thats it for altering the heads, hands and bodies. Next up, props....