Inspiration
Financial literacy is a critical life skill, yet it's often taught in a dry and unengaging way. We were inspired by classic life simulation games and wanted to create a fun, interactive experience that makes learning about personal finance feel like an adventure, not a lecture. Our goal was to build a game where players could safely explore the long-term consequences of their financial decisions, from their first part-time job to retirement.
What it does
Capital Quest is an AI-powered life simulation game where the player navigates the financial journey of a lifetime. The game starts at age 16 with a small starting balance. Each year, a generative AI engine creates a unique, personalized financial dilemma—such as a job offer, an investment opportunity, or a major life purchase—based on the player's current age, wealth, and past life events. The player's choices directly impact their balance, which is tracked through a real banking API backend. The game concludes at retirement (age 67 in USA), where the AI provides a comprehensive "Financial Persona" analysis of the player's entire journey, highlighting their best and worst decisions.
How we built it
Frontend: The user interface is a clean, responsive single-page application built with vanilla HTML, CSS, and JavaScript.
Backend: We built a backend server using Python and the Flask framework. This server manages the game state for each session (player age, balance, job, etc.) and exposes a series of RESTful API endpoints for the frontend to interact with.
AI Engine: The core of the game's dynamic content is powered by Google's Gemini AI. We created a dedicated Python module (ai_agent.py) that uses prompt engineering to instruct Gemini to generate nuanced financial scenarios (both multiple-choice dilemmas and job offers) in a structured JSON format. The AI also performs the final analysis at the end of the game, creating a personalized "scorecard" based on the player's complete transaction history.
Financial API: To add a layer of realism, we integrated the Capital One Nessie API. Instead of just updating a variable, every deposit and withdrawal in the game is logged as a real transaction in a simulated checking account. This provides a persistent and authentic financial ledger for each game session.
Beyond Basic
We developed an automated simulation framework ( Simulation.py ) to run the game hundreds of times. This will allow us to analyze the topic distribution of AI-generated scenarios (e.g., how often do "Investing" vs. "Saving" dilemmas appear?) and use that data to fine-tune the AI prompts, ensuring a balanced and comprehensive educational experience for every player.
Challenges we ran into
A lot !! Our biggest challenge was synchronization between the frontend and backend. We encountered a persistent bug where the player's balance on the screen wouldn't update immediately after they made a choice, even though the backend transaction was successful.
We solved this by implementing an "optimistic update" in the JavaScript. The UI now calculates and displays the new balance instantly for immediate feedback, and then syncs with the authoritative state sent back from the server, creating a seamless user experience.
Another significant challenge was AI prompt engineering. It took several iterations to craft prompts that could reliably instruct Gemini to generate creative, contextually relevant scenarios while strictly adhering to the required JSON format, preventing errors in the application.
Accomplishments that we're proud of
We are incredibly proud of creating a truly dynamic and replayable experience. Because the core life events are generated by an AI that considers the player's past choices, no two playthroughs are the same. A player who decides to invest in a risky startup at age 20 will face entirely different challenges and opportunities than one who chooses to go to college.
Integrating a real-world financial API is another major accomplishment. Using the Capital One Nessie API to create a genuine transaction log adds a level of authenticity that makes the simulation feel much more impactful and real.
What we learned
This project was a deep dive into full-stack development and the practical application of AI. We learned how to design and build a RESTful API with Flask, manage asynchronous communication between a client and a server, and the critical importance of robust error handling.
Most importantly, we learned the power of prompt engineering. We discovered how to use carefully crafted instructions and examples to guide a large language model to become a core, logical component of an application, not just a simple text generator.
What's next for Capital Quest
We highly believe that our game 's framework has immense potential, so much so that with refined tuning it can be launched by Capital one as their official game, which would increase financial literacy . Till then, our next steps would be to deepen the simulation by:
Expanding Event Types: Introducing new AI-generated modules for stock market investing, real estate, and unexpected life emergencies (e.g., medical bills, car repairs).
Adding a Social Module: Incorporating relationships and family events (marriage, children) that have significant financial implications.
Visualizing the Journey: Creating charts and graphs in the final scorecard to visually represent the player's net worth, income growth, and spending habits over their lifetime.

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