Inspiration

I grew up playing text-based RPGs, choose your own adventure books and tabletop games like D&D.

I wished the stories could be infinite and reactive to my choices. The rise of LLMs presented an opportunity to finally create a game where every play-through is unique, where AI serves as the ultimate Game Master, crafting personalised adventures in real-time.

When I discovered Google AI Studio thanks to the Gemini Hackathon, I realised I could rapidly prototype this vision with Gemini's multimodal capabilities at its core.

What it does

Mythic Weaver is an AI-powered text-based RPG that generates dynamic, branching fantasy adventures entirely through Gemini.

The game is intentionally exposed as a sand box, where each part can be prompted by the user or completed by Gemini.

Players describes a character from well known classes, or can come with a custom one, each has distinct skills and play style.

Gemini can generate everything: character names, backstories, appearances, avatar images, story scenes, enemy encounters, and even the visual atmosphere of each location. Or the user can fill in a few inputs, and let Gemini complete the rest.

The game features D&D-inspired turn-based combat with dice rolls, armor mechanics, and skill cooldowns. Every scene branches based on player choices, creating infinite replayability where no two adventures are alike.

How I built it

I built Mythic Weaver entirely within Google AI Studio, which proved invaluable for rapid iteration. The stack is React with Vite for the web interface, fully integrated with the Google GenAI SDK for all AI features.

Gemini powers the core gameplay loop:

  • Character Generation: Names, backstories, appearances, and custom class details generated contextually
  • Avatar Creation: Character portraits generated via Gemini's image generation model
  • Dynamic Story Generation: Each scene crafted in real-time based on player choices, game settings, and narrative context
  • Combat Encounters: Enemies generated to match the story's theme and difficulty progression
  • Scene Imagery: Atmospheric visuals generated for each story beat

Google AI Studio's playground let me iterate on prompts instantly, testing story generation schemas, tweaking character creation outputs, and refining image prompts without redeploying. This tight feedback loop cut the development time dramatically.

Challenges I ran into

  • Structured AI outputs: Getting Gemini to return consistent JSON for game state required careful schema design and prompt engineering, AI Studio's playground was essential for iterating on this
  • Narrative coherence: Maintaining story continuity across multiple AI-generated scenes needed context management and careful prompt construction
  • Combat balance: Tuning 8 character classes with 16 unique skills to feel distinct yet balanced took extensive play testing
  • Image generation consistency: Getting character avatars and scene images to match the game's dark fantasy aesthetic required prompt refinement

Accomplishments that I'm proud of

  • Fully AI-driven experience: Every narrative element (characters, stories, enemies, images) is generated by Gemini in real-time
  • 8 balanced character classes: Each with 2 unique skills, distinct stat distributions, and different play style
  • Cohesive aesthetic: UI styling and AI-generated imagery work together for an immersive atmosphere
  • Rapid prototyping success: Google AI Studio enabled me to go from concept to playable game incredibly fast
  • 9 language support: Internationalisation letting players adventure in their native language

What I learned

  • Google AI Studio accelerates AI development: The ability to test prompts, tweak parameters, and see results instantly in the playground was a game-changer for iterating on AI features
  • LLMs work best with structure: Structured JSON schemas produce far more reliable game content than open-ended generation
  • Multimodal AI enables new game genres: Combining text generation with image generation creates experiences that weren't possible before
  • Prompt engineering is game design: Crafting the right prompts is as important as coding the game logic

What's next for Mythic Weaver

  • Multiplayer co-op: Let multiple players join the same adventure with the AI adapting to party dynamics
  • Story sharing marketplace: A community hub for players to publish and discover adventures
  • Voice narration: Integrate text-to-speech for an audiobook-like experience
  • Mobile app: Native iOS/Android builds for gaming on the go
  • Custom class creator: Let players design their own character classes with AI-assisted skill balancing
  • Persistent world state: Remember choices across multiple play sessions to create an evolving personal saga

Built With

Share this project:

Updates