The cutie marks themselves are implemented as colors that override the normal coloring for a pony's skin on their flanks. The files descriptor_color_cutiemark and descriptor_color_cutiemark_evil define the colors that represent specific cutie marks. The IDs of these colors in the color RAWs are referenced by individual pony creature files - without putting in or modifying tokens inside the creature file for a type of pony, cutie marks are just weird colors that don't do anything besides crop up on forgotten beasts every now and again.
For
non-stable ponies, the cutie marks are added by simply selecting all castes, selecting the skin tissue layer group for the upper leg (which refers to the
rear legs), giving that tissue layer the name "cutie mark" and adding all the cutie mark colors as color modifiers, with equal probability, and defining the stage of the pony's life at which the color appears (ponies only get cutie marks after a certain age). This is found at the bottom of each pony's creature definition. Rangers work a bit differently because only unicorns get cutie mark colors (EPs are wearing armor over theirs) but the general idea is the same. Note that non-stable ponies currently do not get special cutie mark bonuses.
Stable ponies work differently. For each cutie mark, there are three parts which relate to cutie marks and the bonuses that go along with them:
- Near the top, there are the pop ratios and in game descriptions for each caste, including the description of each caste's special talents.
- Roughly half way down, the skills, extra bonuses (spellcasting etc) and the various details of their appearance* are defined. This is a large part of the creature_pony file.
- At the very bottom, cutie marks are associated with each caste. At the moment, each caste has it's own cutie mark
In addition, there are a bunch of places where groups of castes are selected (all males, all unicorns etc). If you are adding new castes, you will need to select your caste in each block of [SELECT_CASTE:...] tokens so they don't miss out on vital tokens.
Be aware that another modder has been down the path of adding lots of extra castes before, and
there is a limit to the number of castes you can add without there being problems. We are at 296 castes at the moment, the limit is 326. You could add another 30 if you want, but from there things will break. You could add multiple cutie marks per pony though, that would be completely safe to do so long as you didn't hit another limit somewhere (which hopefully won't happen unless you are making hundreds of cutie marks per caste).
On a related note, I am tempted to unify a lot of the similarly themed castes as well as some of the narrower castes and instead give castes with broader skill sets multiple cutie marks. Not much is added by having separate armor crafting, weapon crafting, metal smithing and metal crafting cutie marks, for example - a blacksmith caste can replace all of those, and that caste could have a dozen different cutie marks associated with it. Likewise, a lot of the narrow miscellaneous farming category tasks (lye making, bee keeping etc) could be rolled up into one or two castes. A couple of castes (like whip user) could be cut entirely. I took a quick skim of the caste descriptions and I could reduce the number of castes by around 50 or 60 if I do this. Moving slave/freed slaves/blanks into their own file would also free 16 more castes. If 30 more castes isn't enough for you (note - each cutemark+skills combo requires 4 castes), this is an option to open up more space for extra castes.
*At least some of these are the same across castes. I haven't checked the extent of duplication yet - for all I know literally every pony has identical coat colors, and the same scheme is redefined 300 times. I just know that I copied a skin color definition and pasted it over a few others and Git said that nothing changed.