Crusader Kings II

Crusader Kings II

Improved Genetics (OLD VERSION)
 This topic has been pinned, so it's probably important
Crimson7  [developer] Sep 20, 2018 @ 9:57pm
Explanation of how the mod works
There are two types of inheritance models in this mod. There are 4 Polygenic 'groups' and 7 Mendelian groups. Each have 3 allele pairs associated with them for a total of a 33 letter DNA string.

The Polygene groups each have several traits associated with them:

  • Intelligence has Genius, Quick, Bright, Dim, Slow, and Imbecile
  • Attractiveness has Attractive, Comely, Homely, and Ugly
  • Strength has Strong, Sturdy, Delicate, and Weak
  • Height has Giant, Tall, Short, and Tiny

The traits in bold are new traits that I have added to each polygene group in order to better see the system working.

What does polygenic inheritance mean? It means that the distribution of genes and traits roughly corresponds to normal distribution (see the main page), and that the number of dominant alleles will determine the likelihood you will get a certain trait.

In contrast, the 7 genetic disorder traits (dwarf, stutter, lisp, hunchback, stutter, clubfoot, and harelip) are modeled by Mendelian inheritance. This means the likelihood that you will have one of these traits is solely dependent on how many recessive pairs you have. So, there is no difference between AABBcc and AaBbcc. The chance is solely reliant on cc. Of course, the chance is compounded if you have multiple recessive allele pairs.

This has interesting effects for inbreeding. Since inbreeding with close kin will most likely result in an overall DNA string with lots of dominant pairs (AA) and lots of recessive pairs(aa), inbred characters will naturally end up with more genetic disorders. As a result, the mod also buffs the 'inbred' trait for game balance and realism.

Now, how does inheritance actually work and how is it better than vanilla? In vanilla, if my character is a genius and his wife is not, then there is a 15% inherit chance, and if your child does not get it, its over. The gene leaves your family for good.

However, with this mod installed, the gene will likely persist in your family. For example, if you are a genius, you likely have 5 or 6 dominant alleles in the intelligence group - AABBCc, say. If you marry a wife who is normal (the majority of people), she will have 3 alleles - AaBbCc. Your child's traits will then be based on punnet square random chance. The child could, for example, end up as AABBCC in the best case, or as AaBbCc in the worst case. But in either case, the fact that you are a genius means that your children will at the very least have more carriers of the genius and quick traits than average.

Do note, however, that there is a possibility that your wife is not normal, and has lower quality genes in the intelligence group. This won't necessarily manifest itself in her - the genes might not be activated. So she could have aabbcc (absolute trash) in the intelligence group and not be an imbecile. But having children with her will dilute your genes.

This makes it quite important to look at your spouses ancestors traits, not just their traits.
Last edited by Crimson7; Nov 7, 2018 @ 8:09pm
< >
Showing 1-10 of 10 comments
Azeloth Sep 26, 2018 @ 3:57am 
Hey is there somo more dominat and superial genes what supress inferiour genes. Like if family have had like 3 generation of geniuses and he marrys with slow or imbecil, his dominant genius gene can dominate slow and likely child still get genius trait or just quick. So my idea would be like to have multible level of gene strenght and succesful breeding program can create realy strong and likely passable traits like superhuman in 10 generation even if he breeds with thouse who dont have genius, and quick trait, of couse marrying with slow of imbecile in multible generation can also weaken genebool and make good trait to pass on less likely, but neutral ak missing traits should still be dominated by strong gene by good traits and also domiated strong gene by negative traits
Crimson7  [developer] Sep 29, 2018 @ 11:43am 
@Azeloth

Well one way to naturally do that would be to use more alleles. But that would be computationally intensive.

I think a very easy way to implement this is to use the Bloodlines feature in CK2 Holy Fury. That will apply some 'deep rooted' genes to a bloodline, and then characters will naturally be more likely to have the gene persist even more deeply in their bloodline.

So I'm just waiting for Holy fury to do that.
Nico Nov 18, 2018 @ 1:49am 
This seems like a very useful and well thought out mod. I'll definitely be trying it. How do your genetics interact with the inbreeding protection of the sacred marriage mechanics?
Crimson7  [developer] Nov 18, 2018 @ 3:09am 
I believe those protections are a lower chance to get inbred trait? Yeah my mod won't change that. I think the only difference is that inbred families will have a higher chance of getting various congenital defects.
Geeky Dec 8, 2018 @ 10:07am 
So why don't you also change the way to get the inbred trait? The way that the Paradox have been using is ridiculous. Use a list of 50 pairs of genes. At the beginning of the game for each pair only 2 percent of people have a recessive gene and a dominant gene while the others have a pair of dominant gene. Who get the recessive gene is decided randomly. And anyone who have at least one recessive gene pair in those pairs will get the inbred trait. By this way we can have a good simulation of the real life.
Crimson7  [developer] Dec 8, 2018 @ 10:15am 
Geeky, the inbred calculation system is hardcoded
Geeky Dec 8, 2018 @ 11:04am 
Originally posted by Crimson9:
Geeky, the inbred calculation system is hardcoded
As I know what make the inbred trait decided by the hardcoded calculation is the "inbred=yes" modifier, so when you delete this (or even delete the old inbred trait totally) and make a new inbred trait decided by my way this problem can be solved easily.
Geeky Dec 8, 2018 @ 11:10am 
Originally posted by Crimson9:
Geeky, the inbred calculation system is hardcoded
In fact some of the players have deleted the inbred trait because they like to marry their relatives, but they have not found any bug. As a result, deleting the old inbred trait and create a new inbred trait decided by the new way is feasible.
Crimson7  [developer] Dec 8, 2018 @ 11:31am 
Oh I see. Yes, well if I did that it would be possible I suppose. I decided not to tinker TOO much with vanilla for this mod though. And I'm currently working on other projects. Perhaps in the future I'll see how we can improve the inbred system.

For the traits modeled through mendelian genetics, improved genetics DOES simulate inbreeding somewhat. If you use charinfo with an inbred family, you will see that most people have double recessive or double dominant alleles, which is what you'd expect from inbreeding and it leads to higher chances of deformities.

Of course, it would be even more accurate and realistic if I used more alleles, which I might add in the future. But I'm currently working on another large modding project.
swaggernagger Jan 6, 2019 @ 3:34pm 
Originally posted by Geeky:
So why don't you also change the way to get the inbred trait? The way that the Paradox have been using is ridiculous. Use a list of 50 pairs of genes. At the beginning of the game for each pair only 2 percent of people have a recessive gene and a dominant gene while the others have a pair of dominant gene. Who get the recessive gene is decided randomly. And anyone who have at least one recessive gene pair in those pairs will get the inbred trait. By this way we can have a good simulation of the real life.

What do you think is ridiculous about it? I personally find the ancestor calculation quite clever, and pretty close to the way we'd calculate someone's inbredness.
< >
Showing 1-10 of 10 comments
Per page: 1530 50