Rendering game worlds in text
Jul 5, 2021 16:30 · 3059 words · 15 minute read
[Music] In 2016, I became a little bit obsessed about the idea of rendering game worlds in text. This video is about that obsession and about the resulting game. I called it “Skyrim in text” but don’t get too hung up on “Skyrim”. Skyrim was just a shorthand for any sufficiently sophisticated and complex simulation-heavy game.
00:35 - “Skyrim” is a lot easier to say and also helped me think about this more clearly. I’m not trying to do Mario World in text. Or, I’m not trying to do Magic the Gathering in text. I’m trying to do Skyrim in text.
00:52 - All games have some kind of an internal representation of the state of the world.
00:57 - Skyrim needs to track things about where the player is, where he or she is facing, all the monsters in the vicinity, their inventory, the state of the levers, open and closed doors, and so on and so forth. That is the world state. Skyrim then takes this raw information and renders it in 3D. And it does this 60 frames per second. The point is, once you have the game world state, it’s your choice how to render it. You can render it in 3D, using different rendering techniques, you can render it in 2D, you can render it in, whatever, 1D I guess, if you want to, right? There are even games that “render” things in audio signals only, so you don’t see anything.
You can only hear what’s around you. Rendering, in games, is taking the internal world state and translating it into something that the player can follow. Okay? Hold that thought.
01:57 - Let’s talk about natural language generation. N. L. G.
02:01 - This is an engineering discipline that concerns itself in converting raw data into natural language.
02:09 - The classic example is weather forecasting.
02:12 - We now have a weather model for basically the whole planet, including very remote places. People living in those places would really benefit from a timely weather forecast but the population in those places is not high enough to really call for their own meteorologists. So, we have the raw weather data but not enough people to translate that raw weather data into something that normal people could understand.
02:41 - Natural language. Therefore: natural language generation to the rescue! Natural language algorithms take something like this and they convert it into something like this, and they can do it for thousands and thousands of places per second.
02:57 - Now, this is harder than you might think. A lot of developers who have no prior experience with natural language generation might think that this is something that they could do in a weekend.
03:10 - Uhm, no. You’ve probably guessed where I’m going with this.
03:14 - Could we take the internal representation of a world of something like Skyrim and use a natural language generation algorithm to render it in pure text? The answer is: yes, kind of. I go into more detail in a 2017 article that I will link to below but the gist is that this is harder than you might think, and that if you go with a naive approach you will basically have an unplayable game.
03:43 - Let’s be clear: rendering parts of the game world in text is nothing new. For example, the original game Rogue (after which we say “roguelike” now) had part of its game world rendered in text.
03:58 - So did about a billion other games. So, this is nothing new but this is not also what i’m after. I’m not after rendering parts of the game world in text. I’m talking about rendering the whole experience in text. So there is basically no other UI than reading the text. And the text is kind of like a little short story, full narrative, instead of just blurbs.
04:21 - But even that is nothing new, right? There are a lot of amazing games in the interactive fiction genre that are like that. They are not just blurbs. They are full stories that you can read fully, top to bottom, like little short stories. But that is also not what i’m after. See, the interactive fiction games are 99% authored. They are something pre-written by the author of the game. And that makes them like short stories or little novels, right? But they are not so much rendering some internal complex game world in text.
They are showing you paragraphs of text based on some state of some variables. What i set out to do is something different. I really want to render the game world in text.
05:15 - So, whatever the mechanics of the game, whatever the simulation throws at the player in in terms of situations that can happen, I want to be able to render those situations in readable prose. So I made a custom NLG algorithm. And it kind of worked. But then i realized there’s a problem.
05:36 - Games like Skyrim are based on repetition. Just look at this clip. There are three hits in a row, basically identical. The enemy doesn’t really react to the slash, and we only see this blood splattering effect. This is totally fine for a video game but imagine that we had something like this in text. Imagine having to read this. “I hit him. He gets damaged. I hit him again. He gets damaged again. ” That just doesn’t work. Here’s a quote from the Hour of the Dragon, a Conan story by Robert E.
Howard, for comparison. “The axe fell in a devastating arch, and the Aquilonian cried out and went to his knees, grasping the severed stump of his right arm from which blood spouted. ” I mean, that’s a high bar, but i would like to get closer to that. To have that, I realized that the new game must be a lot more realistic. I can’t just decrease hit points until they reach zero. Every slash must have a meaning. I need radical effects.
So i did that. I implemented anatomy to the level of individual body parts. And you can attach any body part to any other body part and it all works. So you can have creatures that have, like, their eyes in their palms and if you cut off their hands then they will go blind.
07:04 - [Music] This works well because now the fights are a lot more intense. Limbs are flying, heads are decapitated, and so on. The combat is now closer to something like Dungeon World than it is to something like Dungeons and Dragons.
07:22 - In Dungeons and Dragons, a dragon has something like a thousand hit points and you kill it by slowly taking down those hit points to zero. In Dungeon World, famously, a dragon has 16 hit points. A mid-level archer in Dungeon World can do 16 hit points of damage, if they are lucky.
07:44 - So, a single lucky shot by a mid-level, normal archer can take down a dragon.
07:52 - Yet, players report that meeting a dragon in Dungeon World is way scarier than meeting a dragon in Dungeons and Dragons.
08:03 - And it is because of radical effects. It is because of storytelling. Now i’m going to play the trailer to this resulting game. I think it does a pretty decent job of showing how this can be awesome. After the trailer, which is about one minute long, I’ll go back and talk about the main drawback of this approach.
08:27 - Okay, so I’m exploring this ancient building in the fantasy future of San Francisco, and I meet a lizard man.
08:37 - We fight. He almost immediately kills my friend.
08:41 - Okay. I raise the friend from the dead, and manage to slash off the lizard man’s left arm. My undead friend takes the arm, uses it as a club, and smacks the lizard man over his head with it. Which kills the lizard man dead. [Music] Okay.
09:10 - [Music] My working name for this approach is “radical effects”. Instead of gradually decreasing hit points, every combat action has some narrative effect. They throw out of balance, they cut, they thrust, they miss, they cleave, they crack, and so on. So after I implemented this, and a long time before the final product, I was briefly quite happy with myself. Then i realized radical effects has one big drawback. The player can now get killed in one slash or they can lose a leg in one slash.
09:50 - And that’s a problem because I don’t want the player to be reloading every time this happens. That sucks all the fun from the game. If you have a game where the player is supposed to reload all the time then why have a game at all? It’s not a game. That’s a reloading-fest.
10:08 - So, I decided that cleaved limbs can’t be a big problem for the player.
10:13 - I decided that the player character will be a necromancer.
10:17 - They must be able to mend any wound, however terrible. My take is that necromancy is basically the highest level of healing.
10:27 - Because, let’s face it, what’s more badass healing than raising a corpse.
10:35 - Alright, done. The player character is now a necromancer.
10:40 - If they lose the leg, they will just mend it and put it back.
10:44 - Next problem. I realized that if i want a higher level of freedom in the game, I need to give the player a lot of options.
10:52 - Like, in Skyrim, you can — when you’re fighting someone — you can go to the left, you can go to the right, you can use this sword, that sword, this magic, that magic, and so on.
11:03 - You have a lot of options and that makes that game interesting and fun. Thanks to the simulation at the core of my game, including the anatomy, I also have a lot of good options for the player to choose from. But how do I let them choose the option? I can’t just list all the options, like, as a big list every time you can choose between them because imagine reading and choosing from 50 different options all the time. That’s not fun. I could let the player write their actions, like in parser interactive fiction, but that’s very inaccessible.
People don’t like to write things down. Especially when they’re on mobile. Thankfully, inspiration struck before long, from a place teeming with inspiration.
11:59 - [Music] I lived in japan a long time ago but, more importantly, I played a lot of JRPGs. I decided my game needs a JRPG menu.
12:17 - Hierarchical menus are not the most exciting thing but they work really well. I added a map to the mix because spatial relations are really hard to express in text.
12:31 - If the player is exploring some new world, the last thing you want to do is to spend a lot of time explaining that that thing is through to the north west and that other thing is to the south east of where you’re standing.
12:45 - That’s not interesting. There’s a reason why fantasy books often have a map in the front or in the back that you can look at, even though that same fantasy book doesn’t have any other illustration. Spatial relations are not interesting, and not easily parsable in text. So, i have a map. Now I have a sleek interface for my simulation. Except, not really. Because when the player picks a choice, then the the game thinks for a while and then it kind of spits out the whole text in one go.
That bothered me because players were skimming through the text, not really taking it in. And it’s natural. If you have something interactive, you want to get to the next interactive part as soon as possible. You want to skim through that text. And, generally speaking, I hate to admit, they’re fine. Like, text in games is kind of filler.
13:48 - And, again, like, I love text in games, obviously, but if you look at any modern game, if you skim past the narrative part, you will probably be fine. Modern games will always make it obvious what just happened.
14:05 - So, like, there are journals, there are quest lists, there are little particle effects in your inventory.
14:11 - Like, even if you skip past most of the narrative parts, you’ll be okay. But in my game, the generated text is literally the only thing that you have to understand what’s going on in the world. So, if you swung at the enemy but also slipped and now you are on the ground, you should know. And the only way for you to know is to actually read the text. I also talked to a developer in one of those interactive stories studios and he said that from what they see, it’s really basically a suicide if you don’t ration the text to people sentence by sentence.
So i came up with this interaction where the player needs to tap the skull to get to the next sentence. And the next sentence is always kind of animated in. Now, this might seem obvious in retrospect but this took months and months of experimentation to get right. As did everything else. There were so many little tweaks that I did for literally years on my…
15:24 - Like, I’m not working on the game full time but, like, it was so many blind alleys where I needed to explore something only to find out that it doesn’t work. Just crazy.
15:35 - As always, things that look obvious take the longest time to arrive at. Okay, so now the big question: Why would you want “Skyrim in text”? Right? Like, we’re obviously not replacing video games that render things in 3D or 2D.
15:52 - All I’m saying is that an additional, alternative approach might be nice. Like, there are things that work better in books. There’s a reason why often when someone sees a movie after reading a book, they will often say: “The book was better”. That’s because a lot of the stuff in the book just works in the book, but it doesn’t…
16:17 - it’s lost in the movie. And vice versa, right? Like, things that are in a movie will not work well in a book.
16:26 - For some aspects of storytelling, written word on an otherwise blank page is so much better than any video. It’s a cliché but your imagination is the best graphics card. The other thing is that rendering in text can be a lot more indie friendly than rendering in 2D or 3D. I was able to make a pretty decent game with original world building by myself. That is the indiest of indies.
17:02 - Today, almost any indie game you hear about was built by a team of people. Because, of course, games are getting more complicated.
17:11 - For almost any game you need artists, programmers, of course, animators, managers, and so on. Even then, an indie studio will probably scope their game to something pretty small, like a 2D platformer. There are no epic RPG games being built by one person these days. That wasn’t always the case. Like, think about Ultima. That was just one person. What this means is that games today are either epic but faceless or authorial but less epic.
A game like Knights of San Francisco can be pretty epic, but it is also completely authorial. I didn’t do any focus groups. I didn’t stress about ROI because I need to pay 20 salaries.
18:03 - All i added to the game is what i felt. You know, like a book author. Book authors don’t work in teams. Book authors don’t have focus groups. They do something authorial. They do something… the thing that they want to do. Like a book author, I own the experience.
18:25 - I own the experience with all its faults and weirdnesses and idiosyncrasies. But it’s a thing that is by me.
18:34 - It’s authorial. So you can be, like, “okay, I don’t like this person.
18:38 - I don’t like this game. “ It’s less of a product and more of an expression of what i feel and what i like. Anyway, that’s my journey so far to create games that render their game world in text. The first game, as I mentioned, is called Knights of San Francisco and it’s actually already available for Android and iOS. It’s a paid game, it is pretty short, like 90 minutes to two hours, it is all in black and white, it has really weird music, it’s weird, and did I mention it’s paid? So, a lot of people will not like it.
But, you never know, you might love it. Like, there is a reason why it has really good reviews. And I think this is because that kind of approach really strikes a chord, or a note, with people. And I love that because I kind of assumed that maybe I’m the only one who really cares about this stuff. Beyond Knights of San Francisco, I hope to build at least one other game in this genre, and hopefully more, because, at the very least, I want to try a few things that I wanted to try in Knights of San Francisco but that couldn’t really fit there.
So, like, for example, like, a little bit more of, like, strategy, like higher level stuff, and… and factions and stuff like this. So, we’ll see how that goes. I don’t know. I don’t apparently… I don’t know how to end this video, so we’ll just be here forever.
20:19 - I guess, obligatorily, I need to ask you to like and subscribe, and go to the comment section below and do something there.
20:30 - Because that’s what the algorithm likes. Yeah, I’m really good at this, apparently. I’m really good at YouTube. .