Building An AI-Powered Text Adventure with AWS
Hey there! In this blog, I share my experience using Amazon Q Developer and AWS Amplify to build Ventura, an AI-powered text adventure game.
Published Nov 21, 2024
Last Modified Nov 23, 2024
Check out my deployed game, available at https://ventura-io.xyz/!
!!NOTE!!: If it says "Loading..." for a while, KEEP WAITING! The backend may be running a bit slowly depending on server load. Please be patient.
Participating in the AWS Hackathon has been an incredible experience, and I’m excited to share how I developed Ventura, an AI-powered text adventure game. This game features two modes, Easy and Hard, and even offers a unique Restart button that lets players create a new story from scratch every time. I built Ventura using a variety of AWS services, including Amazon Q Developer for development and AWS Amplify for hosting, all while working within the limitations of the AWS Free Tier. Here's a breakdown of my process, challenges, and how I brought Ventura to life.
The core of my development process was the use of Amazon Q Developer, a powerful generative AI assistant. This AI tool greatly expedited the creation of various game components, particularly in areas where repetitive coding would otherwise take a lot of time. With Amazon Q Developer, I was able to:
- Generate Core Logic: I used Q Developer to help craft essential game mechanics like the decision tree and story progression logic. It was invaluable in reducing the time I would’ve spent manually writing these components.
- Create Dynamic Story Elements: Ventura’s primary feature is its interactive story. With Amazon Q Developer, I was able to quickly build frameworks for branching dialogues and multiple story outcomes based on player choices. Q Developer even helped me streamline the process of generating responses from the AI, saving hours of coding and testing.
- Enhance Game Interactivity: I leveraged Q Developer for generating frontend components, saving my time and creating a game experience where all User Interface (UI) is created to be responsive to different screen sizes.
Using Amazon Q Developer significantly reduced development time, allowing me to focus on refining Ventura’s storytelling and ensuring the user experience was both engaging and seamless.
Once I completed the game’s core features, the next step was hosting it. Given the constraints of my budget, I used the AWS Amplify Free Tier to host Ventura, which made the process smooth and accessible. AWS Amplify allowed me to:
- Host Ventura on a Custom Domain: I was able to secure a custom domain for Ventura—ventura-io.xyz—which helped provide a more professional appearance and smoother user access!! Default was https://main.d3s298m1zz809p.amplifyapp.com
- Seamless Deployment: Amplify’s easy-to-use interface allowed me to deploy the game without a hitch. I didn’t have to worry about scaling issues since Amplify's managed environment handled the technical aspects for me.
- Free Tier Flexibility: Since I was working on a tight budget, the AWS Amplify Free Tier gave me the flexibility to host Ventura with no cost, ensuring a smooth launch without having to pay for services out of pocket.
Additionally, Amplify automatically took care of important features such as user authentication, and real-time updates to my repo commits, allowing me to focus entirely on game development.
Ventura is built around an AI-driven text adventure where players make decisions that shape the story, though the experience was somewhat hindered by the limitations of Gemini 1.5 Flash, the free version of Google’s generative AI. While the AI was used to drive dynamic narratives that change based on player choices, it struggled to deliver the quality I had hoped for, and I often found myself wishing for a more robust AI solution like AWS Bedrock. Despite these challenges, I used Gemini 1.5 Flash for:
- Story Generation: The AI generated responses and scenarios, but the results were often repetitive and lacked depth, limiting the freshness of each playthrough.
- AI-Driven Narratives: In Hard Mode, the AI created complex scenarios, but the difficulty was inconsistent and sometimes felt overly simplistic, while Easy Mode provided a basic and predictable experience.
- Personalized Interactions: The AI adapted the narrative based on player choices, but the interactions felt artificial and often didn’t align well with the player’s intended path.
While Gemini 1.5 Flash did enable me to integrate AI-driven narratives, the experience was far from perfect, and the overall dynamic feel of the game could have been significantly enhanced with a more advanced AI engine.
Ventura offers several unique features that set it apart from traditional text adventure games:
- Two Modes: Easy & Hard: Players can choose between a simpler, more accessible story in Easy Mode or a more intricate, challenging adventure in Hard Mode.
- Restart Button: The Restart button allows players to start a completely new story with each playthrough, ensuring the game is always fresh and exciting.
- Interactive AI: The AI-driven narrative responds to player choices, offering a unique experience with every interaction.
- Custom Domain: As mentioned, Ventura is hosted on ventura-io.xyz, providing a sleek and professional access point for players.
As with any project, I faced several challenges along the way:
- Limited Resources: With no budget for paid services, I relied entirely on the AWS Free Tier and Google's Gemini 1.5 Flash. If I'd had a better budget, I would've used a more reliable and robust AI model such as Amazon Bedrock. This pushed me to be creative with my solutions and learn how to work within constraints. I’m pleased with how the game turned out, and the Free Tier services were more than sufficient to host Ventura without any interruptions.
- Integrating AI with the Game’s Story: Ensuring smooth integration between the AI engine and the game’s dynamic storylines was a challenge. However, with Amazon Q Developer, I was able to quickly iterate on different components, ensuring the AI’s responses felt seamless and natural.
- Optimizing for Performance: Since Ventura is hosted on AWS Amplify, I had to be mindful of performance optimizations to avoid any latency or slowdowns, especially with the text-heavy nature of the game. Thankfully, the performance of AWS Amplify ensured the game ran smoothly without issues.
Working with AWS services—particularly Amazon Q Developer and AWS Amplify—was an excellent experience. I appreciated how easy it was to integrate different components of my game with minimal setup, all while working within the Free Tier. Here’s what stood out:
- Scalability: Amplify’s ability to handle the backend while scaling effortlessly made it a reliable choice for my project.
- AI Assistance: Amazon Q Developer allowed me to focus on creative aspects rather than spending hours on repetitive code.
- No Budget, No Problem: Despite having no budget, I was able to create and host a fully functional game, thanks to AWS’s robust Free Tier offerings.
Building Ventura as part of the AWS Hackathon was a rewarding experience. I used Amazon Q Developer to speed up the development process and AWS Amplify to host the game on a custom domain, all while working within the AWS Free Tier. Ventura is an AI-powered text adventure game that adapts to players' decisions, offering a unique experience each time they play. Despite the challenges of having no budget, I’m proud of the end result, and I hope this project inspires other developers to leverage AWS services to bring their ideas to life.
You can play Ventura here:
Feel free to leave feedback, and I’d love to hear your thoughts!