Hello, here is how dna works:
Each character has a dna string. These are either generated at random, or scripted in the character files under history/characters/*.txt
For example, Caesar (100390 - Gaius_Julius_Ceasar.txt)) has:
dna = "abbbbbbbb"
where each letter symbolizes a part of the portrait in order:
BACKGROUND, NECK, EARS, CHEEKS, EYES, NOSE, CHIN, HAIR, MOUTH
There is only one background, so that is always "a" at the moment. The reason the others are all "b" is just that the artist painted the famous people first and then added other parts. a is always the first in a sprite strip, b the next etc.
DNA of children is calculated from mother/father + some random (or backwards in a complicated way if you scripted the child, and not the parents for example).
The actual face pieces are defined in "interface/portraits.gfx"
You specify each facepart per culture. Like this for persian mouths:
Code:
spriteType = {
name = "GFX_persia_female_mouth"
texturefile = "gfx\\characters\\persia_female\\mouth.tga"
noOfFrames = 16
norefcount = yes
}
notice noOfFrames specifies how many individual pieces are in this strip.
Then you tie up a whole set for a culture like this:
Code:
portraitType = {
name = "PORTRAIT_germangfx_male"
background = "GFX_character_background"
hair = "GFX_german_hair"
mouth = "GFX_german_mouth"
chin = "GFX_chin"
nose = "GFX_nose"
eyes = "GFX_german_eyes"
cheeks = "GFX_german_cheeks"
ears = "GFX_ears"
neck = "GFX_german_neck"
}
Notice that the name is made up of culture name and suffixed with gender and that each part is specifying what spriteType to use. If a culture doesnt exist the game will fall back to a roman look.
Feel free to spread this to the mod forum if you want.