GitHub repo

Dungeon Mystery

Dungeon Mystery

type

Game Design

made with

JavaScript, Deno,
OpenAI API

date

October 2024

An ode to the original Rogue, Dungeon Mystery is an AI-driven terminal game that offers a completely new story and characters each time the game is played.

the original rogue

Published in 1980, Rogue is a dungeon-crawler video game that inspired Dungeon Mystery. It differed itself from its contemporaries by being completely procedurally generated: no game is ever the same.

the ultimate rogue-like?

I took Rogue’s original idea and amplified it by creating a terminal game that’s completely automatically generated. The story's plot, characters, and overall mystery are all AI-generated, and never the same.



1980s aesthetics

Although Dungeon Mystery uses cutting-edge technology (AI), the interface is intentionally old-school, following the design of 80s terminal games and the original Rogue.

the game

Dungeon Mystery follows a very simple structure: there are five chambers in the dungeon, each of them with one character and a locked door to the next chamber. The player must interact with the character—who has a specific mission for the player, be it a riddle or a question about what the player has learned so far—to gain their trust. Once the character’s trust is gained, the character will give the player the key to the next room.

code structure

When a new game is loaded, ChatGPT will create the structure for the game through a structured output where it describes the game’s overall plot as well as details about each character. Every character has access to the basic information about the game and themselves, as well as a chat history. I leveraged ChatGPT’s Function calling capabilities to implement the trust score feature: every time the player answers something, the AI will decide whether the trust level increased, decreased, or remained the same—and call the appropriate function.

walkthrough

This is an example playthrough of the game. To play it yourself, feel free to clone my repo on GitHub!

link to GitHub repo