Skip to content
/ xorc Public

A text adventure game where the world is generated via LLM

Notifications You must be signed in to change notification settings

kzsh/xorc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Xorc

A text adventure game where the world is generated via LLM. There is an underlying framework that helps organize, store and update the world.

Note:

You will need an antropic api key set in the env (ANTHROPIC_API_KEY) or you can provide one to the game. The game can store the key for future use, or keep it only in-memory for the current session.

How It Works

The game maintains a persistent world in SQLite. When you explore, the LLM decides whether paths lead to new locations or loop back to existing rooms based on distance traveled, direction, and spatial reasoning. Rooms remember what you've done in them. Time advances naturally as you move and act. Your actions can permanently change rooms, create new items, or reveal hidden passages.

Key Features

  • Rooms are created or connected on-demand by the LLM using curated context from the existing graph.
  • The game is persisted a sqlitedb
  • Some underlying systems act to constrain/inform the context: rooms, room connections, time of day, distance between rooms etc.
  • The game features a mixture of standard actions (n/s/e/w, take, inspect). The LLM can interpret custom actions and text, by mapping them to existing actions ('collect stones' -> 'take stones') or by freeform, LLM-interpreted action.

Technical Approach

When creating or updating descriptions, a selected set of context from nearby rooms, travel history, distance and time of day is used to help keep the game world consistent. The graph of locations is designed to lean on standard node/edge directions North,East,South,West, but to invent new complications based on player interaction with description and the world.

About

A text adventure game where the world is generated via LLM

Topics

Resources

Stars

Watchers

Forks