Fractal stories, or how to create an open-world text adventure game
Once I decided to create a text Skyrim. At first, this sounds too ambitious, but in the process of developing the history and mechanics of the game, it determined its main elements: a game about swords and magic that takes place in a living simulated world presented in the form of the book Choose Your Own Adventure.
My idea turned into a short game Insignificant Little Vermin , with which I participated this year at IFCOMP. In the article I will talk about the process of creating this game and about what I learned by watching how people play it (on Twitch). ')
Why skyrim?
Don't get too hung up on what I mention here Skyrim. For me, Skyrim is just a well-known fantasy video game that can be used as an example.
Rather widely known , because I wanted people to instantly have a picture in their head.
Fantasy , because fighting style in fantasy games is especially well suited to our goals (more on this later).
With an open world , because games of this type allow us to escape from the real world, and therefore are excellent for our goals (more on this later).
A video game , because I focus more on the game process / course of the game, rather than on an interactive story (and more on that later).
The important thing here is that we simulate a world that a player can learn. The world is inhabited by actors (monsters, NPCs) and entities (swords, doors, chests, etc.) that a player can interact with. In Skyrim, the world is rendered in 3D, and the player gives out low-level commands like “move forward” or “use a weapon in your left hand”.
The purpose of the simulation is to entertain the player. That is, I use the word "simulation", without meaning that Skyrim is trying to " imitate the processes of the real world as close as possible." For me, any video game that has a stable update cycle is a simulation in its own way - even if it is a 2D simulation of an Italian plumber's journey to save the princess.
First attempt, intentionally naive beginning
The most naive way of porting Skyrim to the world of text adventure is to take a simulation of the world as it exists in a 3D game and play it frame by frame, describing what is happening and asking the player for low-level input. It will look something like this:
Near Whiterun
[...]
You are standing in the coordinates {351.0, 211.9}, looking in the direction of the CER. Your sword is in motion by a swing of 12%. You see a gangster in the coordinates {351.1, 210.8}, looking in the direction of the SSN. His sword is in motion by a swing by 78% and he missed.
You take a step back to the coordinates {354.9, 212.5}.
[...]
As you can guess, the thrill of the gameplay and plot will be absolutely disgusting. And no matter how you customize the output, input or length of each frame represented in the text - they will still remain disgusting.
Second try
One way to solve this problem is to increase the level of abstraction. We will continue to use the Skyrim world simulation, but only at the highest level — the map, the distances between objects and locations, the location of actors, NPCs, the spawn sites of monsters, etc. Then we get something like this:
Near Whiterun
You have arrived in Whitran from the south. Nearby stands a waiting thug with an ax in his hand, ready to attack.
> kill the gangster run away
You raise your sword and attack the bandit. <Insert an interesting description of the battle.>
The last stroke of the sword cuts the throat of the gangster and he falls to the ground. While you bend down to him to raise his gold, an inch sticks into the ground an inch from your knee. You jump up and notice an archer on a hill nearby.
> kill the archer search the bandit run away
<Insert another interesting description of the battle.>
Now the gameplay is a little better, and this gameplay can even be fun. The player can move to different locations of the simulated world, communicate with people, take quests from them and live the Skyrim story.
But let's face it, fights are an important part of Skyrim's interestingness. Therefore, “kill the gangster, kill the archer” does not quite reflect him. At best, if you write truly interesting descriptions of the battles, we will get a longer version of something like Conan Kill Everything . But most likely, the player will be bored after the first few battles, and he will close the game.
This poses an important question: what makes the Skyrim fight exciting? We do the same thing over and over again, and each fight is very much like another. Why doesn't it bother us after the first dungeon?
The answer can be divided into two parts:
The player in combat has a high degree of participation. At any time he can go forward, retreat, attack, defend himself, change his weapon, jump, crouch, come from the flank, climb onto a rock, use magic, etc. This means that the player can improve their combat skill . The player must fight. Therefore, he can feel the “fan” (that is, what is defined in such books as Theory of Fun for Game Design ).
Fights are very unpredictable. The player never knows what each new fight will turn out to be. You can fight three times with the same group of enemies, and each time the course of the battle will be different. That is, the player receives various rewards - an important ingredient in order for the game to “hook” him.
Skyrim can again and again create similar fights for the player, but they not only do not become boring, but also are excellent fun! Not in spite of its repeatability, but thanks to this cocktail of repeatability, participation and unpredictability.
And therein lies the fundamental difficulty of trying to combine video games and text.
In good video games there is always some kind of repeatability. All games, from Pong and Tetris to Portal and Skyrim, are based on a repetitive set of similar tasks for the player so that he can learn to solve them better.
Good text can not be repeated too often. Duplicate text is boring. Try to describe in prose what happens in the first five minutes of the Super Mario gameplay so that it is fun to read. It's impossible.
Text games usually solve this problem in two ways: they either try to avoid repeatability as much as possible (which makes the game more intellectual — all situations and solutions are unique) or break repeated gameplay into a series of mini-games. Examples of the first approach can be seen in almost any high-quality traditional interactive literature . An example of the second approach can be found in the brilliant Sorcery series ! .
Third attempt
Since we realized that the gameplay of Skyrim is strongly tied to fights, let's try the approach with mini-games (and not more intelligent and unique).
Near Whiterun
You have arrived in Whitran from the south. Nearby stands a waiting thug with an ax in his hand, ready to attack.
> kill the gangster run away.
<Graphic mini-game with the battle.>
The thug falls back and dies.
In a mini-game, there can also be some text, but the mechanics are not tied to it. In Sorcery! The combat mini-game consists of a series of decisions about the strength of the strike (on a scale from complete defense to complete attack). But in the design of mini-games there are no restrictions. It can be a simple card game, a puzzle "three in a row", etc.
It works - I personally would buy the mobile version of Skyrim, made in the same style as Sorcery!
But I also think that you can do better. I mostly enjoy Skyrim because it’s an open world in which anything can happen anywhere. There is no switching between “exploration” and “combat” modes. A tavern in which a player communicates with an NPC, moments later, can become a tactical shelter point. The player can maneuver around the patrol and attack him with something powerful from a distance, from a relatively safe cliff. And so on.
None of this can not be qualitatively transferred to the game with the text and mini-games. So let's move on.
Fourth attempt
We will again change the level of abstraction. Obviously, a naive start with frame-by-frame text reproduction was a bad move. And teams like “kill the bandit” made the level of abstraction too high, regardless of whether the fight was described with text or realized as a mini-game.
Let's get a little lower, from the level of “kill the bandit” to the tactical approach. To something like this:
Near Whiterun
You have arrived in Whitran from the south. Nearby stands a waiting thug with an ax in his hand, ready to attack.
> kill the gangster run away
How exactly do you want to kill the gangster?
... with a sword > ... archery
You quickly pull the bowstring and release the arrow. The arrow flies by the ear of the gangster. <Description of the rest of the battle.>
This approach gives more options than just “kill”, but after a while it becomes not very interesting. Each player adheres to a certain style of play (stealth, attacks from a distance, melee, magic, etc.), and therefore in fact he will have a small choice. For an archer, the most good tactic will almost always be "bow and arrows" or "sneak by." The other player will have completely different battle schemes, but this does not necessarily make the gameplay interesting.
Therefore, we need to offer the player meaningful choices at a lower level.
You have arrived in Whitran from the south. Nearby stands a waiting thug with an ax in his hand, ready to attack.
> lunge with sword wipe the sword
Your blade moves fast, but misses the thug's chest. The thug swings his ax and slightly touches your leather coat.
lunge with sword > wipe the sword
The sword cuts through the thigh of the gangster and he screams in pain. He is trying to attack you from above, but the ax slips past. <Remaining Battle.>
This is similar to the fact that the player takes part in the battle. There are many possible actions that correspond to different styles of play (a swordsman can do lunges and blows, block blows and chop off heads; an archer can aim at different parts of the body) and these actions can be combined in a million different ways. Players can develop their own tactics!
But this approach has problems.
The text as a result is very mechanical. This is not as bad as our first naive approach, but still unlike what the real author would have written. "You make X, the opponent makes Y". Repeat. This is very annoying.
There is no easy way to work with reactions. A blow with a sword or hits the target, or misses. Of course, the attacked side can expect an attack and at this point defend itself (“stand in a defensive stance” or “raise the shield”), but usually players hate to do so. This means exchanging the action of “attacking” (a great action) to “ possibly getting less damage” (boredom). In some cases, this may be a rational choice, but it does not exactly look like an adventure.
So it looks like we are at a dead end. We considered the whole range of abstractions and nothing allows us to make our game quite good.
It was in such a situation that I found myself after working on the game for five years. I almost gave up, having decided that I proved (at least for myself) the impossibility of creating a game with an open world like Skyrim in the text. Impossibility even in theory.
I decided to take a break from this project "Skyrim in the text." Instead, I began to create something completely different. The game was also based on text, but the gameplay was more procedural and psychological. The plot is about surviving in a group.
And in the process of working on this project, I realized that textual stories are fractal. Unlike video games (which need a stable way of updating), in the text we do not need to adhere to one level of abstraction.
The sixth and last attempt
Let me show what I mean:
Near Whiterun
You have arrived in Whitran from the south. Nearby stands a waiting thug with an ax in his hand, ready to attack.
> attack the bandit use bow and arrow run away
You raise your sword and bring it down on the gangster. He takes a few quick steps back and as you approach, he swings his ax rapidly.
jump back > dodge block
You bend down and the gangster’s ax flies inches from your head. The gangster opens its side for a moment without armor.
> lunge with sword punch on the side ignore
<Remaining Battle.>
Notice that the “attack” command is tactical, it is at a higher level of abstraction than “wave” or “lunge”. When a gangster for the first time swings an ax, it happens at the “action by action” level. But when the swing is not over yet, we fall one level lower, and the player can respond to this situation by dodging (or by blocking the blow / jumping back). And if the action was successful, then we remain at this low level, at which the player can add a counterattack during the sway of the gangster, from whom he dodged.
Now in battle, there are many choices at all levels, from tactical location to action in a split second. In this case, repeatability is more interesting for the player, because the same action can be performed in completely different contexts.
The resulting text is already similar to what a real person could write. It turns out that two people do not just exchange the damage they cause - this is a real melee with dynamic possible results at each stage of development. A gameplay moves at different levels of abstraction, as it would be in the book.
disadvantages
So, this is what we have: my project for IFCOMP Insignificant Little Vermin works with the concept of fractal stories in an open world simulation, creating a relatively smooth, readable text adventure. Some players even assumed that the text was not generated procedurally in parts, although I know that this is so. However, more importantly, the players were usually very interesting.
But of course, it is too early to start the fireworks and applaud. This short game showed me the limitations of this approach and made it clear how much more work would be needed to fully realize my vision of an open world, rendered in the text.
First, the game was only the very first step in this direction. In the process of developing Vermin, I made many discoveries. I had no rules, no established practices, no examples from the industry on which I could base fractal stories or "Skyrim in the text." Fortunately, there are many sources about interactive literature, but most of them focus on a completely different aspect of literature.
For example, Vermin has much less content than I wanted. In scale, it does not even come close to an AAA game (such as Skyrim). Now there is only limited RPG development (for example, a player’s character cannot learn new skills), and in combat there should be more variation. In addition, there is no map function in the game.
However, all this is solved by investing additional time in this project.
But it seemed to me more interesting that it was not so easy to remove some restrictions. These limitations grow from the very nature of the system and from the text as a whole.
The need for clarity and (superficial) simplicity
The text is very easy to give too much information. An absolutely chaotic battle is quite acceptable in 3D graphics, but not readable when rendering in text. A sword fight with ten actors needs to be broken apart or abstracted from it - a possible solution would be something like Level of Detail (LoD) or Limelight, in which the actions of actors located far from the player are either ignored or described briefly.
The text is difficult (and boring) to explain the spatial relationships. Read any book about swords and magic - you will see that Conan / Fafhrd / Elric always threatens the pirate / swordsman / lich, but never does it “forward and left”. Location is always described in the most common words. No matter how clearly you think - you can never beat 2D or 3D graphics with the ability to quickly make it clear where everyone is and what they do.
The text also needs to think about names, categories and pronouns. It helps the use of the floor, because it is easier to tell the player what he is focused on. For example, if there is a male thief, a female warrior and a monster in the scene, the algorithm for generating a natural language will most often use the words “he”, “she” and “it”. And that's great. But compare this with a scene in which there are three male orc warriors - in it you will receive many sentences like "The Orc on the Left is Turning." It is boring and difficult to read.
In the text it is more difficult to work with the whole variety of characters' states. You can’t expect a player to remember, for example, the hand of an orc extended to the left. Fortunately, people have imagination (and they love to use it!), So a low level simulation can be complicated, you just need to make sure that it highlights only the most important aspects, and the rest can be allowed to the reader to get from the subtext.
Need for causality
In the text, it is impossible to create mechanics too based on characteristics or too competitive. If you go this way, then sooner or later the game will turn into a spreadsheet with a small head of narrative. Not that this is bad - I like games of this type (see Seedship ). Simply, this is not what we are striving for, creating fractal stories.
Procedural - not a “silver bullet”
In the text, the fight (and procedural content in general) works much better when it is mixed with something else. The development of context, character and narrative is part of what makes the game interesting. In all fights, Vermin has at least a small text that adds a bit of “salt” (opponents talk to each other), the same applies to locations when the player wanders around the world. It’s impossible to simply rely on procedural generation — you still need a lot of content (even if this content is eventually used procedurally). All this fits the general rule - procedural content is not for "lazy developers." It is not needed to save you from creating content. It is necessary for the content to respond to the player. And you still need him a lot.
Writing texts is difficult
It’s very easy to create something like “You hit an orc and caused 15 HP damage”. However, it is much more difficult to write many versions of the phrase “your blade flew past the orc”.
Natural language generation is hard
It's easier than modern 3D programming (at least in terms of man-hours), but not by much. The human language is rich and full of traps. Fortunately, we can choose a subset of the language that is fairly simple to implement (namely, real-time actions). However, all the same, one cannot expect a successful programming of such a game from a person, mainly engaged in writing. This is not another Twine text or Inform. This is a task for the development team, not for one author.
Not for any genre
Finally, not all content is suitable for fractal stories. Or at least some genres are much better suited for such a system. "Swords and magic" fit perfectly because:
Many actions are described straightforwardly, in real time.
They have a direct, “spinal” conflict.
They are built on reactions (counteract the blow by blocking it).
They are dedicated to physical research.
Compare this with something like Portal , in which there are actions that are hard to imagine, taking place in places that are difficult to describe, requiring a player of many skills. But we don’t have to go to 3D puzzles to find a topic in which this approach does not work. Even other battle-oriented games in the open worlds are much more difficult to “port to text” because they use relatively realistic modern skirmishes, rather than fantasy fights. Maybe I just lack imagination (and I have almost no experience in the literature on shooting), but I can’t imagine a good combat mechanic that can work with the instant action of a firearm.
To finish on a high note
So, I have been talking about the problems of fractal stories for quite a while. Let's end on a high note. Let me explain why I am so enthusiastic.
The shape that Insignificant Little Vermin took as a result is great for casual gameplay, especially on mobile devices. The game does not require a lot of skill, it can be consumed in short portions of gameplay or entirely. It contains an element of chance. It allows the player to read the story, which is unique to him, and explore the world at the speed appropriate for him. She does not need to look at what is happening on the screen - it's just text and a couple of static images.
In short, you can read it and play it while waiting for the bus.
I honestly believe that such an approach can change the outlook of many indie developers (some of them do not even perceive themselves as game developers). As I said above, this is not a system for one writer-author-developer. Compared to Twine, the entrance barrier is very high. But compared to even the simplest 2D platformer, it is relatively low.
You can shift the development focus from graphics programming and optimization to 60fps to basic mechanics, simulation, and natural language generation. Remember, now you are not limited to 16 milliseconds per frame, so there will be enough time for simulation and AI.
Artists can spend less time for details of the environment (the grass is here, the texture of the wall is there) and more to invent interesting worlds and characters. In addition, they are not limited to the capabilities of the rendering engine. If they can describe something, then they can use it. Descending on the plain army of 500 thousand dwarves? Fine. Structure of the “World-Ring” type, in which you can see millions of kilometers? We will cope. Lovecraft / Escher / non-Euclidean architecture? No problem.
Designers are less limited to one level of detail. They can without any problems allow the player in the same game to be both a general and a soldier. When working with text, you need to implement much less than working with graphics. Adding any gameplay mechanics suddenly becomes much "cheaper."
A small team can create something comparable in scale to Skyrim.
I can't wait to see where this approach to game development will lead. I will present my achievements in my blog and on Twitter. If you need less noise, then you can subscribe to the newsletter to be aware of the main points.