How RimWorld Generates Great Stories

This is the final conflict that ended my colony, Henry's Indolence. Read on for the story of how it fell to ruin. (Spoilers: it was kind of Henry's fault.)

This is The Mechanic, where Alex Wiltshire invites developers to discuss the inner workings of their games. This time, RimWorld [official site].

Every player will have stories of their RimWorld colonists. Dramas set amid cabin fever, raider attacks, depressing decor, infected limbs, cannibalism and bloodthirsty local fauna. Personal dramas, tales of threat and victory, of small things and large things, tragedy and comedy. This colony-building game is designed very specifically to generate such stories. But while it feels as if they arise from deep simulation, all watched over by an AI, they’re actually the result of something both more powerful and simple. RimWorld tells great stories because it uses:

THE MECHANIC: Apophenia

Apophenia is a term that refers to the human tendency to detect patterns in randomness. It was first coined by Klaus Conrad in the late ‘50s, and has come to explain many psychological effects, such as how we see faces in things (pareidolia) and why we construct (hopeless) systems for gambling. And in RimWorld, as developer Tynan Sylvester tells me, “It’s essentially the notion that players extract more story meaning from a game event than is really represented in the mechanics.”

Many games do this, like Galactic Civilisations II, which inspired Friend of RPS Tom Francis’ classic diary, and The Sims. Sylvester first got interested in games’ ability to tell stories with little while reading StarCraft battle reports, in which (this was pre-YouTube, of course) matches would be recounted as stories alongside screenshots. “It elevated this mechanical interaction of a chessboard competition into this whole emotional story of marines desperately holding off a Protoss attack, like something from a Hollywood movie,” he says. Then came the classic, Dwarf Fortress, which generated hundreds of player stories, including Boatmurdered and Gemclod. Sylvester noted how the fantasy setting excused some mechanics that might not make sense if it had a more realistic setting.

Meet Henry. A total waste of space who refuses to do dumb labour. His inexplicable girlfriend, Nelly, has been attacked by a raider, but he's been literally just wandering around outside with his rifle instead of caring for her.

At the time, he was working as a designer at Irrational on BioShock Infinite, and began to see that many stories being generated by games were happening by accident rather than design. “It seemed nobody was pushing for it. Tonnes of people were talking about storytelling in games, but always from this ‘We want to do movies because we love Hollywood and want to do that with a videogame’. But there’s a whole other aspect of storytelling that’s unique to games, and it seemed no one was really pursuing it. So I was thinking it seemed a big design opportunity, a diamond sitting in the street that no one was picking up.” So, when Sylvester left Irrational in early 2012, he made several different story-generating game prototypes, settling on a 2D base-building game which steadily grew into RimWorld.

The game uses many simple techniques of getting the apophenia response. All its characters are named, and it restricts the numbers of colonists that you play with to around 12. RimWorld is similar to Dwarf Fortress in many ways, but because your band of dwarves is far larger, reaching about 200 members, this is a point where they significantly differ. “That’s by design, so the player knows each of these people and has a remembered history of each of them,” Sylvester says. It means that after you’ve been playing with a couple of colonists for 10 hours and seen them get married and how one saved the other in a firefight, their history together builds up in your mind, and induces meaning to their actions. “That’s where the story comes from. Instead of just one stranger insulting another, it becomes, ‘He was stressed out because he kicked his alcohol habit and he was bitter because his wife divorced him six months earlier, and he flew into a rage’. We repeat actions between people you know and sustain interactions, and sustain the states, remind people of what happened before through mechanisms like the characters having memories that affect their mood.”

Nelly has died of a serious infection in her torso as a result of her wounds. Henry, emotionally devastated, leaves it to the third member of the colony, Lord, to bury her body in a grave he dug to the north.

It’s not like apophenia lies everywhere, of course. For RimWorld it particularly lodges in a couple of fundamental human preoccupations: health and relationships. Sylvester has been careful to build on them, adding a detailed health system early after its initial alpha release which tracks, like Dwarf Fortress, individual body parts and malaises. “It’s tragic if they have cataracts and they can’t do what they used to. It’s painful if someone loses a toe, it’s ugly if they have a scar on their face. It’s primal, it’s so close to what you care about in your life,” he says.

And relationships – well, pretty much any book, film or other story-based medium is predicated on relationships. So RimWorld presents a few different types of relationship, such as spouses, siblings and so on, and have opinions of others, based on events and traits plus a smattering of randomness. “We supply these labels, like say this is a person’s sister, and suddenly everything has this new meaning,” Sylvester says. The game augments the labels a little, so if a character’s sister dies, they get sadder than if a random character died, or if someone they really dislike dies they get slightly happier. “It’s pretty darn simple, just a matrix of numbers and labels, but they’re so close to what we spend all our time thinking and telling stories about. A tonne of neuro-circuitry is just about finding connections in human relationships, and if you can spark that in the game, then people’s brains just take over. There’s this giant computer sitting there, trying to find connections and causal relationships and emotional inferences. You just have to get that motor running and all you need are a few simple labels, no more complicated than a children’s book.”

Two new colonists have joined our miserable pair. Feeb is a hunter, and Agerra T’rel, well, she's escaped from a band of raiders who've been raiding us, too. She's also Lord's long-lost wife. And a game developer. And she has Alzheimer's. Oh, and she's a nudist. Anyway, her arrival brought a raider to attack us. Feeb valiantly killed him but was injured in the melee. As she hobbled to bed, Lord and Agerra had a chance to catch up with each other (as much as a couple can when one has no memory). Henry slept through the whole thing.

One relatively recent tweak that illustrates the way that tiny details can provide powerful apophenia is the addition of a reason for when a character has a mental break. In the game’s logic, characters have moods which are simply the sum of all the offsets of their memories at a particular time. So they might be unhappy about their pet dying and having to kill a prisoner and not having a table to eat at, and if their mood crosses a certain threshold, they’ll break down. The reason is semi-random, weighted by the intensity of their moods. “I’m considering adjusting it because sometimes it says someone went insane because they ate without a table, but maybe not, right?” says Sylvester. “But just two lines of code choosing a random thought creates a reason, a connection.”

When you play, the systems underlying the characters’ behaviour seem impossibly complex. But they’re individually very simple, because Sylvester actively avoided making systems that were hard to implement. The game, after all, was originally about building 2D spaceships, but he found developing AI that could negotiate airlocks tricky, so he moved the game to a planet. “I guess it’s a game design principle I stick to, which is if something’s really hard to do, just don’t do it. Just do something else. There are so many other things you can do, so just avoid the hard things and take the low-hanging fruit.” Apophenia, therefore, is the lowest-hanging fruit, because it isn’t even in the game.

You've got to have some sympathy for Henry. He's been mourning for Nelly since her death, his mood in a constant slough of despond. After four nights of disturbed sleep, seeing the corpse of a raider and being insulted by Lord, he finally loses it. He attacks any creature that comes by, killing a boar. Terrified Lord cowered in the corner of the colonists' shared room, only to witness Henry turning from the boar to attack Feeb.

But making a game that generates it isn’t without challenge. One big one is giving players the information they need for their minds to spin out stories. One aspect is the interface itself, which has to serve it all out. It’s grown as the game has, but though some players complain that they find it hard to initially learn, it cleanly divides details into various categories: health, needs and character traits. Nothing is hidden, because if players don’t know a detail, it doesn’t have story value. But the game does remove information when it’s no longer relevant. Thoughts fade after a while and health issues are cured, though things like scars will remain because they provide hooks for stories, like that time a character grappled with a maddened squirrel and won. Traits are restricted to three, backstory phrases to two, and they have different values for 10 skills. And that’s it.

There’s consequently a lot of space around characters for stories to form. RimWorld contrasts with a game like the excellent Ultima Ratio Regum, which generates large quantities of backstory and world detail. “I think minimalism works because you get the things with big impact and then you leave space for the player to fill in the other things, as opposed to filling in every detail, which doesn’t leave room for apophenia,” says Sylvester. “You have to leave something undefined for the player to create the story, and also it’s a tonne of work for people to do, that cognitive effort of absorbing all this information. People hate cognitive effort.”

So starts a grim cycle in which Henry is badly wounded during a psychotic break and is nursed back to health, only to lose control again, maddened by pain, discomfort and the ever present memory of his girlfriend's death. He wanders the wastes of the south, where the colony dumps rotting corpses, attacking a tortoise which chews his foot off. The colony can't take the pressure of caring for Henry; the next raider attack is its last.

And yet his choice to make RimWorld graphically detailed, mostly so it’d be more widely marketable, removes some opportunities for apophenia to develop, something that makes him envy the abstractness of Dwarf Fortress. If in Dwarf Fortress a husband should die next to his wife, a player can imagine various scenarios: a tender moment of her holding him in her arms or her impassively watching, because all you’re seeing is two ASCII characters next to each other. There’s no information about which way they’re looking or if they’re sitting or standing. In RimWorld, however, characters are shown looking in directions, lying, sitting and standing. If the wife is looking the other way, space to imagine her reaction to her husband’s death is narrowed. Further out from RimWorld is The Sims, where far more is shown and the player is limited to imagining motivations. “I think it’d be interesting for someone to make a version of The Sims in ASCII,” Sylvester says.

The final part of RimWorld’s puzzle are its ‘storytellers’, different algorithms you can choose which manage the events that players face, from raids and insect infestations to the appearance of traders. The one called Cassandra Classic tries to create a balanced, paced storyline, sending a cycle of exciting threats and rest periods which gradually get more challenging, depending on the colony’s general wealth and combat power. But it’s the Randy Random storyteller which shows how powerful apophenia can be. Other than impossible ones, such as heatwaves in winter, it sends entirely random events the player’s way, and yet it’s easy to ascribe meaning to them. That’s because in RimWorld everything overlaps: a colonist’s illness makes a raid harder to fight off, but the food the colonists find on the raiders’ bodies allows them to get over an eclipse that makes their crops fail. Each event is random, but in concert, well, that becomes another story.

From this site

16 Comments

  1. jonahcutter says:

    Yeah, y really like playing with the random AI. I’m not even very knowledgeable about the intricacies of the game’s systems, but the randomness leads to excellent moments (and disasters) and a constant feeling of… well… not having any idea what may come next.

    Things can rapidly spin out of control, and there’s no way to know it. A squirrel attack may be no biggie and almost immediately forgotten. Or it could be incredibly ill-timed and amplify some other, potentially more dangerous event, because someone is slightly wounded.

  2. kaal says:

    I really like this game, but the combat feels so off from the building a colony part. In combat you control every colonist like mindless robots instead of telling your colonist kind of what to do. What makes it worse is that the enemy AI is very easy to abuse which makes for even greater disconnect from the core ideas and “create stories ala dwarf fortress & X-com” part of the game.

  3. Christo4 says:

    Played it a bit at a friend’s house, but i have to say that imo, it is a bit lackluster…

    I only played for a few hours so i guess it wasn’t that much, but i had a pretty good colony and combat was ok, but it was pretty annoying that for example, you can’t build moats, ditches or bridges or stuff like that and the traps i’ve found pretty useless when dealing with enemies, walls were better, but even then there’s an annoying mechanic where a character can stand at the edge and get a lot of defense compared to just sandbags, so then what’s the point of having them in the first place?

    Also, it’s a bit distracting when you don’t have to harvest any water, which is the number 1 issue in any survival though i guess it’s not a big deal. But it would be cool to have rivers and stuff that can either be polluted or contaminated from a toxic storm or other things. Or that you can’t harvest bodies of dead people even if it’s still freash or put in the freezer. i don’t really understand why… Supposedly it’s for balance purposes but i found it rather weird.

    All in all it was a bit fun, the colony management part anyway, though the combat was a bit iffy like the above poster says and i feel that it needs a lot more than what it currently has.

    Yes, i get it, mods solve a lot of these things, but i think that if you want to see if a game if worth it or not then it should be the base game not mods.

    As it is, for people who REALLY enjoy this sort of thing i think it might be worth it… For me, not yet anyway since it feels a bit, not unfinished, but too basic.

    (also, why are there so many bullet weapons and not more lightsabers or laser guns or something like that, i wanna be invaded by a crappy imperial guard unit from WH40K)

    • barelyhomosapien says:

      Just a minor correction:

      You can harvest corpses. And get human meat and human leather from them, it’s just disabled by default as you get some pretty strong negative moodlets from eating human flesh unless your folks are cannibals.

      • Christo4 says:

        Oh sorry, i meant harvesting bodies for organs. I know you can harvest them for meat and stuff, but not for their organs… Which is kinda of a shame since i’d actually expect the colonists to have less problems harvesting them from dead bodies than from live people.

        • Premium User Badge

          Ericusson says:

          The most subscribed mod in the workshop IS about organs harvesting so I don’t really understand your point.

          • Christo4 says:

            really? you don’t understand my point? When i specified in my post that i don’t think you should judge a game based on what mods it has but on what it offers?

            the base game doesn’t offer it, so it’s a minus.

  4. Monggerel says:

    Yeah, that’s a mechanic that falls outside my purview. I don’t tell myself little stories while playing games, for the most part. There is of course the very basic narrative of keeping score, and when a story is presented (shallow or otherwise) I think about it – what influences I can note, relation to other stories I know, what techniques are employed, tropes, and just the basic emotional texture – but I don’t tell myself about the adventures of Captain Deringdo and the Mötléy Crüäc on board the Bückstäbü in FTL and how that one time they stumbled upon a guy stranded on an asteroid, shared beers, and traded every gun they had for what is basically a very large laser pointer.

    I just play the thing, and whatever happens I’ll simply acknowledge – maybe I’ll ike it or maybe I won’t, but it doesn’t cohere into a narrative.
    Which is probably why I got super bored of Rimworld once the base-building bit and the fighting for survival bit got worn out. It’s just a challenge – and I can find better ones than this. Not that I regret playing it – I just can’t get as much out of it as others.

    • Monggerel says:

      I also pay attention to a story’s consistency, interestingness and how well it is told, obviously. (which is why I *hate* every Bethesda game since Oblivion. Oblivion was novel enough to let me forget about how it fails as an RPG)

  5. tigerfort says:

    “I’m considering adjusting it because sometimes it says someone went insane because they ate without a table, but maybe not, right?” says Sylvester.

    Actually, the current system works for me on at least a couple of levels. First, madness isn’t reasonable – the thing that makes someone crack isn’t the biggest problem, just the final straw. Second, the sufferer of the breakdown is (partly because of the first) not in the best position to explain things; they may well genuinely think that the root cause of the problem is that someone else sat in the last chair that evening. And third(ish), their co-colonisers are going to have to make a guess at the reason for their sudden change in behaviour. Sure, he’s been a bit odd since his wife and son died, but maybe the thing he cares about most really is being “civilised” enough not to need to sit on the floor. Frontiers do weird things to people.

    • TechnicalBen says:

      You have no idea how true this is. I’ve seen it in care work. “So and so threw something across the room today because they were told to wash up”, week later turns out they had an ear infection and just flinched at that exact moment.

      People feel they “know” what is going on around them, and what other people think/are. Very rarely is that true.

  6. C0llic says:

    In its current state Rimworld really feels like a more focused Dwarf Fortress, with all the FUN that implies. It’s a dream come true really, and continues to get deeper and more interesting.

    The ability to force prioritise jobs is a genius move as well, as it helps to remove some of the frustrations you can feel while playing DF.

    I’d recommend it to anyone who wanted to love dwarf fortress but couldn’t because of the UI, complexity and lack of visual feedback.

    • Premium User Badge

      Ross Turner says:

      Apologies for the blatant shameless plug, but what you’ve described there is the exact motivation for the game I’m currently developing – http://kingunderthemounta.in it’s aiming to take the core gameplay of Dwarf Fortress and more economically-focused games like the Settlers, mixed with the approachable visuals and UI of Rimworld and Prison Architect.

  7. EvilMonkeyPL says:

    I really like how when a character is dead, it shows
    ‘Pain: none’
    as the only state affecting that character.
    It’s okay now, Blue the Gatherer, your asthma now longer makes every breath excruciating, your peg leg no longer hurts the stump of your left leg that you lost because a pack of wolves tore it off one time you went hunting, and you no longer have to sleep in an overheated cave, because a heatwave is what killed you.

    • preshrunk_cyberpunk says:

      A few saves back, my colony’s only capable hunter got her right arm AND left leg torn off in a scuffle with a SNAKE tha went horribly wrong.

      Now she spends her days laying in bed, occasionally playing chess with the other colonists when they visit her.

      • preshrunk_cyberpunk says:

        Don’t ask me how the snake managed either, its a mystery to me.