The line of inheritance in this game doesn't really make sense - according to the dynasty table the firstborn child is always the first in line for the throne, unless the firstborn dies or marries into another faction. The dynasty chart should update to show the eldest son as the first in line for succession for non-egalitarian factions (or eldest daughter, if an option for matriarchal factions is added - though I would prefer that I be allowed to set the faction heir/heiress at will). But, the firstborn CAN marry into another faction, meaning that only the eldest (surviving) son is really important in the line of succession (or would be, if succession actually occurred), because by the time your sovereign gets killed you have probably married off all of his/her children. So, it would be a better idea to make it so that if a faction has the trait 'Egalitarian', the faction will keep the first two children and send away the second two (or, if the firstborn child is a girl and marrying another faction's firstborn son, have there be a go/stay chance dependent upon the relative power of the factions - this could go for all of the children of an 'Egalitarian' faction and the sons of Patriarchal factions and daughters of Matriarchal factions, with a guarantee of at least one child choosing to stay; or have who joins what family be part of the Dynasty negotiation in the Diplomacy screen - i.e., my daughter marries your son, but your son comes to me, my daughter doesn't go to you vs my daughter marries your son and will get there yesterday). Also, the primary line of succession for a given faction shouldn't switch sides as easily as family members in other lines of succession unless the child is, say, 3rd in line for both thrones or something like that (I also wouldn't mind this becoming a way to take over factions or at least pieces of factions, or set up 'protectorates' - kill off the old sovereign and support a friendly candidate for the now-vacant throne for a diplomatic boost if the candidate succeeds at seizing the throne, or gain a 'protectorate' if the candidate manages to pull away at least one settlement from the parent faction, but suffer a big diplomatic hit - might already be at war from supporting your candidate - with the faction if you support a candidate who splits the faction or dies trying to take over the faction; or say that the faction's throne falls to you because your son married the firstborn daughter of the dead sovereign - this may involve war to 'suppress pretenders to the throne'). I feel like the game should track all the lines of succession for all factions through all children, and tell the player what factions a given dynastic hero is a potential heir(ess) for and how far down the line they are in the background window. While doing that, please make a generic dynastic hero background. Example:
(name) was born to (father) of (father's faction) and (mother) of (mother's faction) during (season) of (year). (He/She) is (number) in line for the throne of (name's faction) and came of age in the (season) of (year) after (pick a reasonable number) years training (as/to be) (a/an/{no article})(name's class) in (birth faction). {if birth faction and name's faction are not the same, perhaps include some kind of randomly selected reason for leaving birth faction - as in "Hearing (his/her) mother's stories of how great (mother's faction) was, (name) chose to leave behind (father's faction) and set off for (mother's faction) at once." or "Unwilling to support the ceaseless wars of the (King/Queen) of (birth faction), (name) chose to seek (his/her) fortune in (mother's faction)." Or some other simple story - could also include equivalent stories for why the character stuck with his/her birth faction} [After this, include a table similar to the one for city caravans listing each faction which this character is in the line of succession - the factions should be listed in order of how close the character is to being the heir/heiress, though with the character's chosen faction being first, and the table should include a number indicating position in line of succession (1, 2, 3, ... or 1st, 2nd, 3rd, ...). Each faction should only appear in the table once, and only list the highest position in the line of succession available to the character. Or, you could include a sentence saying something like 'Renouncing all claims to the throne of (mother's faction/father's faction), (name) chose to join (name's faction) when (he/she) came of age.'] {if/when the character gets married, include a line like 'Married (spouse name) of (spouse faction) during the (season) of (year), (joining spouse faction/welcoming spouse to character's faction).'}
Can we also see the line of succession actually have an effect in game? It is kind of annoying to discover that when the sovereign of a faction dies, the faction (and all associated cites, units and heroes) vanish from the world as if they never existed. At the very least allow bits and pieces of a dead faction to join factions that have pieces of the dead faction's royal line, with bigger 'pieces' going to factions with stronger claims to the dead faction's throne (though with some weight also given to the territorial boundaries and affiliations - an Empire's cities should be more likely to join another Empire with preference to the closest, strongest one with a claim to the throne, preferably resulting in contiguous regions joining factions, rather than a few cities scattered across the map joining factions). A better way for this to happen would be to actually use the line of succession as a line of succession ("The King is dead, long live the King!"), and allow foreign factions to support 'alternative' candidates to the throne - members of the foreign faction's family that have a claim to the throne can be given military support to take part or all of the faction that lost its sovereign, possibly with a chance of cities/units/heroes defecting to the foreign candidate's banner with enough charisma, and a chance of members of lines of succession that are not likely to inherit rebelling; both of these types 'alternative' candidates could seek/receive foreign assistance, resulting in diplomatic bonuses and penalties depending on faction relationships with each candidate and what candidate(s) emerge victorious. In line with the multiple candidates for the throne, perhaps allow the candidates to settle with one another (perhaps even by marrying, thus joining the two candidate's factions), allowing for splinter factions to spring up.
As far as sovereign offspring creation goes, I think that the class that the child becomes should be based on percentage chances, for instance: 20% chance to have the same-gender parent's class, 15% chance to have the other parent's class, all other classes (with perhaps some exclusions if things like the 'Warlord' class are never made to do anything, and maybe a small amount of extra weight to the chance to pick up the 'Royalty' class) having an equal weight chance to be chosen for the character class.
For traits and abilities (which I will refer to as traits in this paragraph), I think that each trait should have a base chance (and a minimum and maximum chance which are used if the current generation's chance exceeds the maximum or dips below the minimum allowed chance) to be inherited, with modifiers (as in, +/- 5%) based on whether the child is the same gender as the parent with the trait for traits that have to do with physiology (i.e., 'Hardy'), with modifiers (as in +[100% - parent's_generation_chance]/10 if one parent had the trait, -[parent's_generation_chance - min_trait_inherit_chance]/10 if neither parent had the trait, and rolling for the trait twice if both parents have the trait - only get the trait once). I personally think that the base chance for most (or all) traits should be between 40 and 60 percent (possibly even have the base chance be a random number within this range generated on the sovereign at the beginning of the game) with the minimum and maximum chances being numbers differing from the base chance by 20-30 points (i.e., base chance of 50% has a max chance of 70-80% and a min chance of 20-30%). Also, if a character fails to get any of the possible traits, up to three traits with the highest chance of being inherited should be allowed to roll again for those traits, with reduced chance (for instance, a trait that had a 60% chance would have a 50% chance, or something like that) and a 25% chance to not roll for the other traits after each trait roll.
Chance formula: Current_Chance = (Base_Chance + Generation_Modifier + Gender_Modifier) or (Max_Chance if less than calculated chance) or (Min_Chance if more than calculated chance)
I also think that any and all traits/abilities available to heroes should have some chance to appear, though only one 'new in the family' trait/ability per character, but that this chance should be something like 5-10% (this number becoming its base chance for the formula) while no member of the character's ancestry has that trait/ability, increase the chance of inheritance by 3% per generation with the trait (while the minimum trait chance will be used, the generation trait chance will remain less than the minimum chance for several generations), and have a 10+ point penalty to its normal min and max chances (so if a trait normally has a minimum of 35% and maximum of 80% chance to be inherited, getting it as a random new trait would would reduce the minimum and maximum chance to no more than 25% and 70%; or, possibly, cut the min and max chance values in half or by a quarter or some such thing).
While I'm thinking of it, could you attach the random name generator to heroes so that if a hero of that name already exists in the game world the hero gets a random name instead?