Built an AI dungeon master using GPT-4o with memory
Mike TorresFeb 5, 2026
I built AI Dungeon Master — a text-based RPG powered by GPT-4o with persistent world state and character memory.
Key features:
The trick to consistency is feeding a compressed world state as context:
{
"location": "Dark Forest - clearing near the river",
"time": "dusk, day 3",
"party": [
{"name": "Elara", "class": "ranger", "hp": 24, "status": ["poisoned"]}
],
"active_quests": ["Find the missing merchant"],
"recent_events": ["Defeated 3 goblins", "Found mysterious map"]
}
The world model gets updated after each turn using structured outputs. Users are loving it — average session is 45 minutes!
6.1k views37 replies124 likes
Log in to reply to this topic.