DEV Community

Cover image for Eternal Hunt: Building an AI-Powered Text-Based Thriller Game with the OpenAI Agents SDK
Steven Wallace
Steven Wallace

Posted on

Eternal Hunt: Building an AI-Powered Text-Based Thriller Game with the OpenAI Agents SDK

🎮 Eternal Hunt is a text-adventure thriller narrated entirely by an AI agent.

🧠 Built with Python, FastAPI, Gradio, and the OpenAI Agents SDK.

💾 Repo: github.com/swallace100/thriller-game-ai-agent


The Idea

As a software engineer living in Tokyo, I wanted to qualify for game-dev roles here if the right opportunity came up.
But most studios want to see that you’ve actually shipped a game.

So I decided to make one myself by combining game design with my other goal of building AI-powered tools.

That project became Eternal Hunt, a thriller text adventure narrated completely by an AI agent.


The Premise

The player lives in New York and carries a rare genetic mutation that grants them an unusually long lifespan. They can live for hundreds, maybe thousands, of years.

When a dying billionaire learns this secret, he’s determined to obtain it by any means necessary.

The player interacts only with the Narrator Agent, an AI storyteller who guides the player and manages the experience.


Two Agents: Narrator & Researcher

Eternal Hunt runs on the OpenAI Agents SDK and features two cooperating agents:

  • Narrator Agent — Handles dialogue, story logic, memory, inventory, and user interaction.
  • Research Agent — Queries the web in real time and feeds results back to the narrator to keep scenes grounded and current.

The user never interacts with the researcher directly.

Instead, the Narrator Agent can call a custom tool and ask the Research Agent for information whenever it needs real-world data to build the next scene.


Interfaces & Player Systems

The game can run in either a Gradio or Streamlit interface. These are simple chat boxes that work in light or dark mode.

Behind that minimal UI is a full game system:

  • Inventory Tool — lets the Narrator add and remove items from the player’s inventory.
  • Persistent Saves — every action is written to a JSON file so the player can pick up where they left off.
  • Memory Logs — internal context for the Narrator, plus an external save for the game state.

This structure lets the AI maintain continuity while feeling dynamic and alive.


The Challenges

Selective Memory

Sometimes the Narrator decides an event or item isn’t important enough to save.

The player picks up a spoon, later tries to use it… and the AI says it doesn’t exist.

That inconsistency breaks immersion fast.

Breaking Immersion

Early builds would gleefully announce tool usage:

“I just called add_item_to_inventory()! Your item is now in your inventory!”

Adding a simple instruction never mention internal tools fixed it.

Pacing & Tension

The AI’s writing was technically solid but often lingered too long in scenes.

A thriller needs motion. I’m still tuning prompts and constraints to balance detail with momentum.


Architecture Overview

Layer Tech
Frontend Gradio + Streamlit
Backend Python + FastAPI
Agents OpenAI Agents SDK
Persistence JSON state files + memory log
Custom Tools Inventory management, world event tracking, environment logic

Everything is modular. New agents or UI layers can be dropped in easily.


What I Learned

  • Agents follow structured instructions well, but you have to test their edge cases.
  • Small behavioral tweaks, like telling them what not to say, make a huge difference.
  • Two cooperating agents can feel surprisingly coordinated. Adding an Enemy Agent or Orchestrator Agent could take this further.

AI-based text adventures can scale quickly in complexity.

I'd like to see a multi-agent storytelling systems where narrators, enemies, and assistants interact dynamically.

I’m not sure if major studios would count this as a released game, but maybe it’s enough to get me a spot developing Death Stranding 3. Stranger things have happened.


Project Link

Repo: github.com/swallace100/thriller-game-ai-agent

Screenshots, architecture diagrams, and dev logs are all there.

If you experiment with AI storytelling, feel free to fork it and try your own narrator style.


Top comments (0)