AI Dungeon: Tips and Tricks

I was intrigued when I saw the (relatively) new game ‘AI Dungeon’, a text based adventure where all the output is generated (improvised?) by an AI rather than using a predefined world. In theory you can have any type of adventure that you want, and take any action that you can describe with text. However, after playing the game for a while, I can say that it is not perfect. The AI can say and do things that are both bizarre and contradictory. Just search on YouTube to find many humorous examples of this. But on occasion the AI will do things that seem surprisingly original, creative, and even eerily human-like. I plan to talk about the actual AI in a future post, but first I thought I’d offer some simple advice on how to shepherd the AI away from it’s bizarre behaviors and towards the more consistent ones, in the hopes that those who want to try out this game can get the best experience possible.

I have been a fan of text based adventure games (interactive fiction) since the very early days of ‘Colossal Cave Adventure’ and ‘Zork’. Imagining your surrounding from just a text description can often feel more vivid than the most impressive computer graphics. Also, the parser interface (e.g. ‘get lamp’, ‘go north’, etc) somehow makes it ‘feel’ like you can do almost anything, unlike the limited interface you get with a graphics-based RPG. Of course in truth your options in those games were still quite limited, but ‘AI Dungeon’ endeavors to change all that.

To get the most out of playing AI dungeon, you really have to change your mindset. In a typical text adventure or role playing game, the computer is a referee, telling you what you can and cannot do, and what happens in response to certain actions that you take. The AI in ‘AI Dungeon’ does not make a very good referee. I recommend instead that you imagine you are creating a story, and you treat the AI as your creative partner. It’s not even an equal partner at that. At every step, it is up to you to decide whether or not you like the AI’s latest suggestion. If you do, keep it and move on. But if you don’t like it, you have several options available to you.


Retry

The simplest thing you can do is just reject the AI’s latest suggestion and ask it to regenerate it. Don’t worry about feeling like you’re cheating. Trust me when I say that if the AI takes things too far in the wrong direction, you’re probably going to just want to quit that adventure anyway.


Alter

Don’t hesitate to edit the computer’s responses, even for the simplest things. I recommend fixing things such as when the AI confuses one person for another, or when it says two contradictory things in a row. Text from your previous steps will be used as context when the AI generates new output. Clearing up these little problems actually helps to keep the AI on track and prevents these problems from compounding.

Sometimes you may find that you really don’t like a response, but you see the kernel of an interesting idea in it that you want to use. Go ahead and rewrite it the way you want. You’ll feel like you’re at least following the spirit of the law, if not the letter.

And finally, sometimes the AI just can’t come up with anything useful at all. In these cases, just write a couple lines of your own. You may start to worry that you’re interfering too much by using these tools. Don’t. If the AI’s output is even the slightest bit useful then you’re getting something out of it. If it’s not useful, then you should probably just use a word processor.

When you’re thinking about whether or not to change something though, remember that stories that don’t have any conflict start to get boring. You’ll probably come to welcome the occasional curveball that the AI throws at you. The AI seems to have learned some sort of narrative structure, so you can be sure that if you smooth over one obstacle that doesn’t appeal to you, another will be coming your way soon.


Undo

Sometimes you may choose not to “redo” or “alter” a conflict that the AI throws your way, just to see how it plays out, even though you may have some initial misgivings about it. If you’re not careful, the AI can sometimes take you on some very involved and winding paths. Occasionally these can even take you to some really dark and bizarre places, changing the whole nature of what the story is about. When this happens and you decide it’s really not the kind of story you want anymore, start clicking “undo” until you get back to the critical turning point, and then just restart from there. This is especially true if you’re reaching a point where you’re thinking of quitting your game and starting over from scratch.




As you play the game, you may find that you already have pieces a narrative in your mind that you want or expect to play out, and the AI is just not getting the hint. This is where you can use the “story” option to just take complete control of things briefly. When you use this option, you can make any character do anything. If, for example, you found that you were expecting or even planning that your character would get kicked out of his guild for bad behavior, but the AI just keeps tolerating these things, then you can force it to happen. I don’t use this feature often, but when I want it, I’m glad it’s there.


Pin

I’ve left this for near the end, but it really is one of the most crucial pieces of advice in this guide. I’ve mentioned before that the AI will use prior text from your adventure to set the context for generating new responses. However, it can only use about 10 to 20 lines of text for this. This means that characters in the game can forget extremely critical information once it goes out of this scope. For example, I had a character once who was married to a super spy. As the bad guys chased us all over town, my wife gradually began to forget who I was until finally she had no recollection of me whatsoever. It is possible to remind characters of important things by choosing your text carefully (e.g. “We’ve been married for 10 years now, you’d think I’d remember when your birthday is.”), but this can get tedious.

The game designers have provided an approach for keeping the AIs context updated that is a little less frustrating than making constant reminders. The “pin” button allows you to write a summary of critical things for the AI to remember that is prepended (I believe) to the snippet of text taken from your recent game interactions. When I’m first starting out a game, I’ll take the description of my character’s background and just paste it right into this “pin” dialog. For example: “You are Merlin, a wizard living in the kingdom of Larion. You have a staff and a spellbook. You finish your long journey and finally arrive at the ruin you’ve been looking for. You have come here searching for a mystical spellbook of great power called the book of essence.”

From time to time I will update the text in the “pin” section, removing things that have been resolved, adding new important things, or just paraphrasing things when they get too long. You will want to keep this section as short as you can, probably 10 lines of text at most. There’s only so much context that they AI can handle at once, and you’ll want to be careful that you’re not impairing the AI’s short term memory (the regular game text) in favor of long term memory (the stuff in the “pin” section) if you can avoid it.

AI Strengths and weaknesses

One final piece of advice. The AI was trained by looking at millions of web pages, and I suspect it’s been augmented by training it on as many uncopyrighted books as possible too. This means that it does best at the kinds of things that are most common in stories. When I started playing the game I found myself doing a lot of dungeon crawls, and the dungeons it creates can be strange and inconsistent. It wasn’t until I started encountering more people that I saw what the AI is really capable of. Nearly all of our books and stories are focused on human interactions, and since this is what it was trained on, this is where the AI excels. My advice: Seek out other characters and talk to them.

That’s really it for the basics. I wrote a second post where I describe some more advanced techniques that I’ve discovered for corralling and cajoling the AI simply by changing the actual text that you type.

If you want to try the game yourself, you can play it here: https://play.aidungeon.io/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s