Lunelle ← Back to home
Guides

How to play a text adventure with AI (prompt included)

Updated

To play a text adventure with AI, give the chatbot a prompt that sets the world, your character, a goal, and the rules, then type what your character does, one action at a time. The AI describes what happens and stops. Left to itself, a chatbot makes a weak game: it loses track of where you are and what you carry, accepts any action you type, and invents puzzle answers as it goes. Three things fix most of that. Ask for a short status block at the end of every reply, with your location, inventory, condition, and goal. Make risky actions able to fail, with dice you roll yourself. Give puzzles solutions that are settled before you meet them.

The advice works in ChatGPT, Claude, Gemini, Grok, and character apps such as Character.AI, Janitor AI, and SillyTavern. This guide explains what made the classic text adventures work and why a chatbot breaks them, gives a prompt you can copy, and covers rooms, puzzles, failure, and saving a long game. It ends with apps built for AI text adventures, as of December 2026, and how to play the original Zork. Our guide to playing a murder mystery with AI uses the same approach for a detective game.

What a text adventure is

A text adventure is a game told in words. The game describes a place, you type what you do, and it tells you what happens. You explore, collect objects, solve puzzles, and work toward a goal, and you can lose. Will Crowther wrote the first well-known one, Colossal Cave Adventure, in 1976, and Don Woods expanded it with “longer descriptions, a larger map, and a roving pirate,” according to The Strong National Museum of Play. A group at MIT began Zork in 1977, and Infocom sold it as Zork I from 1980. Players typed short commands such as GO NORTH, TAKE LAMP, and INVENTORY. Tim Anderson, one of Zork’s authors, wrote that Adventure “accepted only two-word commands.”

Those old games understood very little of what you typed, but they always knew where everything was. The program held the map, every object, and every locked door, and it checked each command against them. Nick Montfort, a scholar of the form, calls this the “world model” and treats it as essential: “a system is not IF unless it simulates a world, however erratically and in however limited a way.” (IF is short for interactive fiction, the name the genre’s own community uses.)

A chatbot reverses that trade. It understands nearly any sentence you write, but it has no world behind the text. The map, your inventory, and the locked door exist only as words earlier in the chat. Most of this guide is about putting some of that world back.

AI roleplay and a text adventure overlap, but they aren’t the same game. In roleplay you write a story with characters, and our guide to how to roleplay with AI covers it. A text adventure adds a goal, obstacles, objects that matter, and the chance to fail.

Why a chatbot makes a weak text adventure on its own

A chat model writes each reply from the text of the conversation so far. That is enough for a story, but a game needs facts that stay true whether or not anyone mentions them. Four problems follow.

It loses track of the world

Keeping a world consistent is hard for language models, even when they’re given the facts. Ruoyao Wang and colleagues tested GPT-4 as a text game engine at ACL 2024. They gave it the full game state, the rules, and one action, and asked what the world looks like afterward. For steps where something in the world really changed, its accuracy did not exceed 59.9%. Changes the world makes on its own, such as a sink filling a cup with water, were the hardest to get right. The authors concluded that language models are “not yet ready to act as reliable world simulators.”

In a chat game nobody hands the model the state each turn, so a mistake in one reply can carry into the next. Chen Feng Tsai and colleagues had ChatGPT read the first 70 steps of a Zork walkthrough and then asked where various moves would lead. On routes it had seen, it was right 75% of the time for one move. On the same routes walked backward, it was right 29% of the time for one move and 10% for two. When they asked it to recall the game’s walkthrough, it put a brass lantern in the mailbox, where the real game has a leaflet.

The same thing shows up in play. When Ars Technica’s staff tested AI Dungeon 2 in January 2020, one writer typed inventory early on and had no revolver. A few turns later, the game had the character “grab your revolver” and shoot an attacker. Models have improved a great deal since that GPT-2 game, but the cause is the same: nothing outside the text says what you’re carrying.

It accepts whatever you type

Chat models are trained to be helpful, and they tend to go along with the user. Mrinank Sharma and colleagues found that AI assistants “consistently exhibit sycophancy” (ICLR 2024). In a game, that means a locked door opens because you said you kicked it in, and a guard lets you pass because you claimed to have a pass. Nicolai Hejlesen Jørgensen and colleagues at Aalborg University saw this in their own AI game master: “Player actions that contradicted or bypassed core story events were often accepted uncritically by the AI GM, leading to incoherent plotlines and disrupted pacing” (IUI 2026). When every action works, your choices stop mattering. Our guide to stopping AI from agreeing with everything covers the same problem in stories.

It makes up the puzzle as it goes

A puzzle needs an answer that exists before you start looking. A chat model doesn’t keep one. Murray Shanahan and colleagues showed this with twenty questions in a 2023 paper in Nature: a model asked to think of an object “will not randomly select an object and commit to it for the rest of the game, as a human would (or should).” It answers each question so that it fits the earlier ones. A puzzle in a chat game works the same way. Unless the solution is written somewhere the model can see, any plausible attempt may work, or the answer may shift while you search for it.

It plays your part and fills the screen

Chatbots also tend to write too much. They describe what your character does next, give long scenes when you wanted one result, or end each reply with a numbered menu of choices. A menu turns the game into a gamebook, the format Edward Packard’s Choose Your Own Adventure series made famous from 1979, and you lose the freedom to try something nobody listed. Our guides to stopping an AI from speaking for you and making replies shorter cover both problems in detail. If you’d rather pick from a menu, our guide to choose-your-own-adventure stories with AI covers that kind of game.

A text adventure prompt you can copy

This prompt builds the fixes in this guide into the game’s rules. It’s written for ChatGPT, Claude, Gemini, or Grok. Put it in a project’s instructions or a Gem if you can, so it applies to every reply, or paste it as your first message. Replace each bracket, and leave the optional adventure file out if you don’t have one yet.

Run a text adventure for me. You are the game: you describe the world, play every other character, and decide what happens. I play one character, and only I decide what my character says, does, thinks, or feels.

Setting: [where and when, in two or three sentences]
My character: [name, one line about who they are, and what they carry at the start]
Goal: [what my character has to do, and what counts as winning or losing]
Tone and difficulty: [for example: eerie and tough, or light and forgiving]

Each turn:
- I type an action. Describe only what happens as a result, in one to three short paragraphs, then stop and wait.
- When I arrive somewhere new, give the place's name, what stands out, the exits, and the objects I could use. Save finer detail for when I EXAMINE something.
- Never write my character's words, actions, thoughts, or feelings.
- Don't offer a list of choices. If I type HINT, give me one small hint.

Rules:
- I can use only what is in my inventory or in the current location. If I claim something I don't have, tell me so.
- If an action is impossible, say why, in the world.
- If an action is risky, tell me the risk and ask me to roll a d20. I'll tell you the number. 1–7: it fails. 8–14: it works, at a cost. 15–20: it works.
- A failure changes the situation: something breaks or is lost, someone notices, or time runs short.
- Warn me before anything that could kill my character or make the goal impossible.
- Every obstacle has a solution that uses things the story has already shown me. Once you describe how something works, it keeps working that way. Accept other sensible solutions if the world allows them.
- If an adventure file is included below, follow it and never reveal what it says about solutions.

Commands I may use: LOOK, EXAMINE [thing], INVENTORY, MAP, HINT.

End every reply with this status block, updated:
Location:
Inventory:
Condition:
Goal:
Turn:

[Optional adventure file: paste it here.]

Here is how the brackets might look for a short adventure:

Setting: Gull Rock, a lighthouse on a tidal island in 1890. The light went dark last night, and the keeper hasn't answered the signal flags.
My character: Wren Halloway, the harbor master's apprentice, sent out in a rowboat with a lantern, a coil of rope, and a tinderbox.
Goal: relight the lamp before the supply ship rounds the point at dawn, and find out what happened to the keeper. If the ship hits the rocks, I lose.
Tone and difficulty: eerie and tough.

What each rule is for

The status block is the game’s memory. It puts the facts that matter at the end of every reply, where the model reads them again before its next turn and where you can check them. The next section covers it.

The inventory rule and “say why, in the world” give the game the power to refuse. Graham Nelson’s The Craft of Adventure (1995), a guide to designing adventure games, lists the player’s right “To have a good reason why something is impossible.” A refusal with a reason in the story, such as “the hatch is rusted shut from the inside,” tells you something about the world.

You roll the dice because a chat model can’t be trusted to roll honestly. It writes a number that fits the story, and the agreeable streak described above can make that number generous. Our guide to using ChatGPT as a dungeon master explains this and suggests dice apps. The middle result, success at a cost, comes from the tabletop game Blades in the Dark, covered below.

The warning rule and the solution rule come from the design advice in the next sections. The ban on menus keeps the game open: you can still type HINT when you’re stuck.

Compare this with “Text Based Adventure Game,” a prompt from the awesome-chatgpt-prompts collection on GitHub that starts: “I want you to act as a text based adventure game. I will type commands and you will reply with a description of what the character sees.” It gives the AI no goal, no state to track, and no rules for failure, so the model improvises all three on every turn.

Keep the game’s state in every reply

A status block is a short list of facts the AI rewrites at the end of each reply. It does the job the old game programs did with their variables: it keeps the state of the world written down. MakeUseOf’s 2023 guide to playing an RPG in ChatGPT recommends showing the game state in every reply because “ChatGPT has a habit of forgetting things.”

A status block for the lighthouse game might read:

Location: Keeper's cottage
Inventory: lantern (lit), rope, tinderbox, keeper's logbook
Condition: soaked to the knees, unhurt
Goal: relight the lamp before dawn; find the keeper
Turn: 9

Keep the block short. Every line is sent back to the model with every later reply, so a block that lists twenty stats takes room that the story needs. Our guide to why AI characters forget explains how that space runs out.

You are the final authority on the block. Read it after every reply. If the AI adds an item you never picked up or drops one you have, correct it at once, before the mistake becomes part of the story: (OOC: I don't have a key. Inventory is lantern, rope, tinderbox, logbook.) Our guide to what OOC means covers these notes. Corrections work best early; a wrong fact that sits in the chat for twenty turns is harder to remove.

Describe places the player can act on

In a text adventure, the description tells you what you can do. Emily Short, an interactive fiction author and designer, put it this way: “all text in interactive fiction is at least potentially a direction to the player.” A line such as “Something glints at the bottom of the lake” tells you to look closer. Chatbots tend to write long, moody descriptions in which the exits and the useful objects are hard to find.

Ask for the classic format: the place’s name, a few lines on what stands out, the exits, and the objects you could use. Fuller detail comes when you EXAMINE something. Short calls this a willingness to foreground “the functional aspects of an object.” An illustrative room in the lighthouse game:

KEEPER'S COTTAGE
One cold room. The stove is out, and the table is set for one, the meal untouched. A logbook lies open beside the plate. Wet boot prints lead to a trapdoor in the floor. A door to the north opens onto the lighthouse stair; the path back to the jetty is to the south.

Every object in that description is something you might use or examine, and every exit is named. If the AI’s descriptions bury the exits, add a line to your prompt such as “List the exits at the end of every location description.”

Puzzles that play fair

A fair puzzle can be solved from what the game has shown you, and its answer makes sense once you find it. Adventure game designers wrote down how to build puzzles like that long before AI, and their rules carry over to a chat game.

Ron Gilbert wrote “Why Adventure Games Suck” in 1989, while designing The Secret of Monkey Island. His worst offender is the backwards puzzle, which “occurs when the solution is found before the problem.” You should find the crevice before the rope that lets you climb down it, so that when the rope appears you know what it’s for. He also asks that “Puzzles should advance the story” and that the player always knows the goal and the next step toward it.

Graham Nelson’s “Bill of Player’s Rights” in The Craft of Adventure adds more: “Not to be killed without warning,” “To be able to understand a problem once it is solved,” “Not to have to type exactly the right verb,” and “Not to be given too many red herrings.” A chatbot already handles the verb problem, since it understands any wording. The other rights depend on how the puzzles are built.

Emily Short’s list of puzzle styles includes games where “many or even most puzzles in the game offer more than one viable solution,” which works best when the game models the world closely enough to accept “solutions which haven’t even occurred to the author.” This is where an AI can do better than the old parsers. It can recognize a clever plan nobody wrote down, as long as it judges the plan by the world’s rules. Tying the rope to the railing to climb down the cliff can work even if the adventure’s design never mentions it, and trying to light a soaked tinderbox should still fail.

In the lighthouse game, a fair puzzle might look like this. You find the lamp dry: that’s the problem. The logbook says the oil store floods at high tide, and the store is underwater when you reach it. You can wait for low tide and lose hours, or search the cottage and find the trapdoor to a cellar where the keeper kept a spare can. Both solutions use things the game has shown you, and they cost different amounts of time.

Settle the solutions before you play

The AI can only keep a solution fixed if it’s written down somewhere the model reads on every reply. You have three ways to do that, the same three our murder mystery guide describes for a culprit.

  1. Use an adventure file from a second chat. In a separate chat, ask for an adventure design: six to ten locations, the objects in each, the obstacles between the player and the goal, and how each can be overcome, with the solutions at the end. Paste it into the prompt’s adventure file slot without reading the end. It’s a little spoiled, but the game will hold together.
  2. Have the AI write the file in code. Ask the game to write its design in its first reply in a form you can’t read at a glance, such as Base64, and keep it in the chat. The mystery guide explains how, and why you should decode it at the end to check that the AI kept to it.
  3. Play without fixed solutions. Keep the prompt’s rule that every obstacle uses things the story has already shown, and accept that the AI improvises within it. This plays more like a story with obstacles than a puzzle game, and many players like it that way.

Make failure count

Failure gives your choices weight, but losing without warning feels unfair. Andrew Plotkin, an interactive fiction author, sorted games by how they treat mistakes in a scale first posted in 1996. It runs from “Merciful: cannot get stuck” to “Cruel: can get stuck by doing something which isn’t obviously irrevocable (even after the act).” In between, a “Polite” game lets you get stuck or die, “but it’s immediately obvious,” and a “Tough” game makes it obvious that “you’re about to do something irrevocable.”

For a chat game, Polite or Tough works best. You can’t reload a save the way you could in Zork, so the prompt asks the AI to warn you before anything fatal. Gilbert’s rule says the same: “danger should be survivable if the player is clever.”

Most failures should change the situation without ending the game. Blades in the Dark, a tabletop game by John Harper, builds this into its dice: a character “might succeed at their action without any consequences (on a 6), or they might succeed but suffer consequences (on a 4/5), or it might just all go wrong (on a 1-3).” The prompt’s three bands on a d20 work the same way. Ironsworn, a free solo tabletop game, gives a simple rule for a failed roll: “Make the most obvious negative outcome happen.” If you fail to climb the wet rocks, you fall and soak the tinderbox, and now you need another way to make fire.

Our guide to playing D&D solo with an AI game master covers oracles and more ways to keep an AI from going easy on you.

Commands that still work

You can type full sentences, but the old commands are short and the AI understands them:

Most apps also give you an undo. You can regenerate a reply you don’t like, or edit your last message and send it again. Use it for mistakes, such as the AI misreading your action, and decide before you start whether you’ll use it to escape bad rolls.

Save a long adventure and come back to it

A long game fills the model’s context, and the oldest turns get cut or summarized, so the AI starts to forget the early rooms. Play in sessions instead. At the end of each one, ask for a short summary of what has happened, and copy it with the latest status block into a note.

To continue, start a new chat with the prompt, the adventure file if you have one, the summary, and the status block. Our guide to writing a chat memory summary has templates for the summary.

Text adventures in character apps

Character apps can run a text adventure through a narrator bot: a bot that plays the world, not one person.

Apps built for AI text adventures

Several apps are made for this kind of game, as of December 2026. They differ most in whether the app tracks the world itself or leaves it to the AI’s text.

Our page on alternatives to AI Dungeon compares these and more.

Common questions

Can ChatGPT run a text adventure?

Yes, with a prompt that gives it a goal and rules. Without one, it tends to forget your inventory, let any action succeed, and invent puzzle answers. The prompt above, a status block in every reply, and dice you roll yourself fix most of that. Claude, Gemini, and Grok work the same way.

What is a good text adventure prompt for AI?

One that sets the world, your character, a goal, and a way to lose, and asks for a status block in every reply. It should forbid the AI from writing your actions and from offering numbered choices. The prompt in this guide covers all of these.

Is there a free AI text adventure?

Yes. The prompt in this guide works on the free tiers of ChatGPT, Claude, and Gemini. Perchance AI RPG is free in the browser with no account, and AI Dungeon has a free plan.

Can I play Zork with ChatGPT?

You can ask it to act as Zork, but you’ll get an imitation built from its memory of the game, and that memory is unreliable: in Tsai and colleagues’ test, it placed a brass lantern in the mailbox. To play the real game, note that Microsoft released the source code of Zork I, II, and III under the MIT License on November 20, 2025. You can compile it with ZILF and play it in a Z-machine interpreter, or buy The Zork Anthology on GOG.

Why does the AI forget my inventory?

Nothing outside the chat text records it, and the model rebuilds the world from the text on every reply. Ask for a status block with your inventory at the end of every reply, check it, and correct mistakes at once.

How do I stop the AI from giving me numbered choices?

Add a rule to your prompt: “Don’t offer a list of choices. End each reply when it’s my turn.” If you want help when you’re stuck, give yourself a HINT command, as the prompt in this guide does.

Long adventures in Lunelle AI

Lunelle AI has adventures you play in your own words, and you can create your own with its chat-based creator. Characters remember events and your choices across sessions. It has no dice, stats, or inventory, so keep your status block and roll dice outside the app. See long-term memory for long adventures.

Sources

Research

Game design

History, apps, and tests