Inspiration
The powerful endings of Red Dead Redemption 2 stayed with me long after the credits rolled. In RDR2, every choice Arthur Morgan makes throughout his journey—whether to help or harm, to be honorable or ruthless—culminates in profoundly different endings that feel deeply personal. This made me realize: what if we could create a life simulator where every decision truly matters, where the AI doesn't just follow a script but genuinely responds to your choices, creating a unique narrative that's entirely your own?
I wanted to capture that same emotional weight and consequence, but in a life simulation that anyone could experience. Game of Choice was born from the idea that our decisions define us, and AI could help us explore the infinite possibilities of different life paths.
What it does
Game of Choice is an AI-powered life simulator that uses Google's Gemini API to create a truly dynamic, personalized life journey. You start by choosing your "thought path" (Ambitious, Hedonist, Stoic, Altruist, Scholar, Artist, or Mindful), and from there, every decision you make shapes your destiny.
The game tracks five core life stats: Wealth, Health, Happiness, Intelligence, and Relationships. As you progress from childhood through your senior years, the AI generates realistic scenarios tailored to your past choices. Choose a risky startup over a safe job? Your wealth might soar, but stress could tank your health and happiness. Help a stranger? Your relationships and happiness increase, but maybe at the cost of time and money.
What makes it unique is that no two playthroughs are the same—the AI continuously generates new scenarios based on your evolving story. When your journey ends, the AI evaluates your entire life path and creates a personalized ending that reflects the choices you made, just like RDR2's honor system creates vastly different conclusions.
You can share your life story via unique shareable links and compete on a leaderboard to see how your choices stack up against others.
How we built it
Frontend: Next.js 15 with React 19 and TypeScript for type-safe, server-side rendered components. Tailwind CSS and shadcn/ui (built on Radix UI) for a beautiful, accessible interface.
Authentication: Clerk handles user management, protecting game routes and syncing user profiles with our database.
AI Engine: Google Gemini API (gemini-3-flash-preview) powers all narrative generation. We implemented a sophisticated multi-key rotation system with up to 5 API keys, automatic retries with exponential backoff, and graceful fallbacks to handle rate limits. The AI generates dynamic events, evaluates custom player choices, and creates personalized endings.
Database: Supabase (PostgreSQL) with Row Level Security stores game sessions, user profiles, and rate limits. We use JSONB columns for flexible game state storage and materialized views for optimized leaderboard queries.
Backend Logic: Server Actions handle all game state management, AI API calls, database operations, and rate limiting—keeping API keys secure and logic server-side.
Rate Limiting: 24-hour cooldown system using database functions to prevent API exhaustion while keeping the experience fair.
Challenges we ran into
1. API Rate Limiting Hell: Our biggest nightmare was Gemini API rate limits. In testing, we'd exhaust our quota within hours. We solved this by implementing a multi-key rotation system that automatically switches between up to 5 API keys, with exponential backoff retries and static event fallbacks if all keys fail.
2. Maintaining Story Coherence: Getting the AI to generate events that meaningfully connect to past choices was tricky. We iterated heavily on prompt engineering, feeding the AI the full choice history and current stats to create contextual, logical story progression.
3. Preventing Gaming the System: Players could spam new games to fish for better outcomes. We implemented database-level rate limiting with 24-hour cooldowns tied to both user ID and email, enforced through Supabase functions with proper RLS policies.
4. Dynamic Stat Balancing: Initially, stats would swing wildly or become impossible to recover from. We refined the AI's stat modification logic to create meaningful consequences while keeping the game winnable and engaging.
5. Performance at Scale: Storing full game sessions with choice histories could get expensive. We optimized using JSONB columns for flexibility, materialized views for leaderboards, and proper indexing on frequently queried data.
Accomplishments that we're proud of
Creating a genuinely AI-powered narrative experience where the AI doesn't just fill in templates but actively generates unique, contextual scenarios
Building a production-ready rate limiting system that scales gracefully with multi-key rotation and database-enforced cooldowns
Implementing enterprise-grade security with Clerk authentication, RLS policies, and server-side action architecture
Crafting a complex game state management system that tracks stats, choices, and narrative context across entire life journeys
Achieving the RDR2-inspired goal: Players report genuine emotional investment in their choices and meaningful reflections on their life paths
Making it shareable: The unique link generation system lets players proudly share their stories, creating organic growth potential
What we learned
Technical Lessons:
- How to architect scalable AI applications with fallback systems and multi-key rotation
- Advanced prompt engineering for narrative coherence and context awareness
- Server Actions pattern in Next.js for secure, type-safe backend logic
- Database design for flexible game state using JSONB and materialized views
- Implementing effective rate limiting at the database level
Product Lessons:
- The power of meaningful consequences—players care more when choices genuinely matter
- AI works best when guided by strong prompts and clear constraints
- User experience requires balancing complexity (deep systems) with accessibility (easy to start)
- Shareable results create natural virality and community engagement
Personal Growth:
- Managing complex state across AI, database, and frontend layers
- Debugging race conditions in async AI calls with multiple fallback layers
- Balancing feature ambition with time constraints during a hackathon
What's next for Game of Choice
Expanded Life Events: More diverse scenarios including career changes, major life crises, unexpected windfalls, and family dynamics
Multiplayer Mode: Allow friends to play as characters in each other's lives, making choices that impact one another's journeys
Mobile App: Native iOS/Android apps for on-the-go life simulation
Visual Storytelling: Generate AI images for key life moments using Nano Banana integration
Enhanced AI Memory: Implement long-term memory systems so the AI remembers significant life events and references them in later scenarios
Achievement System: Unlock special achievements for unique life paths (e.g., "From Rags to Riches," "The Balanced Life," "Digital Nomad")
Cultural Diversity: Add location-based events and cultural contexts for more representative storytelling
Community Features: Forums where players share stories, discuss strategies, and reflect on their choices
Educational Mode: Partner with schools/therapists to use the simulator for teaching decision-making and exploring life consequences in a safe space

Log in or sign up for Devpost to join the conversation.