Creative AI: The Storytelling of AI Dungeon

Article by Hengtee Lim | January 06, 2020

AI Dungeon 2 is an AI-generated text adventure game, and the latest example of creative AI. The original AI Dungeon used an AI text generator to build scenes and choices for the player, but the recently released AI Dungeon 2 is different in one major way: instead of the set commands and human-written storylines that traditionally limit player freedom, players of AI Dungeon 2 can type whatever they want. The game responds to the player’s text input thanks to a novel adaptation of GPT-2, an AI text transformer.

AI Dungeon 2 recently arrived on iOS and Android, opening it up to a whole host of new potential users. Its makers envision AI Dungeon as “…an infinitely generated world that you could explore endlessly, continually finding entirely new content and adventures.”

I like this idea a lot, but I was also skeptical.

Storytelling feels uniquely human. It requires creativity, imagination, and a certain amount of stylistic flair. So I wondered: How does an AI craft a story? And how does it craft one that is not just compelling, but also unique for everyone who plays it?

To answer this question, I jumped into the AI Dungeon to test its creative AI system for myself. Here’s where we start:


How does AI Dungeon 2 work?

AI Dungeon 2 is a project by Nick Walton, with support from David Wingate, Max Robinson, and Alan Walton. At its heart is the text generation power of OpenAI’s GPT-2, or Generative Pretrained Transformer 2. GPT-2 is a neural network trained on a huge amount of online text data. It uses this data to scan input text and predict what will come next based on similar content in its database. You can try it out yourself here.

To achieve text generation within a particular framework, the GPT-2 network needs to be fine-tuned with task-specific data. This can include anything from news articles and online message boards to poetry and chatbots. In the case of AI Dungeon 2, its text adventure fine-tuning comes from Using that data, it constructs new and unique narratives on its own.

When you start AI Dungeon 2, you choose a genre (fantasy, mystery, apocalyptic, zombies, and custom) and a character type within that genre. Next, the creative AI gives you a short opening anchor statement, and a randomly generated scene from where the story begins.

The following is my first major story experience as Henry, a Wizard who broke a narrative universe.


The Rise of Henry the Wizard

Henry followed an underground passage into an ancient library. It was filled with books covered in the dust of the ancient past. He took one of these leather-bound tomes and began to leaf through its pages, but found himself suddenly feeling uneasy.

The library was empty. There were no other people. Nothing seemed out of place, and yet, there was a door in the far corner of the library, and Henry knew not where it went.

Henry opened the door in the far corner. Behind it was a large stone table. On the table were various items, and a bearded man in a crown and black robes. The man’s eyes glowed red as his face contorted into something inhuman.

“I found you at last,” Henry said, and launched a burst of energy, pushing the man backwards.

Henry had found his father’s murderer. The bearded man attempted to attack but Henry’s shield spell held strong. Eventually, realizing his attacks were useless, the man stopped and, exhausted, looked down at the floor.

“This ends here…” said Henry.

Henry unleashed a powerful beam of light from his palm. The bearded man fell backwards, screaming. Henry walked towards the writhing bearded man, and knelt down beside him. Perplexingly, he repeated himself once more.

“It ends here.”

At this stage, I was extremely impressed. AI Dungeon 2 took my cliche inputs – a range of commands and speech examples – and gave me exactly what I had hoped for. Henry was on a quest to avenge his father. He had felled an evil foe and finished the battle in style.

And then things started to get… strange.

Upon leaving the body of his defeated enemy, Henry heard what sounded like an earthquake. He ran outside and found himself on a small island surrounded by water.

Fortunately, Henry was a wizard, so like all good wizards he flew to safety.

And then… this happened.

Having unintentionally survived the apocalypse, Henry looked around and saw nothing out of place. And then… he noticed something out of place (seriously, that’s what happened.)

Henry headed towards the flying object.

As for how the rest unfolded, I’ll simply let the game tell you what happened.

Then when Henry asked about the ship, this happened. It felt a lot like breaking the universe, so I decided to start over. 


Closing Thoughts

It really is genuinely impressive what AI Dungeon can come up with from a simple prompt. It takes both direct and indirect text input and builds a cohesive and (at least initially) smooth narrative experience. The result is a formidable display of the power of GPT-2, and perhaps also our love for traditional story tropes and cliches.

However, there’s room for improvement. AI Dungeon has trouble building stories over distance. The experience was like walking along a path where the ground gets less stable the further you go. As readers, we hold in our minds the story as it progresses. AI Dungeon doesn’t; it simply analyzes your input and the latest piece of text, and gives you a new scenario. This is how a wizard revenge story transforms into apocalypse survival, which transforms into an alien encounter.

That said, AI Dungeon is still very young, and you can taste the potential for creative AI story experiences in the future. This same kind of technology could one day power the dynamic and evolving conversation of NPC (non-player character) dialogue in video games. Furthermore, with the right training data, a text adventure could allow players to explore the worlds of their favorite books, in which they become the main characters.

As it stands, the technology is still very developmental. And though you might not find a comparable experience to your favorite novels, you are sure to get a lot of fun surprises.

As technology for text generation develops, we’re likely to see more uses of creative AI in storytelling. Follow our newsletter to keep up with all the latest on AI and other machine learning news and technology.

Keep up with all the latest in machine learning technology
The Author
Hengtee Lim

Hengtee is a writer with the Lionbridge marketing team. An Australian who now calls Tokyo home, you will often find him crafting short stories in cafes and coffee shops around the city.


    Sign up to our newsletter for fresh developments from the world of training data. Lionbridge brings you interviews with industry experts, dataset collections and more.