AI DRIVEN HAUNTED MANSION
Room
The mansion stirs
>
Commands
Movement
go [direction]north, south, east, west, up, down
Interaction
talk [npc]start a conversation
give [item] to [npc]offer an item to someone
take [item]pick up an item
examine [item]inspect something closely
open [item]open a container
use [item]use an item
bribe [npc] [N]offer N gold to an NPC
Combat
attack [enemy]attack a target
fleeattempt to escape
Inventory
inventoryshow items and stats
equip [item]equip a weapon or armour
unequip [item]remove equipped item
Other
lookredescribe the room
roomshow room summary
quitend the game
⚗ Ritual of Unmaking — How to Win
Strange Amulet
Unmaking Flame
Blood Pact
⚗ Cheat & Debug Panel
Debug Commands
wintrigger the win condition
roomprint current room summary
goto room_Xteleport to any room (e.g. goto room_5)
cheat killinstantly defeat current monster (in combat only)
clearmemorywipe all NPC memory embeddings
— ✦ —

🪙

⚰ THE MANSION GOES DARK ⚰

The candles flicker and die. The spirits retreat into silence.

It appears the developer has run out of OpenAI credits.
Again.

(Yes, he knew this would happen. No, he did not top up his account.
He is, by all accounts, extremely cheap.)

Refresh the page once the developer has located his wallet.

About This Game

This is an experimental playground to explore how contemporary AI technologies can elevate the way video games are designed and experienced.

— Winston Churchill

View on GitHub

AI Techniques:

  • NPC Memory (RAG): NPCs remember past conversations and facts about you using vector embeddings stored in Pinecone, retrieved via HyDE-rewritten semantic search.
  • Emotional State: Each NPC tracks mood and fear independently, scored by GPT-4o-mini after every message and injected as system-level behavioural overrides.
  • Gossip Network: Facts you share propagate through a social graph — GPT-4o-mini filters gossip-worthy information and pushes it to connected NPCs' memory, so they can reference what you told someone else.
  • Gossip Emotional Impact: Rumours an NPC has heard about you shift their mood and fear before your first word — arriving with a bad reputation has consequences.
  • NPC Knowledge Graph: NPCs have structured knowledge of other characters, monsters, and items — including private suspicions not visible to the player — authored per NPC in a data file.
  • Conversation Openings: NPCs greet you when you approach using a live LLM call that factors in their mood, fear, and memory of past interactions.
  • Intelligent Shop: Merchants use agentic tool-calling to process real transactions in character.
  • Web Search: The Oracle uses a ReAct-style tool-calling loop to decide autonomously whether to search the web before replying.
  • Streaming Output: LLM responses stream token-by-token to the browser so text appears as it is written.
  • Natural Language Commands: All interactions are parsed and understood through GPT, not keyword matching.
  • Dynamic Routing: The entire game is a LangGraph state graph that intelligently routes between exploration, combat, dialogue, and more.