Soga123Field notes on AI game generators
Last count 15 Nov 2026
中文
04Prompting and building · 9 min read

RPG Prompting: Quests, Dialogue, World State

Four slots, one state object, and the reason an RPG that looks fine goes silent at minute three.

Published 2,237 words By

Three scenes in, the gatekeeper asks your name again. You told him ten minutes ago, at the gate, on the way in. The quest you finished is not in the log. The brass key you picked up is gone.

Nothing crashed. The prose is fluent, the first scene was genuinely good, and the game has no idea any of it happened.

That is the failure mode specific to RPGs, and it is not a writing problem. A platformer prompt describes a loop; an RPG prompt has to describe a memory. When a level ends in a platformer, nothing has to survive except a score. When a scene ends in an RPG, the game has to remember who was present, what was said, which door is now unlocked, and whether the player already knows the name of the thing they are about to be told. If your prompt never states what gets remembered, the generator does not invent a memory system. It builds one scene, then another scene, and the second one has no idea the first one happened.

Four slots decide whether that happens: the state object, the quest states, the knowledge boundary, and the reset policy. Every one of them is invisible in a screenshot, and none of them are covered by the genre's own marketing.

Why RPG prompts fail differently

Platformer failures are visible. The jump is too short, the dog kills you, the score does not add up. You see it in ten seconds and you can point at it.

RPG failures are silent. The game boots, the prose is fluent, the first scene is genuinely good — and then an NPC introduces himself for the third time, the quest log is empty even though you just finished the quest, and the key you picked up two scenes ago is gone. Nothing crashed. The game simply has no place to put what happened.

The mechanism is not mysterious. We ran a 34-word platformer prompt through an AI game generator and read all 388 lines it produced. Three levels, lives, score, a win screen — all present, all working. The state in that build is a handful of module-level variables sitting next to each other near the top of the file: let lives = 3 immediately beside let score = 0, with the level data in a LEVELS array at lines 59–63. That is a perfectly reasonable design for a game where each level is rebuilt from LEVELS[i] and nothing needs to survive the transition.

Point the same architecture at an RPG and it becomes the bug. If the scene is rebuilt on entry and the only persistent values are two counters, then everything a player would call "the story" lives in variables that were never declared. We have not run an RPG prompt through a generator, and we are not going to describe one as if we had. What follows is a reading of the mechanism plus outside evidence, not a test log.

What this search result is actually selling

Pull the top results for ai rpg generator and read the titles side by side instead of one at a time. We captured the SERP on 25 October 2026; of the eight results, six are products for playing an RPG rather than making one, and the three that describe themselves most specifically all promise the same single capability:

  • one leads with "with Memory & Multiplayer Co-Op"
  • one leads with "Games That Remember Your Choices"
  • one leads with "unlimited"

Read individually, those are adjectives. Read in a row, they are a confession: the only thing this category competes on is whether the game remembers. Nobody advertises generation, because generation is now the baseline. The differentiator moved to memory.

That is useful in two directions. First, it tells you what a searcher for this term has already been taught to expect — they are not asking "can AI make an RPG", they are asking whether the thing will hold together. Second, it shows the gap: memory is sold as a runtime feature inside each product, and none of these pages explains how to specify memory in a prompt so that it survives an edit, a rebuild, or a move to a different tool. That part you have to write yourself.

How to make an RPG with AI?

Start with state, not story. Story is the part a model is already good at; state is the part it will skip unless you make it structural. Four slots cover it.

SlotWhat to stateWhat happens if you leave it out
State objectThe single object that holds everything that must survive a scene change, and its exact fieldsState scatters into loose variables, so there is no defined boundary between "remembered" and "rebuilt"
Quest statesThe status values a quest can hold (idle / active / done / failed) and what event moves it between themQuests collapse into a single "accepted, therefore complete" flag
Knowledge boundaryWho knows what, and who is forbidden to say whatEvery NPC knows everything, and the model's own personality leaks into all of them
Reset policyThe only conditions under which state is allowed to clearYou get either amnesia on every scene change or a game that can never be restarted cleanly

The order matters. State first, because the other three are rules about that object. If you write quests before you have named the container, the quest flags end up as their own globals and you are back to scattered variables.

The four slots as one prompt

This is the shape we would use. It is written for a text RPG because text is where the memory problem is most visible — there is no art to distract from a character forgetting your name.

A text-based fantasy RPG in a single screen, no graphics beyond a title card. The player types actions; the game answers in prose.

Keep exactly one state object named game, and put everything persistent inside it: scene (current location id), inventory (array of item ids), flags (named booleans for world changes), quests (one entry per quest with status idle, active, done or failed), and log (the last ten events, one line each).

Every player action must read from game and write back to game before any response is printed. No scene may keep its own copy of a value that already exists in game.

Never reset game except on an explicit restart command typed by the player.

Three locations: the gate, the market, the crypt. The crypt door stays locked until flags.cryptUnlocked is true, which is set only by giving the gatekeeper the brass key.

Two NPCs. The gatekeeper knows about the key, the gate, and the road, and must not discuss the crypt. The merchant knows prices and rumours and must not know the player's name until flags.metMerchant is true. Neither may state a fact that is not in their own knows list.

The brass key starts in the player's inventory. If the player drops it, flags.cryptUnlocked must not stay true.

After every action, print the current quest statuses in one line.

Four things in that prompt are load-bearing, and none of them are about prose:

  1. "No scene may keep its own copy" is the anti-scatter rule. Without it, a scene will happily hold a local hasKey that goes out of scope the moment you leave.
  2. flags.cryptUnlocked is a flag, not a door object. A boolean in a known place can be checked by anything. A door that owns its own state cannot be inspected from the quest logic.
  3. The knows lists are negative instructions. Telling a model what a character knows is weak; telling it what a character is forbidden to say is what actually holds a boundary.
  4. The key clause is the one that catches the most common RPG state bug: a flag that gets set and never unset. Dropping an item has to be able to undo what picking it up did.

What the code looks like when you do not ask for it

Go back to the 388-line platformer and look at how its state is shaped. Three separate module-level variables, declared side by side, with no container and no naming convention that says "these are the things that persist." The HUD hardcodes the level total as /3 at line 349 while the game loop uses LEVELS.length — two sources of truth that agree today and split the moment a fourth level is added.

Nothing about that is a bug in a platformer. It is a bug in an RPG, because in an RPG you need to answer a question that scattered variables cannot answer: which of these values is supposed to survive a scene change, and which is supposed to be rebuilt?

Loose variables have no boundary. So when an NPC forgets you, you cannot tell whether the state was never written, was written and then rebuilt, or was written somewhere the next scene does not read. All three look identical from the player's chair, and all three have different fixes. A named state object does not prevent the bug, but it makes the bug findable — you can log it, diff it, and check it after every action.

That is the practical argument for putting state first in the prompt. Not correctness. Diagnosability.

Where it still breaks

Four reports from people building text RPGs, collected from Hacker News threads and quoted as written. They are the reason a well-specified state object is necessary but not sufficient.

DateWhoWhat they saidWhich slot it hits
2026-01-14cubefox"it's hard to develop robust puzzles and interactions, because it's hard to control and predict what the LLM will do in a dialogue setting"Reset policy — behaviour you cannot predict is behaviour you cannot scope
2025-10-17kqr"it's a problem LLMs invent details: which details are implemented and which are left out is an important part of how the implementer of a text adventure communicates to the player what sort of interaction they should pay attention to"Knowledge boundary — the model invents a door that does not exist, and the player keeps pushing it
2026-08-19code_biologist"The personality of the underlying model persists even if you're able to alter surface tone enough for your needs"Knowledge boundary — every NPC ends up sounding like the same assistant
2026-09-02vintermann"The AI Dungeon 2 'storyteller' would regularly 'lose patience' with its users and roast them or even 'hang up' on them"Reset policy — the narrator itself is an unhandled failure mode

Read together, the four point at one conclusion: the hard part of an RPG is not generation, it is holding state and holding boundaries. Both are things you specify, not things you hope for. And both degrade quietly, which is why an RPG that feels fine for two minutes can be unsalvageable at ten.

A five-line check before you generate

Read your prompt and answer these. Any "no" is a slot the generator will fill for you.

  • Is there one named object that holds everything persistent, with its fields listed?
  • Does every quest have more than one status, and does something move it between them?
  • Does each character have a knows list and a forbidden list?
  • Is there exactly one condition that clears state, and is it typed by the player?
  • Can picking something up be undone by dropping it?

FAQ

Can AI make RPG games?

Yes, and the constraint is not the genre. Generators produce scenes, dialogue and quest text well. What they do not produce by default is a persistent state layer, because nothing in a one-shot prompt asks for one. Ask for the object explicitly and the same tool behaves very differently.

Do I need a different tool for RPGs than for other genres?

Not necessarily, but you should check one thing before committing: whether edits preserve state definitions. If an iteration rewrites your state object without telling you, every quest flag you set up is silently invalidated. Test that on the free tier before you build anything long.

Why do my NPCs keep forgetting things?

Almost always because there is nothing to remember with. The scene is rebuilt on entry, the only surviving values are a couple of counters, and the rest of the story lives in variables that were never declared as persistent. The fix is a state object and an explicit write-back rule, not a longer character description.

Does a bigger model fix this?

No. A bigger model writes better prose inside the same broken structure. The failure is architectural — where the values live — and no amount of model quality changes where a value lives.

Is it legal to publish an RPG made this way?

That is a separate question about terms rather than engineering, and it deserves its own answer. What matters here is narrower: whatever the terms say, they cannot restore state your build never stored.

What if I only get one free build?

Spend it on the state definition, not the story. Story you can rewrite by hand in an afternoon. A missing state layer means rewriting the whole build, and the free tier will not be there for the second attempt.