How RimWorld's Code Defines Strict Gender Roles
"Code is never neutral"
Reed’s having a bad day: her spaceship crashed, she’s one of three survivors, and the other two won’t stop hitting on her. Unfortunately for her, she’s beautiful, which means that they’re immediately enamoured with her; unfortunately for them, she’s gay, which means the feeling is definitely not mutual. Her life is a constant hellish stream of corny pick-up lines and work for the colony.
RimWorld is a scifi colony management sim that seems to effortlessly weave dynamic stories around the player's attempts to survive on an often harsh alien world, but when it comes to sexuality, romance and gender, it tells variations on this one story far too often. We dug into the code to find out why that is.
Returning to Reed, we can see that the pick-up lines don't get her down. She receives no penalty to her mood for being barraged by come-ons. But the two men, Rob and Boots, feel differently. They have a near-permanent mood and relationship penalty for Reed, because they keep asking her out, and keep getting rebuffed. But it’s not really their fault - Rob and Boots can’t stop hitting on her because they’re men, and because she’s just so gosh-darned pretty. More precisely, that’s how they’ve been programmed.
The eerie thing is, remove the bit about the crashed spaceship and this scenario mirrors a common narrative about romance, sexuality, and relationships between men and women. It is not at all uncommon to hear stories, in media and in real life, of how men ‘just can’t help themselves’ around beautiful women, and to hear how devastating it is for men to be rejected by the women to whom they are attracted. Setting aside the truth of those stories, and how demeaning they are to men and women both, why is this the story that RimWorld tells about relationships? In order to get to the heart of the situation, I unpacked the latest publicly-available build of RimWorld to see how romantic interactions are determined. For the sake of non-coders among us, longer sections are presented in pseudocode that tells you what it does, without requiring you to be fluent in C#.
To be clear, the anecdote I've described above is not a unique scenario in RimWorld. The current top-rated post of all time on the RimWorld subreddit is a user asking for "strategies to deal with attractive lesbians". Additionally, an earlier decompilation of the game, summarizing how RimWorld models romantic behaviour, was a pretty good indicator that the answer to Reed’s dilemma lay somewhere in the game’s source code.
So why were Reed’s fellow survivors constantly hitting on her? The answer lies, partially, in how romance attempts are calculated differently for male and female “pawns”, the game’s term for all the colonists you control. All pawns start out with a base chance of turning any social interaction into a romance attempt, and a minimum threshold of attractiveness and positive opinion for this to happen. In other words, you have to actually like someone and find them attractive in order to try to start a romantic relationship with them. Things become interesting when the random chance of initiation comes in.
// Change chance of initiation based on gender of initiator if(me.gender == male) { // no change initiation-chance = initiation-chance * 100%; } if(me.gender == female) { // initiation chance is 12.5% of what it would be Initiation-chance = initiation-chance * 12.5% }
In other words, female pawns are about eight times less likely to try and start a romantic relationship. Granted, this is not the only factor - other elements include presence or absence of an existing romantic partner, and how they feel about said partner. However, this single check on gender has such a profound effect that it makes female-initiated romance attempts incredibly rare. Notice that neither a history of rebuffals nor the presence of the “gay” trait in the recipient are factored in, which would explain why they won’t stop. This behaviour is one-way, though. Reed doesn’t hit on them, not because she’s female, but because she finds them unattractive.
So how is attractiveness actually calculated? For both male and female pawns, attractiveness rests on a few variables: the genders of the initiator and the recipient, the sexual orientation of the initiator, the beauty of the recipient, age, and physical ability.
Before going into gender-specific differences, let’s first look at some universal variables..
// In the rest of the function, multiply attractiveness with the factors for:
// Talking, moving, and manipulation efficiency (penalty for pawns with disabilities)
// Bonus or penalty for attractiveness traits (ugly = 30% as likely, beautiful = 230% as likely)
// Additional age factor for people between 15 and 18
else if(me.gender == female) {
// Enforce sexual orientation for gay women
if(me.orientation == gay and them.gender == male) { // zero attractiveness, no matter what return 0.0; } // And for non-gay women if(me.orientation == straight and them.gender == female) { // Only 15% as strong as it would otherwise be attractiveness = attractiveness * 15%; }
There are no straight women in RimWorld, as in, there are no women only attracted to men. Instead, every single non-gay woman in the game has some chance of being attracted to another woman. As for the men, it works a little differently.
// Calculate the perceived attractiveness (between 0.0 and 1.0) of them, to me
float calculate_attractiveness(Pawn me, Pawn them) { float attractiveness = 0.0; if(me.gender == male) { // Enforce sexual orientation for male pawns if(me.orientation == gay and them.gender == female) { // zero attractiveness, no matter what return 0.0; } if(me.orientation == straight and them.gender == male) { // zero attractiveness, no matter what return 0.0; }
Notice that there’s only two possible orientations for men, gay or straight. In RimWorld, there are no bisexual men, only gay or straight men; there are no straight women, only gay or bisexual women.
Lastly, we move on to the most complicated part of this, age-based attraction. These are hard to visualize just by reading the code, so here they are in diagram form.
In RimWorld, male pawns will always find pawns between 20 and their own age attractive. If the male pawn in question is under 20, that doesn’t make a difference - because it’ll check the “lower” bound first, they’re guaranteed to find a 20-year-old attractive. This explains why Rob (age 32) and Boots (age 17) keep trying to ask out Reed (age 23). But, since the same code doesn’t check for relative age, 17-year-old Boots wouldn’t actually find a fellow 17-year-old teenager all that attractive. There’s also a minimum age for attraction, 16 years old, and a maximum age, any pawn 15 years older than themselves. So in this case, Boots wouldn’t find any woman over the age of 32, or any woman under age 16, attractive.
On the other hand, women overwhelmingly prefer partners older than them. And, unlike for men, there’s no firm cutoff for pawns that are “too old”: even pawns 40 years older than the woman in question have a chance of being perceived as attractive. Contrast this to the calculation for men, where pawns 15 years older than them have absolutely no chance.
In summary:
- Men are about eight times as likely as women to try and start a romance.
- Pawns with disabilities will always be found less attractive.
- Beautiful pawns are always considered vastly more attractive; ugly pawns, vastly less. Physical beauty is the only trait that governs attractiveness, aside from sexual orientation.
- Straight men always find men unattractive. Gay men always find women unattractive. There are no bisexual men.
- Women may find women attractive. Gay women always find men unattractive. There are only bisexual or gay women.
- All men consider partners aged 20 to their own age most attractive. If they’re under 20, they’ll find pawns 20 or over most attractive, with no regard for pawns that are a similar age to them.
- All women consider partners the same age and older most attractive. Partners slightly younger than themselves are very unattractive, and partners that are 10 years younger than them are always considered unattractive.
- All men consider any pawn 15 years older than themselves to be unattractive.
- There is no “old age” cutoff for women. No matter how much older a partner is, women have some chance of finding them attractive.
Now, RimWorld is not finished. It’s a game that’s still under constant development, and so this relationship system might well continue to develop and change. On top of that, the various numbers thrown into these governing formulae might well be there because of a late night, or as placeholders, or just to try and make the systems work. In other words, there might not be any specific commentary on or interpretation of gender roles behind this, malicious or otherwise. Any game system that tries to represent or model complicated real-world scenarios necessarily has to make abstractions and sacrifices, and human relationships might be one of the most complicated things you could possibly portray.
But we are not analyzing RimWorld on the basis of what it might be in the future. The question we’re asking is, “what are the stories that RimWorld is already telling?” Yes, making a game is a lot of work, and maybe these numbers were just thrown in without too much thought as to how they’d influence the game. But what kind of system is being designed, that in order to ‘just make it work’, you wind up with a system where there will never be bisexual men? Or where all women, across the board, are eight times less likely to initiate romance?
On top of that, what RimWorld doesn’t model is as important as what it does. Remember how constantly being hit on and rebuffing people doesn’t lead to a mood penalty, only a reduced opinion of the person pursuing? In daily life, the feeling of having to constantly turn people down is not a nice feeling. But these negative feelings are only reflected mechanically for those being rejected, and because of the way romance initiation is handled, you end up having to cater for the sad rejected men, rather than the women who are always having to turn away these unwanted encounters.
We could label that behaviour a bug, perhaps. But those are just the surface symptoms. Those are the easily-noticed, in-game consequences of a system whose base structure has literally encoded assumptions about how men and women operate. Now, representation is a tricky subject, and we will probably never create a perfect model of romantic behaviour.
But the problem with this model isn’t that it’s flawed. It’s that it’s flawed in a way that perfectly mirrors existing sexist expectations of romance, with such specificity that it is hard to view it as unintentional . And if it is unintentional it is on us to ask what this system is trying to show. What are the possibilities that it allows? What is RimWorld setting as the boundaries of possibility?
Decompiling the source code provides a very clear look at how these gender differences were written into the game. However, it’s not something that’s intuitive to grasp just by playing the game. At the same time, this is a system that has an enormous impact on how you play, because one of the key challenges in RimWorld is keeping your colonists happy. Code is never neutral. All of these coded structures push a particular scenario over others, and most of the time this is fairly benign. However, this does not mean that it should escape scrutiny, because we can end up uncritically coding in harmful assumptions, which ultimately means we are constraining what our games could be while also alienating other players.
As for Reed, things have gotten a little better. Other women have joined the colony, and one of them, nineteen-year-old Roughchild, has gotten engaged to Rob. Reed’s on better terms with Rob, now that he’s spending time with his fiancee instead of constantly trying to get with her. Everyone still adores her, of course, because she’s beautiful; everyone still talks to her, and Boots is still making passes at her. But the feeling is never mutual.
Editor's note: The developer was contacted for interview as part of this article, but declined to take part unless we ceded editorial control over the publishing of that interview. We do not cede editorial control to developers or interview subjects and so no interview took place. The developer has left a response below in the comments and here on Reddit. We stand by the accuracy of the article entirely.