RimWorld

RimWorld

Better Gene Inheritance
211 Comments
μuKnew Jun 9 @ 2:22pm 
Does the archite inheritance slider determine the final likelyhood of archite inheritance, or is it affected by the secondary parent modifer? For example, if I have a 50% chance per gene on secondary parent, and a 100% modifer on archite inheritance, does it result in a 50% chance overall, or a 100% chance?

Also, two minor suggestions:
1. Customizable primary parent values for inheritance, as right now inheritance appears to be either: both parents' genes are inherited at 100%, or one parent disproportionately affects the child's genome (100% for primary parent, barring overrides from secondary that are randomly inherited?), based on config.
μuKnew Jun 9 @ 2:22pm 
For example, I would like a 65-75% inheritance from both parents, as 50% would be realistic, but likely to extinct exotic genes over a few generations due to the low population size of a colony. At the same time, I don't want every colonist to have nearly every gene in the colony after a few generations either as a result of, effectively, everybody being related.

2. An FAQ would be nice

That all being said, great job making a mod that fixes a lot of the issues with inheritance in vanilla.
RedMattis  [author] May 31 @ 4:16am 
@GladioSanctus, Vampire
Just set the mod config to inherit 100% of both.

Keep in mind that unless you're using mods that reduce gene costs it may run over budget. Also conflicting genes will always get overwritten (E.g. Strong Immunity + Perfect Immunity)
Kaedys May 30 @ 12:26am 
Sanguophage are a xenogerm type, so they're not inheritable by default. This mod has an option to allow xenogenes to be inherited, so disabling that will prevent the sanguophage genes from being passed on (you can use the sanguophage's Gene Implanter to injected them to a pawn, though). Alternatively, applying any xenogerm to the pawn, even if it has only a single trivial gene in it (I believe even hair and skin color genes qualify, but I'd have to test it), will completely overwrite the xenogenes of the target pawn, erasing their Sanguophage heritage.
Evono May 29 @ 10:28am 
Will sangouphage genes be inherites too ? or can i filter genes ? dont want to end up with hundreds of vampires haha
GladioSanctus May 19 @ 10:47am 
Is there any way to make it so a child will 100 percent inherit both parents genes? Especially if im playing with archite and some genes from mods that makes metabolism cost nothing?
Vampire May 16 @ 4:59pm 
So if I wanted children to inherit 100% of the genes from both parents, what would the ideal configuration for that be?
Kaedys May 14 @ 11:41am 
Ya, the game determines genotype not by the combination of genes, but by very specific logic. A pawn only has a specific genotype if that genotype was directly applied to them (ex. a xenogerm), or if the genotype is considered inheritable (vanilla, only germlines, with this mod, optionally xenotypes as well) and BOTH parents are of that exact genotype. If the parents differ on genotype, even if the child ends up with all of the genes from one genotype and none from the other, the game still considers them a "hybrid". This mod would have to Harmony patch that method (PregnancyUtility.ShouldBeHybrid()) to make the dominant and recessive genes avoid that. I noted that issue here a couple years ago, but it didn't really go anywhere.
Meikai May 12 @ 7:15pm 
Hmmmmm. So dominant genes on a custom germline xenotype will make it so any offspring they have with baseliners will come out with only the custom xenotype's genes... but as far as I can tell, they won't technically be of that xenotype? Like if you made Asari from Mass Effect and wanted them to be able to mate with baseliners, their kids would come out blue with squigly heads but the game would still consider them baseliners instead of Asari.

Is there a way to make it so the dominant gene xenotype is inherited along with everything else when using dominant genes? I mean I can just use character editor to fix any kids who come out baseliner, but it'd be cool to not need to do that.
Momon May 5 @ 10:06am 
But seeing the baby's genetics should already tell you enough.
Momon May 5 @ 10:05am 
Use the character editor mod and change the age of the baby then just load a previous save from before you altered the age of the baby.
Juroguy Johnson Apr 8 @ 12:59pm 
well its from vanilla expanded, which is made by one of the devs. so i dont know.

the problem is i have to wait 30 ingame days for the child too be born so testing it is slow as hell
RedMattis  [author] Apr 7 @ 12:16pm 
@Juroguy Johnson
That is from a mod as well, right? If so it depends on how the modder coded it. :)
Juroguy Johnson Apr 7 @ 11:12am 
thanks for answering btw
Juroguy Johnson Apr 7 @ 11:12am 
does oviparous work? if not then it'll just have too be for more baseline pawns.
RedMattis  [author] Apr 7 @ 8:35am 
@Juroguy Johnson
It doesn't work for things that have their own method for calculating genes, which the chestburster gene does, iirc.
Juroguy Johnson Apr 7 @ 8:32am 
Binary inheritance doesnt seem too work with insectors chestburster gene, babies are a random xenotype but with all of their inherited genes from one parents added onto that xenotype.
Juroguy Johnson Apr 3 @ 1:49pm 
If i use the Xenogene/endogene parasite implanter, and my colonist has binary inheritance, does it guarantee that the child only has their genes and none from the victim?
Hive colonists have a nasty problem of constantly being "Mutants" according too the game due too the 25% gene inheritance from the victim chance.
makeshiftwings Apr 3 @ 1:38pm 
@RedMattis Cool thanks! About the second one, I had a Nephilim from the Nephilm mod that has "Grace" powers that work kind of like hemogen, and the power genes are marked as Required: Grace, but they had a child that had the powers but not the Grace gene.
RedMattis  [author] Apr 3 @ 10:20am 
@makeshiftwings
1. It randomizes between those ranges, but the final result is clamped to 0%-100%.

2. Yes, that is possible. I think I already do that, but I'm not completely sure.
makeshiftwings Apr 3 @ 9:27am 
Hi, I had two questions:
1) In the settings, you can move the "Max percent from second parent" past 100% up to 200%. What does that mean? How would inheriting 200% of their genes do anything?

2) Is it possible to make it so that a child can't inherit genes with "Requires X" unless it also inherits X? For example if you inherit hemogen powers that require hemogen to use but you don't have the hemogen gene, then you can't use the powers but you still pay the metabolism cost for all those useless genes.
kahvipensas Mar 22 @ 9:51am 
Really like the new settings,especially the min%. There used to be too many cases of a baby becoming almost a copy of one parent and getting almost nothing from the other one. Now I can fiddle with the balance (and get on with my slightly deranged breeding experiments)
Vulkandrache Mar 18 @ 7:21am 
The chance is heavily reduced without mods.
But its still possible and the inbred gene exists.

But im sorry, i confused this mod with
https://steamcommunity.com/sharedfiles/filedetails/?id=2881479142
which is what i am actualy using.
RedMattis  [author] Mar 18 @ 5:45am 
@Vulkandrache
Probably not no. I only check the parents genes. Though Iirc. Rimworld doesn't normally let pawns that are blood relatives get into relationships to begin with.
Vulkandrache Mar 17 @ 8:20am 
Am i correct in assuming that using this mod there will never be pawns born
with the inbreed gene?
Because im not getting any.
CobaltFox28 Mar 14 @ 11:34am 
Nice! I installed the mod anyway but haven't got any new genes yet. Can't wait to try it
RedMattis  [author] Mar 13 @ 12:47am 
@CobaltFox28
Yes, you can mix and match genes over multiple generations.
CobaltFox28 Mar 12 @ 9:40pm 
Does this mod allow hybrids to pass on genes?
RedMattis  [author] Mar 12 @ 12:18am 
@Huehuecóyotl
That is correct.

The only exception is mods that add alternate pregnancies (e.g. eggs) since they may have their own logic instead.
Huehuecóyotl Mar 11 @ 10:07pm 
So if every pawn in the game had your mod's Binary gene, it would always force newborns to be a complete genotype selected randomly between the parents instead of a hybrid, no matter the circumstances? A baseliner with binary and an impid with binary would ONLY make baseliner or impid babies, never a hybrid for example? That would be pretty much perfect if that's the case, and a patch to apply the gene dynamically to every genotype would be absolutely amazing. I've been trying to find a mod to do this for literal months.
RedMattis  [author] Mar 8 @ 4:25am 
@C00p3r
Primary would mean that the primary parents genes will always be inherited excepting any genes that ended up overwritten by a randomly migrated gene from the Secondary parent.

@AGrey
This mod patches the event to check the parents. It is possible Alpha Genes is grabbing a random other pawn for Asexual Fission.

@Huehuecóyotl
You' have to patch the "Binary" gene unto every xenotype in that case. It would be fairly simple as a patch operation if you don't me writing one of those though.

@Colossus of Chodes
That is unfortunately a bit beyond the scope of this mod. Vanilla Expanded has a version of that gene that works for endogenes though,
C00p3r Mar 6 @ 10:41pm 
If I breed two xenotypes with Primary Genes and Secondary genes, respectively, will that work like Binary Inheritance with odds skewed towards taking the primary parent's genes?
AGrey Feb 18 @ 10:30am 
I ran into a weird bug with Alpha Genes.

One of the genes allows pawns to reproduce asexually - they just pop out a baby every 25 days.

But for some reason, the baby had all of the genes from its parent, and all of the genes from a completely random colonist who wasn't even in a relationship with the parent (who had actually joined the colony just days prior, so I know for a fact that they didn't have sex at any point)

Not sure if this is from your inheritance mod, or if this is a problem with Alpha genes.
Huehuecóyotl Jan 22 @ 8:33pm 
Does this mod dynamically add dominant and recessive genes to pawns when they're generated, or do you have to add them yourself?

That is to say, if I have mods that add custom genotypes, will I need to character editor the dominant/recessive genes manually into everyone I recruit or will it happen automatically?

I'm trying to find a mod that just nullifies the hybrid genes system entirely and forces the baby to just be one of the parents' genotypes, and so far this looks like the most promising option and I'm hopeful.
Shodan2072 Jan 12 @ 10:03pm 
Could you add a genelocked gene which makes it so that only skin and hair colour genes (if available) are passed on from that parent, and the other parent can pass on genes as normal (unless they also have the genelocked gene) in which case the baby gets only skin and hair?
Zhugelaocunfu Jan 5 @ 5:39am 
Does this mod works with the menstruation mod (RJW)? Because they are using their own pregnancy system and I don't know does it work.
Colossus of Chodes Jan 3 @ 7:21pm 
Small issue I've had crop up: a pawn that inherits the Gene Implanter archite gene isn't able to actually use the ability it grants because it only transfers xeno genes to the target. Unsure if this is within the scope of the mod to fix.
RedMattis  [author] Jan 3 @ 6:04am 
@Luxy ♥
This doesn't do anything to animals, so that seems very unlikely.

@Arky
I honestly don't see much of a point to doing so. The vanilla system is heavily flawed and prone to breaking, I think. I'd rather not risk getting bug reports due to issues with Ludeon's own troubled inheritance implementation.


@Lethes
Noted. I'll have a look when I'm back at some point when I'm back at my proper computer. :)
Luxy ♥ Jan 2 @ 7:26pm 
Is there anyway this mod could have possibly allowed my coyote to breed with a cow?
Arky Dec 23, 2024 @ 9:01am 
Could you add a setting to keep vanilla inheritance unless some of the custom genes (recessive, primary, etc.) are present?
The Bard of Hearts Dec 11, 2024 @ 10:12am 
Sorry I'm not much help in this situation, but I'm glad this issue is getting some attention. =)
Lethes Dec 11, 2024 @ 9:52am 
@RedMattis
The part where you calculate the number of genes to transfer.
And looking at the code, you also copy every gene from ParentA, then only after you add a subset of parent B's genes

How to reproduce the issue ?
Use the mod "Character Editor", then add a new pregnancy via the Health bar
RedMattis  [author] Dec 11, 2024 @ 1:28am 
@Lethes
I probably made some dumb mistake somewhere when adding a feature some days back.

What comments in the code were outdated btw?

How do you reproduce the issue? When I tested it things worked fine.
Lethes Dec 10, 2024 @ 11:59am 
@RedMattis
I have the same problem, except sometimes you will have a pawn with mixed genes.
Also, looking at your code, you don't do what is actually written in comment. You probably need to refactor that part.
Bjark Dec 10, 2024 @ 9:44am 
The inheritance genes dont seem to work with the Egg laying genes from Alpha Genes or VE. Not sure if its possible but a patch would be amazing
The Bard of Hearts Dec 10, 2024 @ 12:57am 
Nope. And this isn't just one couple. I've run about 5 different colonies and this is always the case as stated below with well over 20 or so offspring.
RedMattis  [author] Dec 10, 2024 @ 12:09am 
@The Bard of Hearts
Not seeing any issues here:

https://imgur.com/lPJ4vN3

Are you sure you don't have something like the "dominant gene" on either parent?
The Bard of Hearts Dec 9, 2024 @ 4:41pm 
With this mod installed, ALL babies always have 100% of a single parent's genes. No Mix and match, no chance for anything unique. If its a baseliner/xenotype"A", the baby WILL BE xenotype"A". if its parents are Xeno"B"/Xeno"A", the baby will be either 100% Xeno"A" or 100% Xeno"B". Its been happening consistantly for about a year. Finally tracked it down to this mod being the culprit.

Anything I can do to help fix this issue? Is this a known problem?
mood Nov 9, 2024 @ 1:20pm 
love the binary inheritance, i have a lot of custom xenos based on animals and im hoping this mod will forbid horrific abominations from being born
Alt Nov 5, 2024 @ 9:03pm 
Big thank you for Binary Inheritance. That is what i so desperately needed for my RImsenal Askbarn playthrough where male and female of that specie will have some genes specific to the sex.