RimWorld

RimWorld

727 ratings
Better Gene Inheritance
3
6
2
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.4, 1.5, 1.6
File Size
Posted
Updated
442.152 KB
Oct 6, 2023 @ 12:31pm
Jun 21 @ 9:28am
20 Change Notes ( view )

Subscribe to download
Better Gene Inheritance

In 2 collections by RedMattis
Red's Workshop Mods
38 items
Quality of Life & Base Pack
44 items
Description
Much improved gene inheritance for Biotech.

I made this mod because I wasn't quite satisfied with the various gene inheritance mods already on the workshop.

With this mod you will get less babies skipping most of their parents genes and overall more logical inheritance.



Settings





You can set xenogene inheritance, archite gene inheritance, amount inherited from the (random) secondary parent, etc.


Details



Unlike vanilla this mod will not give you a bunch of babies with 20% of their parents genes and a metabolism of 225%.

It will build up a list of semi-random genes to inherit, this list will also always include every shared by both parents. If the metabolism ends up too high it will remove genes with a metabolism cost; preferring those not shared by both parents.

If one parent has no genes with metabolism and are flagged as a baseliner then they will by default be used as the primary parent, meaning a random % of the other parent will be migrated over, this is to avoid combinations with baseliners sometimes creating babies with 100% of the other parent's genes.


Additonal Features



By popular request there are now a few genes that modify how inheritance works.

Recessive and Dominant Genes
If a parent has dominant genes only their genes will be passed out and vice versa for recessive genes. If both have dominant/recessive genes it is random as usual.

Compatible with the genes from Vanilla Races Expanded - Highmate

Primary and Secondary Genes
Similar to the above, except instead of passing on only one set of genes, the genes of a character with "Primary Genes" will be considered the primary parent, and unless metabolism is too high all valid genes will try to be passed on. Note that genes from the other parent can still overwrite genes from the primary parent.

Secondary Genes of course does the opposite.

Binary Inheritance
The Binary Inheritance gene, if applied to BOTH parents will make it so an entire gene set from one parent will be picked at random. Suitable for xenotypes with castes or extreme sexual dimorphism.


Final Word


Let me know if you have thoughts, feedback, any kind of issues, and so on.

Mod Discord
[discord.gg][ko-fi.com]
227 Comments
ShadowX116 9 hours ago 
It also seems to be happening for other endo species I have that don't lay eggs.
In their case, it obeys the dominant gene set, but still labels the babies as Baseliners.
I've heard this might be a Character Editor issue, but switching to the other one (can't remember the name atm) has issues with some mods I have.

Any suggestions there, or am I just stuck reapplying genes thru Character Editor?
RedMattis  [author] 13 hours ago 
@ShadowX116
Alpha Genes has their own logic for the eggs. Same with stuff like the AG parasitic implantation.
ShadowX116 Jul 1 @ 8:39pm 
Hey so.. I'm running an Ant colony where I have a Queen ant (species) and a Drone ant (species).
The Queen has the recessive gene and set to not inheritable genes (xenogerm).
The Drone has the dominant gene and set to inheritable genes (endogerm).

The idea is that the Queen only produces Drones via eggs (alpha genes I think?), but the game is still throwing "baseliner" babies with genes that stray from my Drone species when they hatch. I've had to resort to using Character Editor to fix the genes.

This mod's settings are the following:
Min % from second parent: 0.10
Max % from second parent: 1.00
Xenogenes can be inherited: 0.00
Archite genes shared by both: (Yes)
Lowest permitted metabolism: 0 (Both parents have flat 0 metabolism)

How do I make the game understand I want the babies to be the Drone species only?
Kaedys Jun 30 @ 1:50pm 
Ya, the other big issue with recessive genes is that, afaik, a mod can't actually control which of several competing genes is actually active in a given pawn without much more invasive patching. So the best the mod could do would be add both competing genes, and let the game's own random selection pick which is active. That would work just fine for your average coupling, since the idea is random inclusion of genes anyway, but falls apart when it comes to Dominant, Recessive, or Binary.
RedMattis  [author] Jun 30 @ 12:56am 
@Vulkandrache
That's the benefit of mods, you can pick the one you prefer. :D

As for: "when overridden by a competing one as that means the gene cant turn up later as the dominant one in one of the descendants."

Ideally the game would track recessive genes to handle such thing, but for the typical rimworld game, where you rarely see more than one or two generations I think this works fine.

No solution is going to end up perfect, and my main goal is always whatever I believe plays and feels best within the scope of a rimworld typical run.
Vulkandrache Jun 29 @ 7:57pm 
And that is why i am
https://steamcommunity.com/sharedfiles/filedetails/?id=3225695697
instead of yours. I dont want a main parent. And i dont want genes to be lost
when overridden by a competing one as that means the gene cant turn up later as the dominant one in one of the descendants.
A simple 50% chance per parent per gene makes for far more interesting long-term breeding.

I do understand your reasoning with mixed Xenotypes failing a 50% roll on either parents gene
and thus ending up with the human version of that bodypart.
But that is a price im willing to pay to get the important stuff passed on properly.
RedMattis  [author] Jun 29 @ 2:36pm 
@μuKnew
Thing is, lost genes isn't... lost genes.

If you lose trotter hands you gain human hands.

If you lose an insectoid mantis head you gain exactly a human's head complete with teeth and all.

If an slime that reproduces via division loses that gene they gain the exact reproduction mechanism of a human.

- - -

If a lost gene meant drifting towards some sort of generic default it would have been different ofc, but that isn't really the case.

For that reason I think the best way to handle "lost" genes is by removing genes that get overridden or fail to carry over from the second parent.

Finally, dramatic non-crippling/killing mutations in nature are rare. It is far more likely to lose a because a gene from another parent took that place.
Kaedys Jun 29 @ 2:15pm 
The exception installed for baseliners also tends to fall down when breeding one race with a lot of genes and one race with only a couple metabolic genes. You end up with the same issue, a 50% chance of the child being essentially 100% the larger-genetic parent, with maybe 1-2 extra or overridden genes.

Instead, I'd recommend an altered algorithm somewhat based on vanilla (but much less restrictive). First, all genes shared by both parents are automatically inherited. Next, the metabolic complexity of the child is computed and compared to the average of the two parents, with some random slush (say +- 20%?). Non-shared genes are randomly added until the child reaches that threshold. All remaining non-shared genes then have a 50% chance of being added (or perhaps, if you want to get fancy, a scaling reduction based on how many were forced in by metabolic threshold). Net is that the average metabolic complexity would tend towards the average of all ancestors.
μuKnew Jun 29 @ 8:11am 
That's kind of true. Technically, as long as you got roughly 50% of the genes from each parent, you wouldn't drift back to baseline, just like in real life (aside from if one parent is a baseliner, but that makes sense). There's no "baseline" human irl because genes don't disappear because we get 50% from each parent. But like I posted a couple weeks ago, 65% makes more sense since then you wouldn't end up with rare genes disappearing as often (for example, because of a xenotype that is rare in your colony not having as many "opportunities" to proliferate).

100% isn't always optimal, though I see your reasoning, because that means that you end up with "yattakin plus" kinds of hybrids instead of "yattakin+impid hybrid" kinds of hybrids.
μuKnew Jun 29 @ 8:11am 
Were you to breed orcs, goblins, and hobgoblins together over several generations, you'd expect a homogenized set of genetics, relatively similar between colonists. What would be produced with the current system would be homogenized, but still broadly representative of each starting xenotype. Effectively, each generation would gain more of the other xenotype's genes instead of "mixing".

100% orc +15% goblin + 15% hobgoblin + 15% goblin... etc, as opposed to ~33% orc ~33% goblin ~33% hobgoblin. While it's possible that some traits may be lost due to the low population size, that can happen in nature as well due to random chance (again, in small populations). The saving grace against that possiblity is that siblings could carry that gene instead.

But anyways, that's just one way of looking at it, and my personal reasoning as to why a primary parent inheritance slider makes sense as a config option.