Dragon Slayer: Unleashing Knowledge to Conquer Ignorance with AWS
My entry for the AWS Game Builder Challenge, 'Dragon Slayer,' blends learning and adventure. See how I utilized dynamic question generation, scalable infrastructure, and Amazon Q to build this unique educational game
Published Jan 4, 2025
Hello everyone! I'm thrilled to share my project for the AWS Game Builder Challenge: "Dragon Slayer," an immersive educational game that blends learning with adventure. Inspired by the idea of making education more engaging, I set out to create a game where players defeat a dragon not with brute force, but with the power of knowledge. The dragon, Ignorantia, feeds on confusion and can only be vanquished by correctly answering questions across various topics. This project was a challenging and rewarding journey, and I'm excited to share it with you all!
"Dragon Slayer" is a single-player, educational game where players take on the role of a hero tasked with defeating the ancient dragon Ignorantia. The game's core mechanic is answering multiple-choice questions. When a player answers correctly, they launch an attack on the dragon, reducing its health. Incorrect answers leave the hero vulnerable and can result in damage.
The game features:
- Dynamic Questions: Questions are generated on the fly based on the topic chosen by the user, creating endless replayability and flexibility for different learning areas.
- Health Bars: The health of both the hero and the dragon are displayed, providing a clear visual indicator of the player's progress and the dragon's remaining power.
- Engaging Animations: The game includes animations for both the hero and the dragon to make the experience more immersive and fun.
- Responsive Design: The game is designed to be played on any device without any issues.
- An Epic Quest: Players navigate a world where knowledge is the ultimate weapon against the forces of ignorance.
AWS services were crucial to the development and deployment of "Dragon Slayer." I used the following:
- Amazon S3 (Simple Storage Service): S3 acts as the primary storage for the game's static assets such as images, animations, and other media files. This ensures high availability, durability, and low-latency delivery to users worldwide.
- AWS Bedrock: I utilized Bedrock to generate dynamic multiple-choice questions based on the topic selected by the user. This allows for a wide variety of questions, making the game engaging and challenging. Bedrock's AI capabilities are key to keeping the game fresh and educational.
- Amazon EC2 (Elastic Compute Cloud): EC2 provides the scalable computing capacity for hosting the game application and backend services. This allows handling varying traffic levels to ensure smooth gameplay for all users.
- Amazon Q: I leveraged Amazon Q heavily for writing and generating code for both the front and backend of the game. Amazon Q helped me to be more efficient and produce quality code while also learning best practices.
The development of "Dragon Slayer" was a challenging, educational, and ultimately rewarding experience. One of the biggest challenges was ensuring seamless integration between the frontend (React), backend (Flask), and AWS services. Setting up the API for dynamic questions with Bedrock while handling CORS issues was also a learning curve.
I initially struggled to format the questions from Bedrock properly. The response format was not exactly how I needed it to be for my front end. Using Amazon Q, I was able to refine my Bedrock prompt iteratively. I provided examples of the output I needed, and Amazon Q helped me revise the prompt to get the desired response format. Amazon Q also generated the correct parsing code for the information being sent back, saving me a lot of time and frustration. Furthermore, Amazon Q was instrumental in helping me write the code for both my frontend and my backend. This helped me produce quality code and kept me more efficient.
Throughout this journey, I learned:
- The importance of proper API setup and management.
- How to effectively leverage AWS services for scalability and reliability.
- How to structure code for easier debugging and maintainability.
- How to generate complex prompts for Amazon Bedrock and parse the response
I'm excited to share "Dragon Slayer" with the community! You can try the game here. I encourage you to try it out and let me know your thoughts. Your feedback is highly appreciated and will help me refine the game further. I would be happy to hear your thoughts on the game mechanics, the integration with AWS services, and any suggestions for improvement. You can also view the entire project on GitHub.
Thank you all and best of luck to everyone else participating!