Crusader Kings II

Crusader Kings II

Improved Genetics (OLD VERSION)
547 Comments
LUCIFER † Jan 19, 2020 @ 7:59am 
Hi. I've spent some time in the last year Trying HIP and I have to say that I was quite impressed with the work your mod did. Amazing work, feels like I'm playing a genetic simulator which is something i like very much as I like genetics very much. Though now, I'm trying to play CK2+ but I can't find the "Improved Genetics CK2+" mod anymore. When I click on the link for the Workshop page it says that the item I am looking for can't be found. Did Steam set it to invisible or it is supposed to be like this? Thank you for your kind reply!
eightiesboi Apr 11, 2019 @ 12:48pm 
@Remus - any mod that is based on genetics instead of RNG will have a disproportionate effect. The only way you can have the clubfooted trait (beside an event or a bug) is if you have the gene. If the gene exists in dynasty A, but doesn't exist in dynasty B, and the two dynasties have no interactions, then in a mod that simulates genetic inheritance there will be a disproportionate number of clubfoots when comparing the two families; however, in the total population the statistical likelihood that any given child will be a clubfoot will be unchanged from stock (unless you control for lineage).

This mod simulates an event that occurs in real life (the expression of genetic traits through the inheritance of genes). It is a substitution for the RNG that the game uses. If you prefer vanilla, use vanilla. But attempting to call out the mod-maker for adding a method of genetic propagation when you (as evidenced by your comments) have a more limited grasp of the subject is foolish and rude.
Jacobus Apr 11, 2019 @ 11:34am 
I'm sure people like your mod. I didn't know that it was working as intended. I just find that it disproportionately spreads bad genes.
Crimson7  [author] Apr 11, 2019 @ 11:33am 
@Remus thats fine. The problem is that the base game has too many clubfoots. I try to balance the mod so that it doesnt change how many clubfoots and other deformities there are. I am very aware that the number of harelips, clubfoots and so on is unrealistic. But tinkering with that would mess up game balance.
Crimson7  [author] Apr 11, 2019 @ 11:31am 
@Remus

"There is no such thing as a 'weak' strong gene. He will either be strong, or no trait at all (there would be no modifier) He is average. "

Okay that's just silly. There are many genes that contribute to strength. We don't fully understand it yet, but what we can certainly say is that there isn't 'one particular gene' that gives people strength. It is common to see several families have extremely strong genes. Others, not so much.

Don't tell me how genetics work if you aren't an expert. If you don't want to use it. Don't. I'm not on a contract to make mods for you. I'm making mods that I think people will enjoy. This is about MY VISION of genetics based on my knowledge, and how I think it will improve the mechanics of ck2. If you don't enjoy it, don't use it. But don't act like my mod 'doesnt work.' It does, as 495 positive ratings clearly suggest.

If it doesn't mesh well with your vision of genetics, thats fine. Vanilla has its own system. You don't need to use this.
Jacobus Apr 11, 2019 @ 11:29am 
I like the idea of the mod, I just find it annoying that I can't have 5 kids without one of them being clubfooted. That's unrealistic.
Crimson7  [author] Apr 11, 2019 @ 11:26am 
@Remus
"I don't see how that is realistic. If both parents are white, then the kid will be white. There isn't a 'small possibility of the kid being black.' That's not how genes work."

Total fallacy. White people typically don't have latent african american genes. On the other hand, attractive people CAN have latent genes that causes unattractiveness. Have you ever come across siblings that don't all look equally good? I have. I've met people who are geniuses and their siblings are about average or below average.

Jacobus Apr 11, 2019 @ 11:15am 
I don't see how that is realistic. If both parents are white, then the kid will be white. There isn't a 'small possibility of the kid being black.' That's not how genes work.

Likewise, if both parents are strong, and 'weak' isn't in the genes, there shouldn't be a possibility of 'weak' coming up as a trait. There is no such thing as a 'weak' strong gene. He will either be strong, or no trait at all (there would be no modifier) He is average.

This isn't realistic, and that's not how genetics work. The only way that 'weak' will come up as a trait is the character has 'weak' in their genes. That is a gene OF AND IN ITSELF.

Sure, their descendants can be strong if they bred with strong people. But there should be no 'weak' strong gene because if both parents are strong with strong genes and no weak gene, then there shouldn't be a possibility of my kids being weak imbeciles.
Crimson7  [author] Apr 11, 2019 @ 11:01am 
@Remus

Umm, there was nothing wrong with the mod.

"If a character has perfect genes, like Genius, Strong, Attractive, and his wife has the exact same genes, my kids turn out to get delicate/ugly/dim sometimes."

Lets say I'm strong and my spouse is strong. To be strong, I could have 4,5 or 6 alleles. My wife could have 4,5, or 6 dominant alleles.

If we both have 4, then the minimum our child could have are 2. (AaBbCC + AaBBCc) = (aaBbCc). If they have 2, then they can get either weak or delicate. its a low chance, but it is possible.

In this case both the mom and dad had a 'weak' strong gene. Not a strong one. There is a distinction, one that you can only see by going through the families or typing in charinfo.

Improved Genetics 2.0 works the exact same way. Thats how genes work irl. I'm not trying to make the game easier with this mod, but more realistic and thoughtful.
Jacobus Apr 11, 2019 @ 10:50am 
Thank you @Crimson9. And thank you Eight. It was something wrong with the mod itself
Crimson7  [author] Apr 7, 2019 @ 6:23pm 
Thanks @eightiesboi

Note to everyone: the new version of this mod is out:
https://steamcommunity.com/sharedfiles/filedetails/?id=1706741706

Please use that instead. HOWEVER, note that you will have to manually change the directory of your files to continue your save games. I would suggest only using the new version on a new save. Thanks!
eightiesboi Apr 6, 2019 @ 8:46am 
@Remus and @rik77, are you running the latest edition of CK2? If so, if you read down a few comments before yours, you will see the mod isn't updated for the new release that dropped a few days ago. Either revert to an earlier release of CK2 or be patient. Also, note that the mod author lost access to the mod itself on the workshop, as it says in the intro to the mod. (Although I happen to know a new, improved version is coming!)

If you are not running the most recent (3.1) version of CK2, there are four possibilities; either your genes aren't as pure as you believe, the parents of the child in question aren't the parents you think they are, a game event is modifying traits, or there's a genuine bug. Let's look at these possibilities. (Broken into multiple posts due to Steam limits on discussions.)
eightiesboi Apr 6, 2019 @ 8:45am 
(Continued from above) 1. When you say the parents have "perfect genes" are you looking at the Charinfo for those characters or are you guessing from the traits? If it is the former, you need to look at the pairs for each trait and (IIRC) realize it is possible for someone be a genius with five or six dominant genes. The genes indicate the possibility for the trait in your family, *not* whether the trait is expressed in a given character. So it is entirely possible for traits to be in your gene pool even though you don't see them expressed in the parents. The only way to know for certain whether the parents have the genes is look at the charinfo. Just like real life, you can't know for certain the genetics of a given set of parents merely by looking at the expressed traits without diving deeper. (Continued below)
eightiesboi Apr 6, 2019 @ 8:45am 
(Continued from above) 2. The next thing to consider is that the genius characters you believe to be the parents of that dim child may not actually be the parents. Check charinfo for the child. You may see that the real father differs from the acknowledged parent, because the mother was engaged in something on the side. If mom has five out of six of the genes for intelligence, and real dad was an imbecile, the child would have not have the genius trait and could indeed have traits for low intelligence.

3. Game events can modify your traits outside of genetics. Again, looking at the charinfo for the character and the parents would let you know what genes the child has and what genes the parents have. IIRC, if an event has given a trait, that is indicated either in charinfo or in the game logs. (Continued below)
eightiesboi Apr 6, 2019 @ 8:45am 
(Continued from above) 4. Bugs do happen, although this mod has been out and stable across many players' installs until recently. If you are not running 3.1 and you think you have an actual bug, look at the genes for the characters and post screenshots and/or logs so someone here can help you.

TL;DR: If you're running 3.1, this mod isn't updated yet (AFAIK). If you are running 3.0 and lower, everything is probably running as intended, but if you want help you need to submit more information.

(Note: I am *not* the mod author, but I've been using this mod for a long time and appreciate the effort that @Crimson9 has taken to develop this mod and maintain it for all of us FOR FREE. As you report issues, remember that mod authors (mostly) don't work for Paradox and are players just like the rest of us, except they've taken the time, energy, and effort to create something to enhance their game and share it us without compensation. A little gratitude for their work never hurts.)
klirko Apr 6, 2019 @ 12:20am 
I like how you actuallly made inbreeding dangerouss. Still do it tho
rlk77 Apr 5, 2019 @ 11:59pm 
@Remus, the same to me, distroyed my important dynasty gene pool lines, even with the worst traits - ugly and dumphead - possible out of blue.
Jacobus Apr 5, 2019 @ 11:08pm 
If a character has perfect genes, like Genius, Strong, Attractive, and his wife has the exact same genes, my kids turn out to get delicate/ugly/dim sometimes. I find this annoying.

Other times, they do get other traits, but it's annoying when traits that aren't in the gene pool pop up.

Now, if I had negative traits, I would 100% expect them to be added to the gene pool and my kids have poor genes, but this simply isn't the case.
Zigzag9000 Apr 4, 2019 @ 9:05am 
New update requires a couple of lines around line 6458 in TRAITS_02.TXT to be copied over.
jfb8300 Apr 4, 2019 @ 3:26am 
Any idea if this mod circumvents the potential bug in vanilla explained here: https://forum.paradoxplaza.com/forum/index.php?threads/so-fathers-stats-only-affect-bastards.1164528/
Crimson7  [author] Apr 3, 2019 @ 12:35pm 
@rlk77

Hmm, well alas thats the problem with trait mods. If Paradox adds a new trait, all the new traits get messed up. Because traits are stored in the save game as numbers, pointing to the number of the trait in a list. If a new trait gets added everything goes down by one.

I dont know why everyone would have dim.

I believe you could solve it by just getting rid of the new traits. The other traits shouldn't be affected.

Future games shouldn't be affected either.
rlk77 Apr 3, 2019 @ 4:25am 
Some strange thinks happen since Version 3... I got oposite traits,e.g. giant/tall and tiny and small together, and since 3.1.. all my characters have a dim trait, so my rulercharacter has a genius and dim trait now, I dislike that... And since I have an ironmode game, the game is not playable when I deactivate the mod in the registercard at the start screen. Is this fixable?
Elegit Mar 27, 2019 @ 5:55pm 
Hmm, when used with Sketchy Traits this seems to inverse the inheritance system and give opposite traits to what the parent had, interesting.
Dirzylene Mar 14, 2019 @ 11:05pm 
Crimson9, I will not argue.
of course, SIr, you know better.
Dirzylene Mar 14, 2019 @ 9:58pm 
So. after a series (~ 15) of birth experiments, I found out the following:

Primo - and most important - everything works, Sir! Please accept my humble apology for disturbance.

Secundo - I found out the source of "non-manifestation" of the trait!
Considering Your words in mod's description - "NOTE: IF YOU DO NOT LIKE THE NEW TRAITS: Download the drop box version for the first time, and then remove the common / traits / newtraits.txt file " - I tried Your mod first time with removing this file. As a result, when the script came to the percentage distribution, and in the case when Your new traits were dropped, my poor little daughters - instead of at least bright (or, in other cases, homely) - recived only whole lot of nothing.
(Accordingly, for using Your mod without Your new traits, It needs to rewrite something in the genetics event file.)
Thank You again for Your help, Sir.
Crimson7  [author] Mar 14, 2019 @ 7:32pm 
@Dirzylene

Is the child dim, slow, or imbecile?

Search for 'bright' in the character selector. Do any kids have the trait?

double check if the child has INT_AA, INT_BB, INT_CC.

Other than that, I can't see why it wouldn't work. Perhaps an image might help.
Dirzylene Mar 14, 2019 @ 7:18pm 
Crimson9, my thanks to you for explaining everything to me in detail.
However, it is NOT possible to have AABBCC and NO intelligence trait, unless they lost quick through education.
Since the child was only born and did not study yet, it is not clear why he does not have a trait.
I will try a few more times, perhaps this is a random failure of the script - it happens ...
Crimson7  [author] Mar 14, 2019 @ 7:05pm 
@Dirzylene

Well... ALMOST. 30% for genius, 50% for quick, 20% for bright. So 100% chance to get one of them...

However... There is a very small chance for a genetic mutation (about 1%.)

If you want to know how it works in detail. The improved genetics system replaces 90% of the vanilla system. However, for randomness purposes I do keep the 'birth chance' of the base game active to a lesser degree. This is a random chance to get a trait and it works BEFORE my system. So you could have intAABBCC, but due to a genetic mutation (random chance) be an idiot. This is very rare though.

This is intentional to add just a tiny bit of randomness.

However, it is NOT possible to have AABBCC and NO intelligence trait, unless they lost quick through education.

Dirzylene Mar 14, 2019 @ 6:56pm 
Crimson9, What i was saying is that you are seeing 3 alleles for the LAST group
Ok, Forgive me for not understanding you earlier.
So, If I comprehend you correctly, if the child has int AA, int BB, int CC, this child MUST has genius, or quick, or bright without fail?
Crimson7  [author] Mar 14, 2019 @ 6:51pm 
like this.
Set Alleles to 0. Set int AA, int BB, int CC. Alleles = 6. Set Genius. End.
Set alleles to 0. Set attr Aa, attr bb, attr cc, alleles = 1. Set ugly. End.
Set alleles to 0. Set str Aa, str Bb, Str Cc. Alleles = 3. Set nothing. End.

You see alleles 3. But that doesnt mean it was 3 when intelligence traits were calculated.

Crimson7  [author] Mar 14, 2019 @ 6:48pm 
@Dirzylene

It doesnt.

This is the way it works:

create intelligence alleles for the baby
lets say int AA, int Bb, int CC
create the allele variable, set it to 0
Add 2 for AA, 1 for Bb, 2 for CC.

The allele variable is now 5.

Set the INTELLIGENCE traits associated with 5 alleles to the baby. That is, 10% chance for genius, 30% for quick, 40% for bright.

END intelligence group, set alleles variable to 0.

Next group is then entirely independent.

The alleles variable is reused. What i was saying is that you are seeing 3 alleles for the LAST group that the allele variable is used in. It does NOT mean that the intelligence alleles add up to 3. Whatever the intelligence alleles added up to was used and then the variable was reset.
Dirzylene Mar 14, 2019 @ 6:41pm 
Crimson9, It probably became 3 for another trait group
With all due respect, how can intelligence be affected by, let's say, appearance? However, your mod, your rules...
Is there any optimal variant for the traits in the game to be inherited logically and not chaotically - as you did - but still independently of each other? Probably add a separate alleles value for each feature?
Crimson7  [author] Mar 14, 2019 @ 6:28pm 
@Dirzylene

"in order to get the trait of intelligence, there must be alleles value = 6"

Not true. You can get genius with 5 or 6. And quick with 4, 5 or 6.

"but since the generations of values from other genes overwrites it, the “6” is not formed at all"

it doesnt overwrite it. The alleles for intelligence are calculated, the relevant genes are assigned, and then the alleles variable is reset for the next trait group. This allows me to not clutter the game files with too many variables.

If she has AABBCC, her alleles variable was set to 6. It probably became 3 for another trait group. Once it is set to 6, she has a 30% chance of genius, 50% chance of quick, and 20% chance of bright (or something like that.) So in all likelihood, you should have seen her get one of those traits if her alleles for INTELLIGENCE are AABBCC (intAA, intBB, intCC)
Dirzylene Mar 14, 2019 @ 6:20pm 
Sorry, another question: in order to get the trait of intelligence, there must be alleles value = 6;
But there is no separate variation for each individual trait (only); as a result, (AA = 2) + (BB = 2) + (CC = 2) should be given 6, but since the generations of values from other genes overwrites it, the “6” is not formed at all. And therefore, my daughter with AABBCC, by a strange (but explainable above circumstance), has neither genius nor quick (alleles=3.000). So it was intended?
eightiesboi Mar 14, 2019 @ 5:40pm 
Enjoy! The longer you let the mod run in game, the more the effects will be apparent (pun intended!)
Dirzylene Mar 14, 2019 @ 5:33pm 
Hurray!! so for everything's works... And then we'll see.
Dirzylene Mar 14, 2019 @ 4:29pm 
eightiesboi, thank you for replay!
Luckily I always make save before my children born, so the quick test is possible.
eightiesboi Mar 14, 2019 @ 4:20pm 
Hi @Dirzylene. I am not the mod dev, but I've been using this mod consistently for a while now, and I can probably answer your question. It is likely nothing is wrong. The mod doesn't go and add new traits to all of the existing characters. What it does is, when a child is born, it adds genes to the parents of the child and then determines the genes (and associated traits) inherited by the child. So when you first install the mod, you shouldn't see anything different until a child is born.

If you want to check that the mod is working, and you have the console enabled, you can use charinfo to check any child and the parent of any child that was born *after* the mod was installed.

If you don't see anything listed for the alleles, post back.
Dirzylene Mar 14, 2019 @ 4:08pm 
Good day!
I started the new game, then save and open file - no one character had your mod's genetic flags. Although, in accordance with start events, all new created characters should receive this flags. What's wrong?
Crimson7  [author] Mar 3, 2019 @ 11:49am 
@Gropy

Not right now. But I will be adding the initialization event from the HIP version to the dropbox vanilla version.
Gropy Mar 3, 2019 @ 1:14am 
Anything new in the dropbox version compared to the version here avaliable on steam?
Crimson7  [author] Feb 19, 2019 @ 6:01pm 
lol
Samir Al-Hayjid Feb 19, 2019 @ 5:55pm 
i mean even a gene correlating to cancer is called CK2. coincidence? i think not.
Samir Al-Hayjid Feb 19, 2019 @ 5:54pm 
hm. seems possible but i guess i could just have bad luck
Crimson7  [author] Feb 19, 2019 @ 5:27pm 
@Schlomo ShekelNein

To answer your other question, yes all the genetic info is observable on the charinfo screen, provided your resolution is high as there is a lot of info there.

Cancer being genetic seems to be one of the old wives tales that CK2 communities have developed lol. There is nothing in the code that I can see which suggests cancer is remotely genetic.
Samir Al-Hayjid Feb 19, 2019 @ 5:03pm 
ohk thanks dude.

I thought cancer was genetic as certain dynasties seem to be plagued by it. Additionally, if one of the parents has cancer when the child is concieved, the child seems to get cancer later in life. Or maybe i'm just unlucky :P

well thanks for the quick response and im glad its not too complex
Crimson7  [author] Feb 19, 2019 @ 4:53pm 
Do note though that only 3 allele pairs are being used for each trait. So the effect of inbreeding is not TOO much. Marrying someone outside your family every few generations should be enough to stop inbreeding depression. I'm planning 'improved genetics advanced' which would use more allele pairs but I'm not sure if there is demand for that.
Crimson7  [author] Feb 19, 2019 @ 4:53pm 
@Schlomo ShekelNein

It adds depth. But err.. its not TOO complex. Cancer is not genetic. No trait that is not a congenital trait in the base game is congenital here.

I may change that in the future.

Height is determined by the polygene model. So if one character is short and the other is tall, in all likelihood their child will be medium height.

Incest still gives the inbred trait. It ALSO increases susceptibility to hunchback. So... its twice as bad. I feel like the inbred trait is stupid but I can't really get rid of it as many events use it so... Whatever. But yes, incest in this mod makes your genes tend towards homozygous genes. These can be either dominant or recessive, so yeah you could have successful eugenics experiments here, but in all likelihood you will have a few recessive pairings in one of the birth defect traits.
Samir Al-Hayjid Feb 19, 2019 @ 1:28pm 
say if one character has the short trait while the other has the tall trait, how is it determined which trait is dominant? Can you tell whether a character has a homogenous gene or is a carrier for a gene using the charinfo function? Will genetic susceptibility for cancer work the same way? Will incest still give the inbred trait or just increase your susceptibility to genetic diseases like hunchback that someone in your family is a carrier to?

Sorry for so many questions, I think this adds a lot more depth to the eugenics of this game that definitely works and doesnt leave your kids inbred.
Crimson7  [author] Feb 16, 2019 @ 10:43am 
@anduls

Well.. the system actually allows for random mutation. Like, in the base game there is a chance you will get a trait without actually having any genes for it. So I've left that in place (though i toned it down.) So even if neither of your parents have ANY dwarfism gene, you could become a dwarf. The PROBLEM with that system is that you wont have the dwarf gene even though you aren't a dwarf... so its not a a real mutation and your children wont take the dwarf gene.

That said... this is a pretty easy fix. Since they get the mutations before the genes, I can just override the gene assignment and give them mutated genes. But I am planning on implementing it in 'improved genetics advanced' where I'm also adding more alleles.

Right now this mod is... mostly finished I think. I don't have access to edit it any way. So All these new ideas have to go into the new mod, unless Steam stops being stupid.