They have a text file in raw/graphics and a picture in raw/graphics. Picture is the same as a tileset, but can be any size. The text file looks like this:
graphics_crystal
[OBJECT:GRAPHICS]
[TILE_PAGE:CRYSTAL]
[FILE:crystal.png]
[TILE_DIM:16:16]
[PAGE_DIM:1:1]
[CREATURE_GRAPHICS:CRYSTAL]
[DEFAULT:CRYSTAL:0:0:AS_IS:DEFAULT]
It says OBJECT:GRAPHICS to tell DF its a graphic file. TILE_PAGE is just any ID you want to use. FILE is the filename of the picture file. TILE_DIM is how many pixels it uses for width/height. PAGE_DIM says how many tiles there are, in this example its a picture with only 1 tile. Then comes CREATURE_GRAPHICS with is the creatures ID, and now comes the interesting part:
DEFAULT means normal adult version of the creature look like this. 0:0: are the tile coordinates in the picture file (since its only 1 tile its 0:0, the first from to top, the first from the left) AS_IS means that the color is exactly like its painted in the picture (could also take the color from the raws, but usually that doesnt look very nice, so barely anyone does it) and DEFAULT is again the normal adult version.
You can make a sprite for a adult, a kid, a war-trained and a hunting-trained creature.
Thats for normal creatures. Much more complex are the graphics used for civ members. They are profession based and noble-based, that way a lumberjack looks different from a miner, but both look like a broker if you appoint them as a broker, and it changes again if said broker becomes a soldier, which again displays different graphics depending on his highest weapon skill. Making a sprite for a normal creature is 1 picture, maybe a second one for the kid version. Making sprites for civs is a lot more work, you need ~ 150 little icons.
All that is fun and game until you realize that caste-specific graphics dont work. Possible applications are:
- Male and Female is determined by caste. One could make a male spider look smaller than a female spider, to get closer to RL representation. Or give all domestic animals a ribbon. Blue for male, pink for female, that way people can look at their grazing animals or guard dogs and instantly see the difference. Rooster wouldnt look like chickens, and bulls wouldnt look like cows.
- Modders often use castes to give special abilities. For example guilds or mages. There is no way atm to portray this graphically. Your level 100 epic fire mage, who happens to have gemcutting as highest skill, will look like any other gemcutter in your fort. Your Masons Guild migrants, who can learn stone-related skills very fast and gets boni, might have butchery as highest skill when he arrives (Random Number Generator be cursed), and you have to check his description to notice. (Most people use Dwarf Therapist for that, it can sort by caste. Without it, it would be a nightmare)
- Modders could mix races. Thats a big one. People can easily write a creature file that merges dwarves, humans, goblins, elves and kobolds. With proper stats, names, skill learn rates, everything. You can make a multi-cultural fort, and have lots of options, from friendly traders to enslaved war prisoners, to an elven hippy retreat that just welcomes everyone. The problem? All of them would use the same profession graphics, so they all look the same. They would look like dwarves.
- Male/Female graphics for civ members... Dwarves are always those bearded people with random names that never tell you who is male or female. Caste specific graphics would mean you can make a female-looking profession tileset for dwarves. Or any other race where that might be important.
- Other races might have weird castes in them. For example dwarves turn a dwarf into a golem, or orcs have everything from normal orc, darker-skinned uruks, large ologs and tiny snagas. Currently they look the same.