RimWorld

RimWorld

49 ratings
Random Spawning Genes
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5, 1.6
File Size
Posted
Updated
275.285 KB
2 Mar @ 12:32pm
19 Aug @ 12:49pm
16 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
Random Spawning Genes

Description
Random spawning genes!

So many mods add genes and only so many are on pawns. I wanted more variety on them and didn't like the current options available.

This mod will make all pawns spawn with an additional random assortment of genes.
In order to prevent a bunch of pawns spawning with extremely high or low metabolism, this uses a "super advanced AI logic" to try and get to the metabolism requested by the player.

Genes added can be a consistent amount (for example 4) or a random range between two numbers (from 0~64). There are options for where genes are placed, and what to do with genes that have prerequisites. The first gene given will be entirely random to throw some variation into the mix. Subsequent genes added will try to reach the ideal metabolism provided. When at or near this metabolism (±1), random single metabolism or zero metabolism (as set in the options) genes will be added.

You can provide a filter that will exclude any genes that contain the same defname as provided in the text box. There is an option to add in recomended exclusions. These are genes that would automatically down or otherwise incapacitate a pawn on spawn. A longer, more in-depth list is also provided in the about folder "PossibleExclusions.xml", containing the reason these genes are on this list.
Note these filters are case sensitive.
Babies - Babies can be given genes as well. However there is an option to turn this setting off.

Compatibility
For modders: There is a def included in this mod that you can patch to exclude your genes from appearing. This can be done through single genes, exclusionTags, or the intire mod itself. There are example patches included in the About folder.
Big and small framework: If a gene has prerequisites from using this framework, they will be taken into account with adding genes.
HAR: Genes should only be added if the race allows it. This works in both directions
VRE Insectors & VRE Androids: This will not use custom "genes" from these mods or any other mods that subclass Genedefs.
Androids will not be given genes.
Insectors can still receive genes.

Errors
I've tried testing this with a couple hundred gene mods. Sent some errors in compatibility of certain genes to their respective authors in the process as well. However I obviously can't guarantee every gene mod works with every other gene. There are options in the mod to turn on logging so you can determine what combination of genes are causing errors and report it to their mod authors. Additionally, be sure to check "PossibleExclusions.xml" located in the about folder for genes that may cause issue.
If there is an error with my mod specifically, please provide me a Hugs Log so I can fix the issue.

Credits
RimWorld discord for helping me learn how to make a UI and not just cry in a corner (thanks Telardo and Arquebus!).
Steve who made my code look less ugly.
Redmattis who let me steal the code he uses for big and small better prerequisites so I could write my compatibility with it.
66 Comments
Halicade  [author] 30 Sep @ 11:17am 
@oldmanwhistler Nuclear death blast? That's a new one. I gotta check it out lol.

Yeah, at world gen the game creates faction leaders and other various pawns that can cause other errors at startup with certain mods.

I do plan to maybe make another version of this where it works the opposite. You choose what genes/xenotype are chosen. But that's far off in the future. Working on other ideas I have.
oldmanwhistler 30 Sep @ 8:31am 
I was trying this with the Dev Quicktest with logging turned on an I found the game was spawning a lot more pawns than I expected for a crashlanding of 3. This made sense why I was having crashes on worldgen with a lot of factions.

I'm going to have to play with it more to get my settings correct but do I ever LOVE this idea, although I think the easiest thing would be to make it affect baseliners only because as you said there are a lot of weird gene compatibility issues in other mods when you have a lot of mods.

I want to try a gene thief run with this either using gene ripper or that gene that lets you steal genes.

For your recommended exclusions, you might want to add the Alpha Genes nuclear death blast and maybe some of the anomaly defaults?
Halicade  [author] 29 Aug @ 7:42am 
If a xenotype genes are germline genes (Like an impid, they get inherited) then the genes from this mod will go in the same place.
If they are xenogenes (like a sanguophage) then the genes from this mod will get generated as xenogenes
Futstub 29 Aug @ 6:52am 
Could you explain the mod option "Follow Xenotype Inheritance" for me, please? :)

This is an absolute amazing mod btw, and I seriously don't understand how it doesn't have dozens of thousands of downloads...
Futstub 27 Aug @ 6:58am 
Mind blown. :D
Halicade  [author] 27 Aug @ 6:32am 
All the options in the preview images are all the options. Only way to restrict to a specific xenotype is to exclude all other xenotypes.
Futstub 27 Aug @ 4:01am 
Any chance there is a mod option that makes this only trigger on baseliners?
Halicade  [author] 19 Aug @ 4:06am 
@Geojak maybe in another mod at some point. I really don't want to add more features to this one
Geojak 19 Aug @ 1:51am 
could their be an option for randomly disapearing genes, for exaple a pigkin randomly not having trotter hand
Halicade  [author] 21 Jul @ 1:30pm 
@numa.ec If the mod was active while they were spawned, yes