Date
October 2024
Type
generative game design
Made with
JavaScript, Deno, OpenAI API
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.
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.
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.
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.
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.
This is an example playthrough of the game. To play it yourself, feel free to clone my repo on GitHub! But please keep in mind that the game is still a work in progress and not optimized for all terminals.
GitHub Repo →