Trying to build a text-based, AI powered RPG game where your stats, world and condition actually matter over time (fixing AI amnesia)
By Holidays in Europe / March 24, 2026 / No Comments / Uncategorized
Creating an Immersive, AI-Driven Text-Based RPG: Overcoming Memory Limitations and Enhancing Gameplay
In the realm of interactive storytelling and gaming, my colleague and I have long been fascinated by the potential of AI-powered role-playing games (RPGs). Our journey began with a shared experience: playing a text-based RPG powered by Gemini, an AI model that served as both the game engine and game master. We crafted prompts that defined the game environment, devised intriguing scenarios, and then adopted the roles of players while Gemini generated responses. This setup was engaging—yet, it had notable limitations.
The Challenge of AI Amnesia in Text-Based Games
After just a few turns, the game would often devolve into predictable outcomes. For instance, a player might declare, “I go into a cave and build a nuke,” and Gemini would produce a hallucinated narrative that seemed to materialize this fantastical action. While entertaining initially, the AI’s tendency to “forget” previous context, especially regarding inventory items, character states, or world conditions, diminishes long-term engagement.
Standard chatbots, including early AI models, suffer from a significant issue: amnesia. They tend to lose track of previous interactions, leading to inconsistent storylines and disconnected gameplay. This limitation becomes especially problematic in more complex RPG scenarios where persistent states, player choices, and evolving worlds are fundamental to immersive storytelling.
Reimagining AI-Powered RPGs: Separating Narrative from State
To address this, we set out to develop a more robust environment—one that maintains continuity, remembers past actions, and ensures decisions influence future events. Our core insight was to decouple the game’s narrative generation from the underlying game state.
Our Technical Architecture
-
Backend Infrastructure: We utilize modern web technologies, including Next.js for the frontend interface, PostgreSQL as our relational database, and Prisma ORM for optimized data management.
-
Game State Management: All critical information—character sheets (skills, debts, faction relationships, local rumors), detailed world state, and narrative context—is stored persistently in our database. This approach guarantees that every action, decision, or change is recorded reliably.
-
Action Resolution and AI Integration: When a player issues a freeform command in natural language, a dedicated resolver AI assesses and adjudicates this input against current world pressures—factors such as resource scarcity or unrest—that are managed by specialized AI agents. These agents operate independently to simulate different aspects of the game environment.
-
Sequential Storytelling and Narrative Generation: Only after the game state updates do various AI modules responsible for narrative and GM functions generate the corresponding story text, update inventories, and modify the world state. This layered approach ensures consistency and continuity across gameplay sessions.
The Alpha Platform: AltWorld.io
We’ve launched a small alpha version of our platform at altworld.io, and we are actively seeking feedback. Our primary focus is on evaluating the core gameplay loop—the interaction flow, UI effectiveness, and how well players understand and engage with the game mechanics. We are especially interested in insights on how to utilize AI within gaming environments without falling prey to sycophantic tendencies, where AI might overly mimic or flatter the player instead of providing genuine, consistent interactions.
Looking Ahead
Our goal is to create an AI-driven RPG experience where character development, world evolution, and state persistence matter significantly over time. By disentangling narrative from game state and leveraging a modular AI architecture, we hope to overcome the common pitfalls of AI amnesia and deliver a more immersive, coherent, and rewarding storytelling experience.
We invite developers, gamers, and AI enthusiasts to explore our alpha and share their feedback. Together, we can push the boundaries of interactive storytelling and foster the next generation of intelligent, persistent game worlds.