• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

pfried

Warlord
35 Badges
Aug 23, 2010
161
67
  • Crusader Kings II
  • Victoria 2: A House Divided
  • Deus Vult
  • Europa Universalis III: Chronicles
  • Sengoku
  • Rome Gold
  • Stellaris Sign-up
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Horse Lords
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Victoria 2
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Age of Wonders III
  • Imperator: Rome
  • Imperator: Rome Sign Up
  • Crusader Kings III
  • 500k Club
  • War of the Roses
  • Cities in Motion
  • Teleglitch: Die More Edition
  • Ship Simulator Extremes
  • Magicka
  • Knights of Pen and Paper +1 Edition
  • Impire
  • Hearts of Iron III
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Cities in Motion 2
  • Crusader Kings II: The Old Gods
Current Version: 3.0 (Feb. 17, 2019) for Patch 3.0+.

This mod aims to make the effects of inbreeding more realistic and transparent by taking a thorough account of a character's genealogy.

The effects of inbreeding are now more strongly felt after generations of inbreeding and less so during the first few generations.

This mod extends genetic checks to characters deemed unrelated by the base game, such as great-aunts/uncles/nieces/nephews, great-great grandparents/children, first cousins once-removed and more. Further, "partial" relationships are now included, such as half-uncles/aunts/cousins, double cousins, sibling cousins and the like.

The following additional relationships are checked by this mod:
Standard:
self
parents
children
siblings
uncle/aunt
niece/nephew
grandparents
grandchildren
cousin
half sibling

NEW:
sibling-cousin
sibling-half-cousin
double cousin
three quarter double cousin
great grandparents
great grandchildren
half uncle/aunt/niece/nephew
great uncle/aunt/niece/nephew
half cousin
great half-uncle/aunt/niece/nephew
great great grandparents
great great grandchildren
great great uncle/aunt/niece/nephew
first cousin once removed

This mod does not alter any of the original game files and is only a script mod, so it should be compatible with any future versions of CK2 and most mods.

This mod currently has built-in support for genetic traits introduced in HIP, CK2+, and AGOT. If you'd like to see built-in support for genetic traits introduced in other mods - let me know and I'll be glad to make it so!

Consanguinity

Characters who are born of parents who share some coancestry (or are somewhat inbred themselves) now obtain a trait that measures how inbred or "consanginous" they are.

The percentage value in this trait represents half the chance of that person being born as an inbred and/or lunatic as a result of inbreeding and how inbred their own children could be. It also increases the odds for inheriting genetic traits from parents who are close - for example two cousins with "Strong" are more likely to produce a child with that trait than two unrelated parents who are also both strong.

It is also possible for a character to be so inbred that further inbreeding has no effect. Characters whose parents are closely related and have 100% consanguinity obtain the "Purebred" trait, making them immune to random mutations and ensuring that traits shared by both parents are always inherited. The trait is also passed on when two characters who are purebred have children. Modders can also add this trait to characters as a means to disable harmful effects from inbreeding.

You may freely incorporate and make modifications to this mod. All I ask is that you give me some credit if you choose to do so.

To do:
Expand checks to include the (quadruple-/triple-/double-) second cousins, first cousins twice-removed, half great-great uncle/aunt/niece/nephews.

Update history:
3.0:
Major code rewrite and optimizations
Added checks for sibling-halfcousins, half-great avunculars, great-great avunculars, and first cousins once removed
Homozygosity decreases faster if parents are not of the same race
Fixed an issue where homozygosity wasn't properly inherited if the father died prior to childbirth
Renamed "Homozygosity" in localisation to "Consanguinity" for improved immersion
Added a game rule to control GIS behavior
- Show Consanguinity
-- Controls whether consanguinity traits are visible. Defaults to ON

2.1:
-Fixed some typos resulting in imbecile being given out improperly
-The initial event now triggers for characters on their birth, to save on processing costs and so that stillborn and babies who die in less than a week will still get evaluated.
-Added several very specific flags mentioning exactly how the child's parents are related. Mostly of use to modders.
-Fixed some logic causing incorrect values of homozygosity to be given out.
-Reduced heritability of lunatic and inbred (the former has become way more prolific in the base game...)
-Added a case for when a woman impregnates herself...

2.0:
-Fix for homozygosity not being added to characters whose parents were avuncularly related or cousins when a link was dead.
-Homozygosity is now calculated using variables rather than traits.
-Discrete traits still exist, and now give players an estimated (to 2.5%) rather than exact value of homozygosity.
-Homozygosity gain has been reworked to be more realistic.
-Localisation tags added to events just in case.
-Removed the negative trait mutation chance.
-It is now possible for a character to be born with both the lunatic and inbred trait rather than one or the other.
-Reduced heritability of lunatic/inbred traits for unrelated parents (from 50%/parent to 25% as in vanilla).
-If a character is affected by an increase in homozygosity the odds of inheriting genetic traits increase as well, depending on how high homozygosity is.
--This means that if two cousins both have the "Strong" trait their children are much more likely to inherit it than if it were two unrelated parents instead.
--Purebreds always inherit any and all genetic traits that parents share (affects vanilla CK2 and HIP traits).
-Purebred now only requires both of a character's parents to be at 50% homozygous. This trait is now achievable by the 4th generation at the earliest rather than the 5th.
-Purebreds are now immune to mutation (ie they will not inherit traits that their parents don't have). Only checks vanilla CK2 and HIP traits for now.
-More complicated fractional relationships (ie half-cousins, 3/4 siblings, etc) are now checked.

1.02:
-Characters that born to parents that are ethnically Iranian (or West/High Valyrian for AGOT) are more likely to obtain the lunatic trait instead of the inbred trait.
-Relationships between double cousins are now checked.
-Added the 'Purebred' trait.
--This trait is given to characters whose parents and grandparents are all 50% homozygous.
--Purebreds do not spontaneously obtain negative genetic traits from inbreeding (though they can still inherit them if their parents have them)

1.01:
-Genealogy checks are much more comprehensive and checks the hidden genealogy of all characters involved.
-Character flags are now set on any characters whenever homozygosity increases due to close relations.
-Great-grandparent/child and grand/great aunt/niece/nephew/uncle relationships are now checked for inbreeding.

1.00:
-First public release

Potential/Known Bugs:
-No bugs so far
 

Attachments

  • pmod_GIS_300.zip
    14,4 KB · Views: 385
Last edited:
  • 4
  • 3
Reactions:
I was just going to ask about twin incest but then I remembered dudes don't get pregnant :confused:
Anyway, this is far better than vanilla! Good job :happy:
 
Interesting. This is actually quite an interesting concept for anyone looking at playing Zoroastrians. Have you considered making the values tied to the concept of how much genetic overlap there is? Parents share 50% of their genetic material with their children, so if they had a child together you'd expect roughly 25% of the material to be reduplicated. Exactly the same applies for brother-sister from same parents relations. Grandparents share only 25% with their grandchildren, so if they had a child together, you'd expect only 12.5% to be reduplicated. Similarly, you'd expect first-cousins to share only 12.5%, so if they had a child you'd expect 6.25% to be reduplicated.

If you were to round down to the nearest integer, you'd get the following results:

parent-offspring 25%
full siblings 25%
3/4 siblings or sibling-cousins 18%
grandparent-grandchild 12%
half siblings 12%
aunt/uncle-nephew/niece 12%
double first cousins 12%
great grandparent-great grandchild 6%
first cousins 6%
quadruple second cousins 6%
triple second cousins 4%
half-first cousins 3%
first cousins once removed 3%
double second cousins 3%
second cousins 1%
Every other relation would produce not be greater than 1 prior to rounding.

This way, the amount of homozygosity would be less arbitrary and instead more closely linked to the actual amount of genetic material you'd expect incestuous relationships to share.

I'd also lower the bar quite substantially for negative traits to happen. Immediate relation inbreeding (all the ones marked 25% above) has immediate negative effects; parent-child relations have a mortality rate of 60% within the first five years of life (according to Wikipedia, at least), never mind just a 50% chance of negative traits. 10% would be the area you'd expect a 50/50 for negative traits, and 20% you'd expect a 50/50 chance for death!
 
Last edited:
  • 1
Reactions:
Sounds great I have always wanted a mod with more detailed inbreeding!
 
So... can you explain to me why I would want to use a mod that makes Zoroastrianism inherently unworkable?

(Also I'm not sure that 'go in the exact opposite direction' is much more realistic)
 
Interesting. This is actually quite an interesting concept for anyone looking at playing Zoroastrians. Have you considered making the values tied to the concept of how much genetic overlap there is? Parents share 50% of their genetic material with their children, so if they had a child together you'd expect roughly 25% of the material to be reduplicated. Exactly the same applies for brother-sister from same parents relations. Grandparents share only 25% with their grandchildren, so if they had a child together, you'd expect only 12.5% to be reduplicated. Similarly, you'd expect first-cousins to share only 12.5%, so if they had a child you'd expect 6.25% to be reduplicated.

If you were to round down to the nearest integer, you'd get the following results:

parent-offspring 25%
full siblings 25%
3/4 siblings or sibling-cousins 18%
grandparent-grandchild 12%
half siblings 12%
aunt/uncle-nephew/niece 12%
double first cousins 12%
great grandparent-great grandchild 6%
first cousins 6%
quadruple second cousins 6%
triple second cousins 4%
half-first cousins 3%
first cousins once removed 3%
double second cousins 3%
second cousins 1%
Every other relation would produce not be greater than 1 prior to rounding.

This way, the amount of homozygosity would be less arbitrary and instead more closely linked to the actual amount of genetic material you'd expect incestuous relationships to share.

I'd also lower the bar quite substantially for negative traits to happen. Immediate relation inbreeding (all the ones marked 25% above) has immediate negative effects; parent-child relations have a mortality rate of 60% within the first five years of life (according to Wikipedia, at least), never mind just a 50% chance of negative traits. 10% would be the area you'd expect a 50/50 for negative traits, and 20% you'd expect a 50/50 chance for death!

I took this into account already. For every 1/8th of genetic overlap between parents, the child gets 5% homozygosity, roughly corresponding to what you've written above. While I did initially try to implement a far more detailed and nuanced method of calculating overlap the engine doesn't make it easy due to the absence of mathematical functions for scripting. The way the mod is currently set up only resolves for values of homozygosity at 5% intervals. If you take a look at the events in the mod you'll see how tedious it is to calculate averages using just 10 traits and then note that each new trait increases the number of checks substantially. I'll increase the number of traits and thus the resolution in the near future though.

@Raineh Daze:
I see your concern. When I initially made this as a personal mod, TOG wasn't out yet so I designed it with Habsburg-style inbreeding in mind. When TOG came out I left it the same with the assumption that Zoroastrians would make up for it using concubines (In fact, when I play Zoroastrians I use concubines as a way to reduce inbreeding and then use Xwedodah marriages for all children - though it's worth mentioning that I play with a custom fertility mod).

Keep in mind that the odds of a child getting the inbred trait when at 50% homozygosity is about 30%. For children with 20% homozygosity, like those born of first generation parent-child or full-sibling pairings, the chance is only 12%. I usually get a lot more than 1 in 8 children with that trait when I play vanilla.

Feel free to make any suggestions and I'll take them into account.
 
Last edited:
His point was that twins of differing sexes are never identical.
Yeah basically this (they're as congruent as regular siblings), but then I remembered that the game engine gives twins the same DNA regardless of whether the're identical or not :confused:
 
I don't think I've ever seen twins that look identical (in the game), strangely enough, just vague similarities.
It's because they share 10/11 genes (so they're pretty much identical but not 100%) as that last gene is random AFAIR
 
Btw, it looks like it doesn't check for real father. I got homozygosity despite the fact that the real father was related to my charachter at all.

Thank you for catching this. It appears that real_father is checked for all other homozygosity calculations other than the addition of the base value. I'll put out a fix for this soon.
 
Last edited: