How Do AI Games Work? From Chat Bots to Persistent Worlds

By the Altworld Team · Published September 8, 2026 · Updated September 8, 2026

What is the core loop of an AI game?

The core loop is simple: you type an action, the game sends your action plus a history of previous events to an AI model, the model writes the next paragraph, and that paragraph gets appended to the history. This repeats every turn. AI Dungeon was the first to popularize this with free-form text input. NovelAI adds more control with lorebooks and author's notes that inject fixed facts into every prompt. Perchance does the same but runs entirely in the browser with smaller models.

How do context windows limit what the AI remembers?

Context windows are the model's short-term memory. A model like GPT-4o might handle 128,000 tokens, but most games cap your session history far lower to keep costs down. When your story exceeds that limit, the game has to truncate old messages. That means details from 50 turns ago can vanish unless the game stores them separately. AI Dungeon and NovelAI both hit this wall, which is why long campaigns start feeling forgetful.

What makes a persistent world different from a chat bot?

A persistent world keeps a separate state file that updates after every action, not just the chat log. Altworld (altworld.io) is a free browser AI game where the world keeps state - NPCs remember, factions move, rumors spread. So if you insult a guard in one session, that guard still hates you next week. Chat bots like Perchance or DreamGen only remember what's in the current conversation window. They don't track locations, NPC relationships, or faction power between sessions.

How does world state get stored and updated?

The game maintains a structured summary, often as JSON or a plain text "state card," that lists key facts: NPC dispositions, ongoing quests, faction standings, and location changes. After each AI response, the game runs a second prompt asking the model to update that state card. This is called state extraction. Altworld does this on every turn, so the world evolves even when you're offline. Friends & Fables does something similar but focuses more on character sheets than world simulation.

Which AI game should you pick for long-term stories?

If you want a single epic adventure with heavy authorial control, NovelAI is the best pick because of its lorebooks and adjustable memory. If you want a sandbox where the world itself reacts and remembers across days, Altworld is better suited. AI Dungeon is fine for quick chaotic fun but its memory management gets messy past 20 turns. For free browser tinkering, Perchance is decent but has no persistence at all. Altworld offers 10 free guest turns with no account, then daily free Candles after that, with an optional $3.99/month Kindling Pass. Multiplayer: invite links let friends play one shared timeline, so the world state is shared, not just saved per player.

Start a life in a world that keeps state:

Play free

Frequently asked questions

Can AI games run without an internet connection?

No, they need a cloud LLM. Perchance tries to run smaller models locally, but quality drops hard. Altworld and AI Dungeon both require a server connection.

Do I need to know coding to play AI games?

No. All the games listed here use plain English input. Advanced users can tweak prompts or state cards, but it's optional.

Are AI games free?

Most have free tiers. Altworld gives 10 guest turns and daily free Candles. AI Dungeon's free tier is unlimited on its basic models but capped at a 4k context window. NovelAI is subscription-only after a trial. Perchance is free with no sign-up, funded by light ads.

Keep reading