RimWorld

RimWorld

Xenotype Spawn Control
599 Comments
belirahc Sep 10 @ 5:42pm 
i think i may have found a issue with gender genes 2 and this mod were if you have genes that are set to be male or female, and you use this mod to spawn that xenotype in the male / female specific genes get removed on game load up.
bradson  [author] Sep 10 @ 3:45pm 
Well, no game files. The config does of course get saved in the usual config folder
bradson  [author] Sep 10 @ 3:44pm 
@Greasy Yes, changes are only done in memory, as is common among mods that don't directly add saved content. No files are modified
Greasy Sep 10 @ 3:31pm 
@bradson I would like to know, if I remove this mod, will all the spawn settings go back to what they were normally?
The Bard of Hearts Sep 10 @ 3:26pm 
+1 on the "This is an essential mod" feeling. Being able to create and apply our own species to the game and have them show up appropriately is awesome and gives the game at least a x3 multiplier in value.
Greasy Sep 10 @ 3:03pm 
@bradson I just wish I could figure out what changed. Everything was the same since 1.5, except where I removed all the base xenotypes to try and avoid that glitch I was seeing where baseliners would spawn when they shouldn't. I've gone through all the pawnkinds and changed a few things around that might have been borked.

I love this mod, btw. It's so essential to me, that I feel like it should just be in the base game more than any other mod I've used.
bradson  [author] Sep 6 @ 9:28pm 
@Greasy Keep in mind pawnkinds and memes are considered when deciding what to generate too. Several factions, including the vanilla empire, having values set there by default. This is not something new for 1.6.
Greasy Sep 6 @ 8:58pm 
This mod seems to have gone quite haywire after the 1.6 update. Even after removing all the base xenotypes, it's still spawning the wrong custom xenotypes occasionally... Bummer.
Vlad Draculea Aug 30 @ 8:21pm 
will it be*
Vlad Draculea Aug 30 @ 8:21pm 
does this game allow you to modify the genes of already existing xenotypes (vanilla/modded)? like say I want to give sanguophage xenotype a gene from a mod, will it possible?
Luxordz Aug 30 @ 10:00am 
eyy cool to know thanks.
Ayomi Aug 30 @ 9:28am 
@Luxordz Just a visual thing. In practice the custom xenotypes do show up in game, but will always show as baseliner when you hover over the faction.
Luxordz Aug 30 @ 6:22am 
Trying to slim down my xenotype mod list and decided to just custom remake via a cosmetic mod. Issue is setting these to factions doesn't seem to be setting them in the faction, any custom ones simply get re-added to baseliner % on faction display during colony start, is this just a visual bug or is there something I'm missing? The mod works great with official and mod implemented xenotypes though.
bradson  [author] Aug 28 @ 12:18pm 
@WockaWocka The game does try rolling up to 120 times before throwing an error for an invalid pawn. Random alone shouldn't have much of a chance of getting there. Hybrid might if the only xenotypes it's making a hybrid from don't allow violence
WockaWocka Aug 28 @ 11:19am 
Hi, first off - love the mod, thank you for creating this! Adds a lot of variety to raids, wanderers, etc.

I was wondering - I get a lot of pawn spawn issues with the game trying to spawn pawns incapable of violence. It doesn't have much of an effect outside of throwing the error, but just curious if having a higher chance of random mutations and hybrids could be causing this by selecting the violence disabled gene?

Thanks for any insight!
bradson  [author] Aug 27 @ 8:25am 
Mod configs are stored in Config at "%appdata%\..\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios",
Custom xenotypes are stored in the Xenotypes folder in the same place. The files can be passed around and don't contain anything hardware specific
Anndra Aug 27 @ 6:55am 
Hi, love this mod. Wondered if there was a way to export the settings to be sent to someone else, if they were kept in a file locally. Is that possible?
bradson  [author] Aug 24 @ 5:02am 
You keep its spawn rate at 0% for that, yea. That's the default for new custom xenotypes too. Nothing is just automatically inserted. If it's spawning with its chance set to 0 it's gotta be some other mod doing that, like alpha genes through its random custom
Rep Aug 24 @ 4:36am 
I'm running into an issue of making a custom xenotype for my pawns on chargen and then having those same xenotypes show up in raids, which I don't want. Is there some way to stop that from happening?
The Bard of Hearts Aug 23 @ 9:05pm 
@bradson. Hello. Love the mod. Been using it for a while now. Unfortunately, there is one small thing I can't do with this that seems like would be part of this mod. I can't actually forcibly apply a saved xenotype to a pawn. I can apply any of the vanilla xenotypes and any "modded" xenotypes. But not any of the ones made using this mod's mod options. Is there just something I'm missing or can this be added? Thanks for the mod work.
bradson  [author] Aug 23 @ 12:17am 
This mod only ever makes changes to pawn generation when having it set up to do so through its settings. If chanter raids broke for you there must've also been something you configured to get them into that state
鲁迪乌斯·格雷拉特 Aug 22 @ 6:55pm 
This mod caused my game to be unable to correctly generate enemies when generating the "Hate Chanters" event. After disabling the mod, it returned to normal
Geojak Aug 22 @ 10:39am 
#greasy I eventually managed to fix the bug for myself. Add me on discord and I sent you the assembly until bradson gets around doing his magic
Greasy Aug 21 @ 2:37pm 
Yeah, I'm having that baseliner spawn glitch. Groups that are supposed to be 0% baseliner are raiding me with a handful of normal dudes among them. LOL. But, seeing as how this is my favorite mod, for the exact reason that I love making my own xenotypes, I'll try the workaround and just make my own versions of all the base xenotypes.
Geojak Aug 20 @ 3:41pm 
I think we need to just add a check if baseline% is 0 to prevent spanning those instead of custom xenos

if (Rand.Range(0f, 1f) <= xenotypeChances.GetCustomXenotypeChanceValueSum()

|| baseliner% == 0

I'll try code it myself tommorow.
bradson  [author] Aug 20 @ 3:13pm 
Seemingly working or not, I prefer having no AI code in my mods, at least at this day. It's a fairly minor issue that doesn't prevent any part of the mod from working, and it's not at all worth opening that can of worms for. Any genuinely researched contribution is more welcome.
Geojak Aug 20 @ 2:59pm 
causes a new bug, no more baseliners spawn, would have been too nice, so we swap one bug for another
bradson  [author] Aug 20 @ 2:57pm 
I'll see what I can do, but chat gpt is not the way to go about bugs. Seems to be some oversight with the refactor that was done for 1.5 and 1.6
Geojak Aug 20 @ 2:39pm 
ok i managed to compile it, now to see it if actually works
Geojak Aug 20 @ 2:07pm 
this could be the fix (coded by chatgpt5), downloading visual studio now, but i havent compiled any rimworld mod in years, need to get it setup

private static bool TryGetCustomXenotypeByWeight<T>(string defName, out CustomXenotype? result)
where T : Def
{
var xenotypeChances = XenotypeChanceDatabase<T>.For(defName);
- if (Rand.Range(0f, 1f) <= xenotypeChances.GetCustomXenotypeChanceValueSum()
- && xenotypeChances.CustomXenotypeChances.TryRandomElementByWeight(chance => chance.RawValue, out var randomResult))
+ // If there are any positive weights, draw directly by weight (no extra gate).
+ // TryRandomElementByWeight handles normalization internally.
+ if (xenotypeChances.CustomXenotypeChances != null
+ && xenotypeChances.CustomXenotypeChances.Any(c => c.RawValue > 0f)
+ && xenotypeChances.CustomXenotypeChances.TryRandomElementByWeight(c => c.RawValue, out var randomResult))
{
Geojak Aug 20 @ 1:33pm 
with the source code from gtihub, i found the cause.
1. the mod rolls vanilla xentoypes, no custom xenotypes, those are pseudo baseliners on this step
2. then it runs a second roll in TryGetCustomXenotypeByWeight, here it gets the chances for the custom xentypes and trys to reroll the baseliners.
3. if in both step 1 and step 2 we rolled into baseliner, then it stays like that and the bug appears.

with pseudo numbers, impid 50%, custom race 50%.
1. we roll 50% impid, 50% custom kept as psuedo baseliner - lets assume we rolled baseliner here
2. we roll 50% custom race: 50% not custom race - lets assume we rolled not custom race here
3. the pawn turns out with a 50% x 50% = 25% chance as baseliner

i dont know how to fix it yet, but i understand the issue a bit now
Geojak Aug 20 @ 1:00pm 
Thank you for the workaround, I'll give it a try.
Ayomi Aug 20 @ 12:29pm 
@Geojak This is an issue that I've had for awhile as well. It occurs whenever you use a custom xenotype and a premade xenotype, such as in your example. There's currently no fix for it, but you can kind of work around it. If you create a copy of the impids, name them something like "Faux Impids", then set the xenotype spawn control to 50 percent your custom race and 50 percent Faux Impids then it will work.

In summary, if you don't want to see baseliners either use all premade xenotypes or use all custom xenotypes. Mixing and matching causes baseliners to spawn when they shouldn't.
Geojak Aug 20 @ 12:18pm 
i have a bug issue with this mod. i sent the impids faction to have 50 my custom race and 50 the impid xenotype. still i see baseliners show up in their raid. this doesnt seem right
Knotingham Aug 17 @ 8:14am 
Love this mod! I have a question though. I started a colony with a xenotype from another mod and after starting a wanted to change some genes and so I did that with this mod, however the new xenotypen doesn’t appear in dev tools to alter my current colonists? Is that a thing I can do that I’m missing or will I just need to alter them in dev, one pawn and one gene at a time? I assume after I’ve added the new genes to the existing factions they’ll occasionally show up but it’d be nice if the new xenotyoes showed up in devmode. Thanks so much for your work!
Hatoful Pengu Aug 14 @ 12:06am 
@Bigrat if all you want from this mod is restricting joiners to xenotypes that already exist in your colony, you might wanna check out No Foreign Xenotype Join Events
Xaelyn Aug 12 @ 11:56pm 
A suggestion; a fourth category that lets you override by xenotype to make it easier to mass replace xenotypes with customised variants or just remove certain ones without having to manually go through every category.
Bigrat Aug 12 @ 2:38pm 
Thank you for creating this mod, I just installed it as I am running an Insector (from vanilla expanded) only crew and found that other than childbirth, I never will get to increase the amount of insectors I can recruit. With that said, looking, which feature would be best to tweak to make so that 100% of the time that new recruits randomly crash in drop pods or kinda just wander in my map, they are insectors?

For now, I have made it so that 100% of the faction No Faction are insectors, but not sure if that is the right approach!
bradson  [author] Aug 10 @ 11:02pm 
Click and find out
IdleKnife Aug 10 @ 8:37pm 
what is the difference between weighted and absolute chances
Oneoneone Aug 8 @ 3:19am 
Would love a randomize button to randomize the non-xenotype specific factions to get variety up without them being completely random by setting everything to equal chances. Like giving 1-3 a high % and a bunch other low %
Sithgrim Aug 7 @ 2:28am 
Is there a way to just blanket remove a xenotype from spawning with this without going into each faction? I have a lot of different mods that add factions and 1 or 2 genes I like for custom xenotype ideas. Some add xenotypes that have cosmetic parts that do not work well with my face mod and I just want to turn them off so I can keep the beneficial genes without having deformed looking pawns spawning in.
Ayomi Aug 5 @ 6:00pm 
@Catbot1310 it's just a visual issue. Custom xenotypes show up as baseliner when you hover, but the spawns will be the xenotypes you chose when raids etc happen.
Catbot1310 Aug 5 @ 12:59pm 
are custom xenotypes currently broken? after setting a faction to be 40% custom xenotypes and yet it displays as being 80% baseliner, is this just visual or something in my mod list?
DrOak2 Aug 5 @ 10:26am 
Not sure if this known, but just a FYI observation: when I made changes to a xenotype during the colony creation and overwrote it, the changes weren't reflected in the mod (at least when loading the xenotype through the mod options, or when the xenotype was applied to the generated colonists during setup).

After restarting the game, they were correct in the mod

(not sure if this only applies during setup)
NORend Aug 5 @ 6:23am 
Ok I'm not sure it was something I did. I thought I did reset settings to default. But now reseting does not change it to what it was before. where sangophages was not assigned to be sangophages. Could be my goof sorry
NORend Aug 5 @ 6:20am 
Issue by default sangophage non player is not set to be sangophages. Causes related vanilla event to give you baseline xenogerm instead of sangophage.
bradson  [author] Aug 4 @ 4:57pm 
And dragging the baseliner slider to the left already raises chances for all other xenotypes
bradson  [author] Aug 4 @ 4:55pm 
What advantages would that have over the existing checkboxes and weighted option?
hurRdurR Aug 4 @ 3:33pm 
I think instead of "remove baseliners" just have checkboxes for all genotypes. Unchecked: always 0. Everything is checked per default. Minimum 1 must/will always be checked.
Could add option for 'default genotype' that's the fallback if failure happens and have an internal fallback for that to baseliner?

Because setting exact ratios for specific genos is incredibly hard otherwise.