Procedural generation has been a boon to the indie development scene for a long time, and one that’s been especially popular of late, allowing the creation of vast swathes of content that would otherwise condemn a game to years of extra development time.

That said, it’s been almost exclusively limited to level design and asset creation, both of which can be funneled through an algorithm in such a way as to produce a playable space that follows a fairly strict set of rules, ensuring that it's fun and fresh each time.

Now Ed Key (Proteus) and Nicolai Troshinsky of Twisted Tree Games are attempting to use procedural generation for game storytelling. They want their game Forest of Sleep to an endless array of structured, interesting narratives that play out over the course of half an hour or so. They will do this by constructing an engine that can create randomized tales, by constraining details that could bog down stories, and by letting the story ultimately come together in an external processor--the player's mind.

Randomly generated folk tales

Forest of Sleep is an experimental storytelling game inspired by Russian fairytales. The player's interactions with characters and objects will lead to reactively-generated stories. Key and Troshinsky are hoping to create something with a strong sense of pacing and drama, even if it's ambiguous in detail.

“The plan with the story system is to use a lot of visual language in the sense of framing and cutting between images and the position of characters.” Key tells me. “Like a cinematic language, but one that’s characteristic of Eastern European animation. We want to delegate a lot of the process of telling the story to the player’s imagination, while creating something that is a well-structured story in a formulaic, screenwriting way.”

He points me towards an animated short called Fox and Rabbit. It's a work by the great Russian animator Yuri Norstein, whose flat cut-out style and fascination with folktales are clear touchstones for Forest of Sleep.

Animated short Fox and Rabbit

Fox and Rabbit has some limited narration, but as Key suggests, it primarily gets its story across with images, animation and juxtaposition. Without words, a lot of the narrative takes shape in the minds of the audience. Forest of Sleep,will take a similar tack, with little or no spoken or text narration. Players will be free to infer and imagine connections, conversations and ideas.

"Rather than crafting a linear narrative that the player goes through, the game creates a narrative playspace, a co-creation between the systems of the game and the imagination of the player."

On their website, Key and Troshinsky describe the broad outlines of a play session: "You guide a group of three children through a forest, traveling between kingdoms and landmarks, helping strange people with peculiar requests, and sitting down to sing around a campfire in the dark woods."

The two developers believe that Russian folklore is the perfect backdrop for their narrative experiment. These tales are filled with odd non-sequiturs, "absurd fairytale logic" and magical goings on. That style and tone is well-suited to the quirkiness inherent in a procedurally generated story.

“There’s a balance.” Key tells me. “How often can it be weird and random without impacting the story?”

The answer draws inspiration from the likes of 80 Days and The Walking Dead, in the form of marking objects and characters for the game to bring back at a later point. The developers say that this this is more about creating a rhythm to the journeys and steering you through the possibility space of the story than creating urgent do-or-die moments.

“Even if something happens and it’s gone forever, if you mention it later on you reinforce that the game knows that it happened to the player," says Key. "Once [the engine] has linked two entities together in its database, those should continue to be associated in some way, at least more than once. If you haven’t seen them for a long time, it should visually or musically recall them to reinforce that association.”

And in doing so, hopefully make the player feel that it was intended, or at the very least not entirely superfluous.

Building the story engine

Forest of Sleep is still in the early stages of development. Much of what they’ve done so far has been focused on getting individual systems working that they will then be able to slot into the story-generating engine. But as each piece is put in working order, Key says he's getting a better picture of how the story engine will need to work.

Conceptualizing the game has meant taking the component parts of a story and inserting them into the player’s experience in a way that is both convincing and surprising. To achieve this Key and Troshinsky have needed to deconstruct how a story works to a minute degree. To hear him talk about it is to hear narrative being rendered into something more akin to code.

“The individual parts are kind of crafted templates that can take entities that have certain prerequisites,” Key explains. “Such as having an item you don’t own, or someone you haven’t met before. The idea is that [the engine] has a lot of those to choose from, and the story system is working along this timeline, and as it moves towards an apex or twist, that becomes more flexible as the player might do something to stretch it out.’

‘The interesting thing about it is how storytelling in this instance is a co-creation between the systems of the game and the imagination of the player, and what they’re inferring, along with what they choose to do with what the game presents them with. It’s a narrative playspace, rather than a linear narrative that the player goes through.”

If successful, Key and Troshinsky will be taking procedural generation in an interesting new direction, and could very well be a first step towards the tantalizing possibility of an infinite and satisfying story engine.