How a persistent AI game world remembers what happened

A generated description is easy. A place that still exists when the player returns—and remembers the consequences of the visit—is the harder problem. Infinite Pokémon treats generation as a proposal to a persistent game engine, not as the game state itself.

Persistence starts with authoritative state

The world server owns movement, collision, battles, inventory, progression, maps, and event history. Generated content cannot award itself a victory or move a trainer. It proposes bounded data, and the engine validates that data before publishing it.

This distinction makes a generated location durable. Its accepted map, characters, and facts enter the same saved world as ordinary gameplay. Returning to it reads the stored version instead of asking the model to recreate the scene from memory.

  • Game facts live in SQLite, not a chat transcript.
  • Published maps are reused.
  • Commands are deduplicated so retries do not duplicate rewards.

Context is selected, versioned, and checked

Before generating a frontier block, the server writes an immutable snapshot containing the destination, nearby places, selected player state, relevant history, and dependency hashes. The prompt is deliberately smaller than the entire adventure.

When a proposal returns, the server checks its schema, run identity, snapshot identity, dependencies, target state, and compiled geometry. A valid response can still be creatively weak, but stale or structurally unsafe output does not silently become canonical.

Branches create different futures

A checkpoint is an immutable database snapshot. Continuing from an earlier checkpoint creates a new run with its own world identity, history, NPC memories, and future generation context. Events that happened later in the original run do not leak into the branch.

That model gives “memory” a concrete meaning: the AI sees a bounded projection of the branch that is actually being played. It also makes the limits explicit. Long-term narrative coherence still needs evaluation; persistence alone does not guarantee a good story.

Continue reading

Editorial basis: written from the project’s implementation, tests, and versioned documentation with assistance from OpenAI Codex. Claims are limited to the current prototype.