
Dual Knights
Guide Flame and Aqua Knights through traps and puzzles, using synchronized moves to restore balance and lift an ancient curse in this epic adventure!
Published Jan 14, 2025
In the mystical realm of Dualaria, two ancient orders of knights maintained the delicate balance between the primordial forces of fire and water. For millennia, the Flame Knights and Aqua Knights served as guardians of their respective elements, dwelling in opposing temples at the far edges of the kingdom.
Legend spoke of a catastrophic event known as the Sundering, when a powerful artifact called the Equilibrium Crystal shattered into countless sigils, scattering across the land. This crystal had once kept the elemental forces in perfect harmony, but its destruction threatened to plunge the world into chaos.
Two knights – Flame and Aqua – discovered that they shared a unique bond through the crystal's magic. When one moved, the other was compelled to move in the opposite direction, as if they were reflections in nature's grand mirror. What seemed at first like a curse revealed itself to be a blessing, for only through this connected opposition could they hope to restore balance to their realm.
Together, they embarked on a sacred quest to collect the scattered sigils. Each pair of sigils they gathered would restore a small measure of harmony to Dualaria. Their journey became known as the Mirror Quest, where every step forward by one knight required an equal step in the opposite direction by the other – a dance of fire and water, a puzzle of movement and cooperation.
The knights learned that their seemingly contrary movements were not a hindrance but a representation of the natural order itself: for every action, there must be an equal and opposite reaction. Only by embracing this fundamental truth could they hope to restore the Equilibrium Crystal and bring peace back to their troubled land.
Now, Flame and Aqua travel across Dualaria, navigating increasingly complex paths to reach their designated sigils. Their quest serves as a reminder that opposing forces need not be enemies – indeed, they are essential partners in maintaining the balance of all things.
So thats the story of Dual Knights!
The following is the AWS cognito integration for creating users, logging in using amazon account directly or creating a new account using any other email provider



Flame Knight has noticed that Aqua knight is not moving for quite some time! "Knight's Herald" our AI dialogue engine has noticed this and generated a witty taunt by Flame Knight based on its personality

Oh! I see an archer standing on the tower! What is his range? How much can he see from up there? I better tap on him to know his range! AND it would be wiser to not get any closer to him that we already are.

Was stationary barrels not enough!! The magic runs deep in the kingdom of Dualaria. Better watch my steps or this moving barrel chase me down!

Oh!! We are really close to the barrels! Lets not make a mis-step

Finally fragment of the Equillibrium Crystal is restored! How many more such sigils i need to claim?

Play now : Dual Knights
Detailed AWS Integration explained. The audio is generated using Amazon Polly.
Dual Knights demonstrates sophisticated integration of AWS services to deliver a cross-platform gaming experience, combining traditional game infrastructure with cutting-edge AI capabilities.
Since we have implemented login using amazon congito, players dont need to worry about losing the game progress. Play some levels on web and then resume on your ipad later since we have cloud sync of player game progress and statistics.
Let me explain the architecture of Dual Knights and how we've leveraged AWS services to create a sophisticated gaming platform.
At its core, Dual Knights is built using Flutter and the Flame game engine, which enables us to deliver a truly cross-platform experience. Our game runs natively on Android, iOS, Windows, macOS, Linux, and all major web browsers including Chrome, Opera, all from a single codebase.
For our infrastructure, we've implemented a comprehensive AWS stack. Our domain, dualknight.in, is managed through AWS Route 53, providing high-availability DNS resolution. We use AWS Amplify for application hosting, which handles our CI/CD pipelines and automatically deploys builds that we store in Amazon S3. This setup ensures efficient content delivery and seamless updates.
Our authentication system is built on Amazon Cognito, around which we've wrapped a custom JWT implementation. Players can sign in using their Amazon accounts or any email provider, with secure token-based session management handling their gameplay sessions.
The backend infrastructure runs on AWS Elastic Beanstalk using a Node.js runtime, deployed across Amazon EC2 instances. We've implemented Elastic Load Balancer for traffic distribution and configured auto-scaling to handle variable player loads. Game data and player statistics are stored in Amazon DynamoDB, while level files and assets reside in Amazon S3.
One of our most innovative features is the Knight's Herald, our advanced AI interaction engine. The system begins with a knowledge base creation pipeline where we store our story content and character interaction lore in Amazon S3. This content is processed by Amazon Bedrock's default parser using optimized chunking strategies, and then transformed into vector embeddings using Amazon Titan Text Embeddings v2.
These embeddings are stored and indexed in Amazon OpenSearch Serverless, enabling efficient similarity search and contextual retrieval. The serverless architecture ensures cost-effectiveness and automatic scaling. Real-time AI processing is handled by AWS Lambda functions, with Amazon API Gateway managing our RESTful API endpoints for game client communication.
The actual generation of in-game content happens through Amazon Bedrock, specifically using the Claude Haiku model. This generates contextually appropriate character taunts, game announcer commentary, and character-to-character interactions. We've optimized our Lambda functions for low-latency responses, and our OpenSearch Serverless configuration ensures fast vector similarity searches, while API Gateway provides request throttling and cache management.
Knight's Herald is configured for following events:
- Flame Knight is Near Barrel
- Flame Knight is Very Near to Barrel
- Barrel Explodes When Flame Knight Comes in Contact with Barrel
- When Flame Knight is not moving for a long time
- Archer is Searching for knights to fire arrows and sees Flame Knight is near its range
- Archer Detects Flame Knight is in the range
- Barrel has killed Flame Knight many times
- Flame Knight Reaches the Correct Destination Sigil
- both knights Reaches to the wrong or opposite Destination Sigils
- Knights Are Not Able to Use Their Swords
- knights are making many repeated moves
- Knights completing the First Level
- knights are playing First Barrel Level and barrel are not moving
- knights are playing the level where Barrels are moving
- many more such events
The embeddings are generated on vast number of such interactions. Since the personalites of each of these characters are encoded into the knowledge base, we get new, innovative but consistent taunts, character interactions from Knights, Barrels, Archers.
What makes this architecture particularly impressive is how it leverages AWS services across the spectrum, from fundamental infrastructure to cutting-edge AI capabilities. The integration of Amazon Bedrock with Titan embeddings and Claude Haiku showcases advanced AI implementation, while our serverless components ensure scalability and cost-effectiveness. By using managed services like Cognito, DynamoDB, and Elastic Beanstalk, we've minimized operational overhead while maintaining high availability and performance.
This comprehensive use of AWS services demonstrates not just technical sophistication but also practical understanding of cloud architecture principles. We've created a scalable, reliable gaming platform that can handle everything from basic gameplay to complex AI-driven interactions, all while maintaining optimal performance and cost-efficiency. The combination of Amazon Bedrock with Titan embeddings and AI models demonstrates sophisticated AI implementation, while serverless components ensure scalability and efficiency.
"We leveraged Amazon Q as a critical tool throughout the development of Dual Knights, aiding us in every phase of the project. Here’s how Amazon Q played a vital role:
- Defining Classes and Structures
Amazon Q streamlined the creation of well-structured classes, ensuring clean, modular, and scalable code. Its intelligent suggestions helped reduce development time and improved overall design consistency. - Debugging and Issue Resolution
Complex bugs, ranging from logical errors to runtime crashes, were resolved with Amazon Q's debugging capabilities. It provided clear insights into the root causes, offering precise and actionable fixes. - Code Optimization
Amazon Q analyzed our codebase and suggested optimizations for performance, ensuring the game ran smoothly across platforms. This was particularly helpful for handling intricate game mechanics and animations. - Grid Math Assistance
The game’s unique mirror-movement mechanic required precise grid-based calculations. Amazon Q helped us resolve challenges in grid math, ensuring accurate movement and puzzle mechanics. - Advanced AWS Integration
Integrating AWS services like Amplify, DynamoDB, Elastic Beanstalk, and Bedrock required careful configuration and implementation. Amazon Q provided detailed guidance, ensuring seamless integration of these services.
Amazon Q proved to be an indispensable resource, acting as a mentor, debugger, and optimizer throughout the development process, significantly contributing to the successful completion of Dual Knights."
Thank you for taking out your time and reading this article. Please try out our game and let us know if you have any questions. Please let us know how you like the game.