Jump to content

[mod] [Rimworld] Gender balancer


Recommended Posts

I can't figure out how to get this to work with the base game's Humans in version 1.1. Following the patch instructions worked just fine when it was 1.0.
It may have something to do with the Core game folder not being under the Mods folder anymore, so maybe something with the xpath needs to be changed to target the core game data outside the mods folder now? But I can't find anything online that says how to do this.

Any ideas on how to fix this?

Link to comment
22 minutes ago, Fenguard said:

I can't figure out how to get this to work with the base game's Humans in version 1.1. Following the patch instructions worked just fine when it was 1.0.
It may have something to do with the Core game folder not being under the Mods folder anymore, so maybe something with the xpath needs to be changed to target the core game data outside the mods folder now? But I can't find anything online that says how to do this.

Any ideas on how to fix this?

Nevermind it looks to be working just fine when I put it at the bottom of the load order where nothing can overwrite it, like a smart person would. :P Unless I'm getting really lucky right now and it's just not randomizing any men into the pool after 20ish pawns. All is well! Carry on, great mod! ❤️

Link to comment
4 hours ago, Fenguard said:

Nevermind it looks to be working just fine when I put it at the bottom of the load order where nothing can overwrite it, like a smart person would. :P Unless I'm getting really lucky right now and it's just not randomizing any men into the pool after 20ish pawns. All is well! Carry on, great mod! ❤️

Just to make sure, you could turn debug mode on and spawn a load of pawns to make sure none are male.

I did this with vanilla chickens to test.

Link to comment
11 hours ago, bearlyAlive said:

Just to make sure, you could turn debug mode on and spawn a load of pawns to make sure none are male.

I did this with vanilla chickens to test.

It's all working just fine now, spawned like 150 pawns and they're all the gender I wanted once the load order was right!

Link to comment
  • 4 months later...
  • 3 weeks later...

Great mod. I looked through the game files and didn't see anything in my quick perusal for changing the birthrate ratio. Thanks to your mod I can do it now.

I haven't tried it yet but I don't think I'll run into issues.

 

 

Edit: I have finally gotten it to work. Here are the instructions. They're the same as the instructions in the opening post, only a bit more clearly-worded and presented. Obtuse people like myself will be less frustrated with these instructions, hopefully.

 

 

1) The first thing you need to know is that you will need to duplicate this mod. The duplicate, which you will edit, will be running at the same time as the original untouched version of this mod. So, you'll need to have both the original mod and the duplicate in your mods folder and turned on in the game.

 

The duplicate is nothing more than an identical copy of the original folder (including its contents), initially. Rename the folder of this new duplicate, of course, since your operating system won't tolerate two with the same name in the same location. Remember, both the original mod folder and the duplicated mod folder will need to be put into your game's Mods folder for them to work, so they will need to have different folder names. (I called my duplicate folder SexBirthrate, since that's what this is really about. It's about the birthrate of the two sexes.)

 

 

2) Open the About.xml file in the duplicate mod folder's "About" folder and change the details so the game will recognize it as a different mod. Leave the original mod folder's About.xml file alone. Here is what my duplicate mod's About.xml file's contents are:

 

<?xml version="1.0" encoding="utf-8"?>

<ModMetaData>
    <name>SexBirthrate</name>
    <author>Yeah</author>
    <supportedVersions>
        <li>1.0</li>
        <li>1.1</li>
    </supportedVersions>
       <packageId>Yeah.GenderBalancer</packageId>
    <description>Causes only male humans to be born.
    </description>
</ModMetaData>

 

 

3) Delete the "Assemblies" folder in the duplicate mod folder only. Leave everything in the original mod folder untouched.

 

 

4) Create a folder inside the duplicate mod folder. Give that new folder the name Patches. You do not need to create anything in the original mod folder.

 

 

5) Create a plaintext file or make a duplicate of an existing xml file. Give it the name Races_Humanlike.xml. If you make a duplicate xml file you will need to delete all of the text inside of it.

 

 

6) Add the following text to your new plaintext or xml file:

 

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
    <Operation Class="PatchOperationConditional">
        <xpath>/Defs/ThingDef[defName="Human"]/comps</xpath>
        <nomatch Class="PatchOperationAdd">
            <xpath>/Defs/ThingDef[defName="Human"]</xpath>
            <value>
                <comps>
                    <li Class="GenderBalancer.GenderBalanceSettings">
                        <maleGenderWeight>1</maleGenderWeight>
                        <femaleGenderWeight>0</femaleGenderWeight>
                        <noGenderWeight>0</noGenderWeight>
                    </li>
                </comps>
            </value>
        </nomatch>
        <match Class="PatchOperationAdd">
            <xpath>/Defs/ThingDef[defName="Human"]/comps</xpath>
            <value>
                <li Class="GenderBalancer.GenderBalanceSettings">
                    <maleGenderWeight>1</maleGenderWeight>
                    <femaleGenderWeight>0</femaleGenderWeight>
                    <noGenderWeight>0</noGenderWeight>
                </li>
            </value>
        </match>
    </Operation>
</Patch>

 

 

7) If you want to have only female humans, change the 1 for both maleGenderWeight to 0, in that xml code above. After you have done that you will then need to change the 0 for femaleGenderWeight to 1 in both places.

 

If you only want male humans then you can use the code above without needing to make any changes. It is already set to only allow humans to be born male.

 

 

8.) For gameplay quality, each character must be bisexual or gay or they will never have the opportunity for romance — unless you are using other races that humans can romance. The chance for bisexual and gay characters is incredibly low in the base game so you will want to edit those chances in the base game's core or use a mod like Character Editor to give them the bisexual trait or gay trait.

 

To change the core birthrate for non-hetero orientations (recommended, since the chance of bi and gay characters is extremely low), edit the following file in the following location:

 

Core >> Defs >> TraitDefs >> Traits_Singular.xml

 

It is not difficult to edit the values. I suggest changing Bisexual to 40% and Gay to 8% for games not using GenderBalancer. You will want to have enough bisexuals to satisfy the gay characters' need for romance in particular, but also the hetero characters'. If you have too many hetero characters and very few bi and gay characters (the way the base game is, by the way) then your gay characters are likely to be unable to find love. If you change the number of gay characters to be like what the base game has for hetero birthrate (99.5%) then your hetero characters will have the same problem. The solution is to have enough bisexuals, who can satisfy both hetero and gay characters.

 

(Note, don't put percentage symbols into the xml file, just plain numbers. If you look through the traits you'll see that there are no percentage symbols.)

 

For games using this mod and only humans, you will want bisexual and gay to be 100% when added together. So, you could do 90 for bi and 10 for gay. Or 50 and 50. Or 20 and 80.

 

I also suggest using the mod that gives more trait slots because gay and bisexual take up valuable trait slots when so few traits are available per character, although they're better than getting negative traits.

 

 

(I'm not sure why this mod is called "Balancer" when it doesn't seem to be balancing anything. Instead, it seems to be regularizing/homogenizing around a specific biological sex. Biological sex balance would be to have a 50% male and 50% female birthrate. Maybe the base game doesn't create 50% females and 50% males without this mod enabled and set so that both the male and female GenderWeight options are 1? Maybe it gives you more males by default, while still having females? In that case, if you want to have a 50/50 birthrate, you would have the value 1 for both maleGenderWeight and femaleGenderWeight. I don't know if this works. You'll have to ask the author or see if it's mentioned somewhere.)

 

 

9) If you created a plaintext file you will need to rename the file extension to .xml. You may want to check to be certain you didn't end up with anything like ".xml.txt" as a file extension. The file should be only .xml at the end. There should not be any .txt anywhere in the filename and its extension when you are done making it.

 

 

10) Move your new Races_Humanlike.xml file into your new Patches folder. That is where the file needs to be for the mod to work correctly. You will not need to do anything with the Race_Humanlike.xml file that's in the game's core Defs folder.

 

(You might think that xml and txt files are different so you wouldn't want to try to create a plaintext file and rename it to .xml. You can. though. Or, as I said, you can duplicate an existing xml file and delete its contents. Or, you could create a new xml file if your software does that. Personally, I think the quickest thing to do is probably to create a new text file or to duplicate an xml file. Creating a new xml file from scratch might be a tiny bit more complicated.)

 

 

11) Place the original untouched GenderBalancer mod at the end of your Mod loading list (so that it loads last during the game's loading of mods). Put the duplicate right above it, so that it loads right before the GenderBalancer mod (the penultimate spot, for those who like a fancy lexicon).

 

 

12) Create a new colony and see if your colonists to choose from are all the same sex. If they are then your duplicate mod is working. If you get red lines of text about these mods when you boot with the two mods enabled then something went wrong.

Link to comment
  • 1 month later...
  • 2 months later...
  • 4 months later...
  • 2 months later...
  • 6 months later...

Not an update to the mod itself, but i found a mod that can do the same effect as this one

 

it's called the Custom Pawn Generation mod on steam. go check it out if anyone still needs a mod for gender balance. works really well and has some other cool features, too

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use