You have a good point that the hybrid-ing tags belong with the parents, so there is less need to scan all of the raws and specific population ratios can be set.
So, under the ELF:FEMALE caste you'd have something like [HYBRID:HUMAN:MALE:HALF_ELF:100] and [HYBRID:HALF_ELF:MALE:HALF_ELF:100].
It is very important that the game would proceedurely generate the hybrid creature as it occurs; it would not be written into the creature files in the
raws. This is the key thing that is very important, or else I will have to actually manually add a hybrid for every possible creature that I creature.
I could for instance go through every creature presently in the game and add a half-xvart for each of them. But I do not know what combination of modded creatures the player is using. Say my player is using Direforged and our xvart marries an auride, I have not defined a xvart-auride cross.
With proceedural generation however, during World-Gen the game went through the total number of intelligent creatures in the game that have the basic humanoid bodytype and made up a hybrid creature with a generic name (half-something) for everything that exists; unless the creature raws specifically forbid it from happening. This means we will have XVART_KO_DF_AURIDE_HYBRID as the code-name and the creature will have a generated name along the lines of Half-Xvart/Auride.
As for species and the like, it's important to keep in mind the difference between a class and an instance of that class. OBJECT:CREATURE is a class, and OBJECT:CREATURE:DWARF is an instance of that class. It's also a class in itself because Urist McExample is an instance of the OBJECT:CREATURE:DWARF class.
The closest analog to a species in DF is a specific OBJECT:CREATURE:? class. Two OBJECT:CREATURE:DWARF instances can breed with each other, an OBJECT:CREATURE:DWARF instance and an OBJECT:CREATURE:GOBLIN instance cannot. This has naught to do with whether the things could actually cross-breed in reality (e.g., horses and donkeys can't make mules).
The entity_default.txt file defines the various OBJECT:ENTITY:? classes in the game. If you're playing on a reasonably large world, there will be more than one instance of each class. So OBJECT:ENTITY:MOUNTAIN is a class and The Silver Billows is an instance of that class. At the moment, instances of an OBJECT:CREATURE:? class can vary quite a bit from one another, but instances of an OBJECT:ENTITY:? class are almost identical. In fact, other than the name, the only thing differentiating newly-placed instances of an OBJECT:ENTITY:? is the OBJECT:CREATURE:? chosen to inhabit it (and for most vanilla ones there is only one choice).*
A civ (which is used as shorthand for "an instance of any OBJECT:ENTITY:?") will have a single OBJECT:CREATURE:? native to it, though other individuals (shorthand for "an instance of any OBJECT:CREATURE:?") can join in later. Marriages only occur between members of the same civ, and I think only between members of the same OBJECT:CREATURE:? class. In any case, only pairs within the same OBJECT:CREATURE:? class can breed.
So there is no particular reason that two civs would be different "races" any more than OBJECT:ENTITY:REALWORLD:United States and OBJECT:ENTITY:REALWORLD:Canada would be.
A caste is an instance of its parent OBJECT:CREATURE:? class, though specifying castes in the raws are a bit of a mess. Each individual is marked as being a specific CREATURE and a specific CASTE. Although most vanilla creatures have two castes MALE and FEMALE, with the MALE caste being of male gender and the FEMALE caste being of female gender, that is not true of all creatures. For a vanilla example, look at ants and ant men. Any male caste can breed with any female caste of the same OBJECT:CREATURE:? class. The wiki has a semi-serious example of making a single creature definition that has some castes similar to humans and other castes similar to giant cave spiders. Nothing would prevent a male "human" from marrying a female "spider" and having children. Also, the castes of children are based on the whole OBJECT:CREATURE:? class with no regard for the castes of the parents (other than requiring them to be a male and a female).
*Stay tuned, variations between instances of an ENTITY:? are definitely planned.
The system should be based upon body-type. Spiders will never be able to hybridise with humanoids whatever the case, but all intelligent humanoids will be able to hybridise with other intelligent humanoids which are not massively larger that have the same body type unless it is specifically defined otherwise.
What this means is that a xvart will be able to automatically hybridise with an auride unless either of us specifically defines that they can't by adding in any of these entries to their creature file.
INFERTILE: ALL
INFERTILE: KO_DF_AURIDE
INFERTILE: XVART
We can also have infertile hybrids.
INFERTILE_HYBRID: ALL
INFERTILE_HYBRID: KO_DF_AURIDE
INFERTILE_HYBRID: XVART
By default however it generates a hybrid creature by scrambling the values of both xvart and auride parents. They may end up with blue skin or golden skin, they may end up as tall as an auride, as short as a xvart or somewhere in the middle. The name, the symbol and the proceedurely generated hybridisation 'rules' are laid down in the generated creature entry.
However in the case of another creature, the reptilian Enku will not be able to crossbreed with xvarts because of the following problems.
Feathered Enku CasteBODY:HUMANOID_NECK:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:
FORKED_TONGUE:TEETH:RIBCAGE:
TAILXvartBODY:HUMANOID_NECK:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:
TONGUE:
FACIAL_FEATURES:TEETH:RIBCAGE
The game guesses the evolutionary relationships between all the beings that your game has. Because the two creatures do not have the same body-type definition, the game guesses (correctly I think) that their similarities are the result of paralell evolution rather than common ancestry and so whatever the relationships no half-breeds between the two creatures will be generated.
I understood what you meant. It is just wrong, though. Skin color (and all other biological markers) is clearly defined in the creature raws, not in the entity raws. Entity is purely culture and behavior, not any physical traits or anything that seems like it would be relevant to genetics.
And if you want two skin colors to be able to intermingle and breed, yet still be meaningfully defined and separated things in the raws, the only way to do that currently is with two castes, each of which has a specific range of skin colors and other features.
Specifically, you would do 4 castes if you wanted two races of dwarves explicitly defined:
Male+black dwarves
Female+black dwarves
Male+white dwarves
Female+white dwarves
Castes might work right now as a hackish way to mod in hybrids that seem to function if you want, but there's no way currently to really "properly" do it as not-either-species as intended with the raws. It would really have to be a change to the code to work elegantly. Which is appropriate as this is the suggestions forum. So he came to the right place.
Unless you are more ignorant of the game than I would suspect you are definately misunderstanding what I mean by entity. By entity I do not mean the entity file I mean the
individual proceedurely generated civilization that is based upon those files. A race is not generated per entity, based upon the creature file a race is generated for each civilization.
A civilization actually has a native race created for it, you do not end with a random distribution of black skin and white skin and other genetic traits within the population. Instead the civilizations native population always has a limited range of genetic variation that is less than the total of the species; so that means that entity/civilization biologically correlates with race in the game.