Inspiration

We wanted to bridge the gap between storytelling and interactive gameplay. Many people have incredible stories or favorite novels but lack the technical skills to build a game. We asked ourselves: "What if you could simply upload a story, and AI would build the world, the characters, and the battles for you?" The goal was to create an engine that turns text into a playable pixel-art RPG experience instantly.

What it does

PlayRPG is an AI-powered game generator that converts raw text stories into fully playable 2D browser RPGs.

How we built it

Story Analysis: It analyzes the input text to extract characters, locations, dialogue, and plot points. Asset Generation: It uses Google Gemini to generate unique pixel-art sprites for the player, NPCs, minions, and background environments. It creates walking animations and consistent character styles across different scenes. Music Composition: It generates custom background music (BGM) matching the story's mood using ElevenLabs. Game Logic: It automatically sets up scenes, collision detection, turn-based combat systems, and dialogue trees in Phaser.js. Result: The user gets a deployable web game where they can explore the world, talk to characters, fight enemies, and level up.

Challenges we ran into

Sprite Consistency: AI models often struggle to generate the exact same character in different poses. We implemented a multi-stage generation process where we first generate a "stand" pose, and then use that image as a conditional input to generate walking frames (up, down, right), ensuring the character looks the same while moving. Background Removal: AI-generated pixel art often comes with artifacts or non-transparent backgrounds. We had to write custom image processing algorithms to detect "near-white" pixels and remove halos without erasing parts of the character's clothing (like white shirts). Prompt Engineering: Getting the AI to output valid, strictly formatted JSON for complex game data (NPC stats, coordinates, dialogue) required rigorous prompt tuning and fallback mechanisms.

Accomplishments that we're proud of

Everything in story become playable and visable !

What we learned

Multimodal Workflows: We learned how to chain different AI modalities (Text -> JSON -> Image -> Game Logic) effectively. Asset Pipeline Optimization: We discovered that "perfect" AI generation is rare; robust post-processing scripts (cropping, resizing, normalizing) are essential for usable game assets.

What's next for PlayRPG

Inventory System: Adding items and equipment extraction from stories. Branching Storylines: allowing player choices in dialogue to affect the outcome of the game generation or future scenes. Improved Animation: Using more advanced video/frame generation models for smoother 6-12 frame animations.

Built With

Share this project:

Updates