Dungeon Master
Project Overview
Dungeon Master is a playful, AI-powered adventure experience built around the Gemini API. The goal of the project was simple: create something fun that feels like a classic tabletop RPG session, but powered by modern AI. Users choose a name, race, and class, then the application uses Gemini to spin up a custom quest tailored to their character.
Rather than focusing on productivity or business value, this project is all about delight—using AI to generate immersive storylines, surprising twists, and replayable fantasy scenarios that feel handcrafted, even though they're generated on the fly.
The Challenge
The main challenge was to design an experience that felt structured enough to guide the player, but open-ended enough to let the Gemini API shine creatively. I needed to:
- Design a character creation flow that is simple, but expressive enough to meaningfully influence the story.
- Shape prompts for the Gemini API so the generated quests feel coherent, thematic, and replayable across many runs.
- Balance randomness and control—letting the model improvise while keeping the narrative readable and fun.
- Create a UI that visually feels like a fantasy game interface, while remaining clean, modern, and responsive.
The Solution
I built Dungeon Master as a lightweight Next.js application that centers around a single, focused interaction: creating a character and beginning a quest. The interface presents fields for name, selectable race options (like Human, Elf, Dwarf, Half-Orc, and Fae), and a set of class choices (Warrior, Mage, Rogue, Ranger, Cleric, etc.). Once the player confirms their character, the app calls the Gemini API with a carefully structured prompt.
The prompt includes the player's selections and instructs Gemini to generate a narrative-style quest opener, including setting, stakes, and a few branching options the player could take next. By keeping the response format consistent—intro, immediate conflict, and suggested next actions—the UI can render the output in a way that feels intentional and designed, not just raw text.
Behind the scenes, the app lightly constrains tone and style (high-fantasy, slightly dramatic, second-person perspective) so that each run feels like part of the same world, even though every quest is generated on demand.
Using the Gemini API for Fun
At the heart of Dungeon Master is the Gemini API. Instead of optimizing for efficiency or productivity, I treated Gemini as a creative collaborator—a digital dungeon master that can riff on my prompts and surprise players with unexpected twists.
- Prompts are dynamically assembled based on the player's character choices, setting clear constraints while leaving room for creativity.
- Responses are tuned for story-first output: rich descriptions, strong hooks, and clear next steps instead of raw data.
- Each new character generates a fresh quest, encouraging experimentation and replayability just by tweaking name, race, or class.
Results
Dungeon Master succeeds at its core goal: turning the Gemini API into a playful, story-driven experience. It demonstrates how large language models can be used not just for productivity tools, but for whimsical, narrative experiences that feel personal and surprising.
The project also serves as a foundation for future ideas—branching story paths, persistent characters, and multi-step campaigns—while keeping the initial implementation intentionally small and focused on fun.