"Is there a game you don't have to play?" This is a famous line from the Japanese manga "Hamari-michi." It expresses the desire for a game that offers the satisfaction of playing without the effort, a sentiment I understand well.
In this day and age, let's leave the tedious tasks to AI. Better yet, since making a game is also a chore, why not have an AI create it and play it for us?
abagames
/
narrative-engine
A life simulation engine for multi-party TRPG storytelling with AI-driven autonomous gameplay and narrative generation.
Narrative Engine
[English | 日本語]
🎮 Project Overview
A project where AI creates games and AI plays them, allowing humans to watch game replays without doing anything
Narrative Engine is an AI-driven fully autonomous TRPG system. AI coding agents (Codex, Claude Code, etc.) function as both Game Master (GM) and players, executing and recording complete TRPG sessions without human intervention.
📖 Sample Replays
The following directories contain replays of TRPG sessions actually generated and executed by AI agents:
Thunder Storm Campaign (View)
-
Directory:
docs/thunder_storm_campaign/
- Content: A fully autonomous TRPG session depicting adventures in a storm
- Features: Comprehensive campaign including weather systems, environmental changes, and party coordination tactics
Eiroku Mist Chronicles (View)
-
Directory:
docs/eiroku_mist_chronicles/
- Content: A Sengoku-era campaign chronicling four rival factions navigating mist-laden provinces during the chaotic Eiroku period
- Features: Focus on multi-faction espionage, onmyōdō barrier warfare, and technological…
This Narrative Engine makes that a reality. An AI automatically generates an RPG scenario, plays it as the Game Master (GM) and players, and completes it on its own.
Of course, that would leave us with no idea of what happened in the game. To solve this, I've made it possible to view the replay in a browser. You can read a novel-style narrative of the playthrough and the corresponding playlog, so you can catch up on the game's events if you feel so inclined.
What's happening here is a re-creation of a tabletop RPG (TRPG) on a large language model (LLM). Things that were traditionally managed on paper, like character sheets in a TRPG, are converted into source code. The AI uses these as tools, offloading the numerical management that LLMs struggle with. The rulebook is then given to the LLM as a prompt, and the LLM, acting as the GM and players, proceeds with the game using these tools. The actions taken each turn and the changes in the world are recorded as a playlog, and at the end of the game, this playlog is converted into a narrative replay.
For this particular setting, instead of a single party and a GM, I opted for a format where multiple parties move and act on a world map with their own objectives. The hope was that this would lead to emergent storytelling. Indeed, I was able to observe conflicts between parties and behind-the-scenes maneuvering for victory in a courtroom. However, it's unclear whether these events arose from the active participation of multiple players within the TRPG system, or simply because the LLM playing the role of the GM worked very hard. I would like to devise a system and rules that encourage a wider variety of events to occur.
This time, I used AI coding agents like Codex and Claude Code to launch tools and manipulate files. A better approach would probably be to turn the toolset into an MCP server and use it via a chat interface, or to control the game loop with code and call the LLM's API as needed.
The model used for gameplay was GPT-5 Codex. Acting as a GM while appropriately using tools seems to be a difficult task for current LLMs, requiring a model that can straightforwardly follow complex instructions. The narrative replay generation and HTML conversion were handled by Claude Sonnet 4.0.
I believe this approach can be used to have LLMs automatically play board games and card games, or any game composed of cards, tokens, and a rulebook. By defining the rules not only through prompts but also with tools that assist in game progression and their input/output schemas, you can make the LLM adhere to the rules strictly.
The kind of operation realized this time is achieved by making numerous calls to the LLM API. Therefore, its use in general gaming will likely have to wait until inexpensive generative AI, such as local LLMs, becomes available. When that happens, advanced GMs will be able to manage games appropriately in real-time play. However, considering that the storytelling ability of even the best current models is limited, some ingenuity will be necessary, such as using it in conjunction with high-quality scenarios like a D&D adventure set.
Top comments (0)