
Farm, Build, Fight! The survival RPG you never knew you need
How two brothers working full-time jobs made a full-scale game in their free time using Amazon Q Developer
Published Jan 14, 2025
Hey everyone! We are Ohad and Dvir Klein, and we made:

A role-playing simulator where you farm, build and fight for your survival on a deserted island full of surprises!

Equipped with a sword, hammer, and hoe, you'll try to make the most of the limited daytime on the island and prepare for the dangerous night - when you'll face challenging enemies of increasing difficulty.
How long will you survive? Why don't you play the game and find out (but be careful - people say it's addictive):
(New players are encouraged to read the game's tutorial, which can be found in the main menu after logging in.)
Welcome back! If you enjoyed the game, please like our blogpost and share your experience in the comment section😊
You might be surprised to hear the entire development process took us less than two months - and the actual coding time took only about 20% of it!
In this blog post, we outline our game development journey, the challenges we faced, and how using AWS, especially Amazon Q Developer, helped us solve them efficiently and create a full-scale game with:
secure signup, an online scoreboard, cross-platform saves, online hosting, and to top it all off - AI-generated in-game NPC (non-player character) tips that change depending on the current state of the game.
Intrigued? Let's dive right in!
Before we dive into the technical details, we'd like to acknowledge the amazing creators whose work helped bring Farm, Build, Fight! to life. We believe in giving credit where credit is due, and our game wouldn't be the same without these contributions:
- Most Visual Assets (including player, enemies, world assets) by Kenmi
- Virtual Mobile Keyboard (for mobile players) by Lilly Games
- Gamer Font by memesbruh03
- Sound Effects from Pixabay
- Background Music generated by Suno.ai
All resources are used under commercially royalty-free licenses, allowing us to focus on creating the best possible gaming experience while supporting the creative community.
In the not-so-distant past, developing a game from the ground up took a lot of time. Each new feature could take hours, if not days, of hard work. If you wanted to make your development process more efficient, you would usually find yourself searching the web for tools and tutorials, sometimes taking more time than expected.
Today, however, with the rise of gen-AI and auto-completion tools, the game development experience has transformed. Having an assistant that codes for you can dramatically reduce development time and yield great results without venturing beyond your IDE.
Amazon Q Developer has proven to be a powerful coding assistant in the Unity framework.
Using JetBrains Rider IDE & VSCode IDE with the Amazon Q plugin, the integration into your code environment is seamless, and it's super easy to get started. The coding assistant by AWS comes in two forms - the auto-completion tool, which helps significantly with syntax and gives good results when queried with comments (e.g., "//make the player move" will be followed by code completion that makes the GameObject move in the Unity-fashioned way). The second form is the Amazon Q chat, and let us tell you -
The Amazon Q Chat is a total game changer (no pun intended)!
We have been absolutely blown away by the implementations suggested by this tool. Since the first time Q Chat generated code for us, we couldn't stop using it. Here are some of the things we liked most:
- The input to Q Chat is very dynamic and fits the programming life cycle. Besides writing your prompt, Q Chat refers to the currently open file in the IDE. If you select a specific piece of code, it will refer to it in particular. You can also start your prompt with @workspace for Q Chat to refer to your entire code environment!
- The Q Chat output is not only high-quality on its own but provides links that refer to more sources and discussions for further exploration. This was very helpful, mostly when Q Chat introduced us to new APIs and concepts.
- Q Chat is an expert in all AWS-related subjects, so writing code that uses or integrates with AWS SDK was incredibly straightforward and much simpler than anticipated.
- Most importantly - the Q Chat results are stunningly accurate. We could implement features like character movement, health system, game logic, projectile mechanics, day-night cycle, and more with just a single query. We also found it helpful to provide a small starting point for Q Chat to generate perfect results in requests where they initially did not fit our needs (This is demonstrated in the example below).

Overall, we estimate that Amazon Q Chat helped us reduce the coding workload to about 20% of our game's total development process.
This allowed us to dedicate more time to the game's creative elements, such as visual assets, sounds, music, and quality-of-life features, which we would not have otherwise had the opportunity to develop.
We highly recommend anyone working with Unity install Amazon Q Developer in their IDE, and especially recommend working side-by-side with Amazon Q Chat.
Before diving into the implementation details, let's examine the overall architecture of our game infrastructure on AWS. The diagram below illustrates the flow from the player's interaction through various AWS services, including CloudFront for content delivery, S3 for hosting, API Gateway for managing requests, Lambda functions for backend processing and DynamoDB for data storage. This serverless architecture enables us to build a scalable, cost-effective gaming platform while maintaining high performance and reliability.

We'll explore each component in detail throughout this blog post.
Our game has a lot to offer: many activities to pursue, paths to consider, and survival strategies to choose from - all within a limited timeframe. As players progress, the daytime gets shorter, and optimizing in-game decisions becomes a matter of life or death for their character.
This can be overwhelming for some players, especially newcomers or those who find gaming under pressure challenging. To help such players and introduce another fun and interesting aspect to the game, we used AWS Bedrock to create NPCs that give in-game tips based on the player's current game state. Want to know how it works? Then let us introduce you to FBF's Island Keeper:

Yeah, he can sometimes be a bit... cheeky 😛
This NPC stands at the entrance to the island and welcomes players based on their data - total number of games played, high score, cause of death in their last game, and more. For example, in the above message, you can tell that our poor player was killed by a mere slime in their third game 🙁
The second NPC is even more interesting - meet the Island Native:

Located at the center of the island, this NPC gives players a fresh tip every morning. The tips depend on the current game state - the player's health, money, and upgrades, as well as information the player isn't yet aware of, such as the incoming enemies for the next night.
This makes the Island Native's tips particularly valuable, as they can hint at the best way to prepare for what's coming - which activities to focus on, which upgrade to buy next, and so on.
After exploring various options, we decided to use AWS Bedrock with Amazon's Nova Lite model. Our implementation uses the following tools and services:
- AWS Lambda: Handles the NPC logic and processes the prompts
- AWS Bedrock: Powers our NPCs' intelligence with the Nova Lite model
- AWS API Gateway: Invokes the Lambda function with the player's current game state in the request body
We chose Nova Lite for several reasons:
- Cost-Efficiency: Compared to other available models, Nova Lite offers great performance at a fraction of the cost.
- Quick Response Time: Perfect for real-time gaming interactions.
- Consistent Output: Provides reliable, controlled responses without going off-track.
- While Amazon Nova requires a specific schema for its prompts, Amazon Q helped us format it correctly and quickly.
The real magic happens in our context generation. Our Lambda function (written in Python) creates a detailed prompt that includes:
- Player's current status (health, money, inventory)
- World state (day count, existing towers and crops)
- Shop inventory
- Last round activity
- Upcoming threats
- Additional relevant data
This prompt is then passed to the model using the Lambda function (details omitted for brevity):
We also gave our NPCs unique personalities through specific strategic guidelines.
Island Keeper specializes in:
- Encouraging players based on their gaming history
- Playful banter
- Welcoming messages
Island Native focuses on:
- Economic status priorities
- Specific threat warnings (like those pesky chickens!)
- Defensive needs
- Available upgrades tracking
- All other session-related data
Our NPCs now provide contextual advice! Here are some examples:
Island Keeper:
- "Hello rookie, I hope you'll survive day one this time!"
- "Hello there, let's see if you can beat that 5-day record!"
- "It's you again! I hope you won't lose to that skeleton this time!"
Island Native:
- "Better harvest those tomatoes before the chicken squad arrives!"
- "Those tower upgrades won't buy themselves - time to plant some pumpkins!"
- "With that many orcs coming, you might want to reinforce your defences!"
Since our game features saved games and a global scoring system to track each player's high scores, we needed a robust user account system. AWS Cognito made this task straightforward.
It provides secure sign-up and login functionality — ensuring that even we, the developers, cannot access users' passwords — along with simple APIs and useful features like email verification codes. Setting up our user system was quick and efficient.
To create a seamless user experience, we decided to let players sign in with usernames instead of emails (because who wants to type their email while gaming?). Here's how we made it happen!
- Allow players to choose their own usernames.
- Support email verification for account security.
- Enable username-based logins (instead of email).
- Ensure everything is secure and scalable.
We combined several AWS services to create our authentication system:
- Amazon Cognito: For user pool management and authentication.
- DynamoDB: To map usernames to emails.
- API Gateway: To create RESTful API endpoints.
- Lambda: To handle backend logic.
- User Submits Registration: Players enter their email, username, and password. This data is sent in the request body to the API Gateway.
- Lambda Processes Registration: A Lambda function receives the data and performs validation.
Our DynamoDB stores both usernames and emails for each player. This setup allows players to log in using either option. The Lambda function determines if the input is an email address using a regular expression. If it is, the login proceeds with the email. Otherwise, the Lambda function retrieves the email associated with the provided username from DynamoDB and uses it for the Cognito login.
This approach enhances the user experience, maintains password security, and ensures username validation.
- The player enters a username, email, and password.
- Lambda checks for existing usernames or emails.
- If an email exists but isn’t verified, the old registration is cleaned up.
- The player is registered with Cognito using their email.
- The username-email mapping is stored in DynamoDB.
- A verification code is sent to the player.
- The player verifies their email.
- They’re ready to play!
FBF has a strong competitive aspect — you aim to survive as many days as possible and make optimized decisions along the way.
What could motivate players more than climbing the leaderboard and earning the envy of others?
Our game considers two score metrics:
- Days Survived: The primary score is the number of days the player survives.
- Time Played: In the event of a tie (which is likely), the time taken to complete the game serves as the tiebreaker.
With the game's "skip" button allowing players to fast-forward through the daytime, they are encouraged to use as little time as possible, rewarding efficient and strategic decision-making. This system especially appeals to speedrunners who love setting records.
The scoreboard system relies on AWS DynamoDB to store player scores, with Lambda functions handling the business logic and API Gateway providing the endpoints.
We store each player's:
- Username
- Days survived
- Time taken to finish the game
This function is triggered when players die in the game. It receives the score data through API Gateway and stores it in DynamoDB, but only if it’s a new high score for that player. This ensures the leaderboard reflects each player’s best performance. The flow is as follows:
- The player finishes the game and submits their score.
- The Lambda function checks DynamoDB for the player’s existing record.
- If the new score is better, it updates the record in DynamoDB.
This function scans the DynamoDB table and returns the top 50 scores, sorted by days survived (descending), then by time played. It ensures the most efficient survivors are always ranked at the top.
A typical FBF session lasts 15-30 minutes, but since this is a survival game, there's no upper limit to gameplay duration. Experienced players who reach higher levels may play for hours and need a way to save and return to their game sessions.
Additionally, busy players may want to enjoy FBF on the go and later continue the same session at home on a different device. Cross-platform save functionality is a highly desired feature for games, and implementing it with AWS was straightforward.
All we needed was to set up our save system in the cloud (storing and loading JSON files that contain the game data), and that was it! Cross-platform functionality required no additional steps.
Our secure cross-platform save system is implemented using AWS services:
- Cognito for authentication (only registered users can access saved data from the cloud)
- API Gateway for REST endpoints
- Lambda for serverless computing
- DynamoDB to store the data.
The player's progress is automatically saved at the beginning of each in-game day. When a save event is triggered, the game client sends the player's data to our API Gateway endpoint, which invokes a Lambda function to process the save operation. The Lambda function either creates a new DynamoDB record for first-time players or updates the existing save data for returning players. The save data structure in DynamoDB includes critical game state information such as days survived, total games played, consecutive games played, last game score, high score, and the current game state.

Now that our game has all these nice features, it needs one final element - a way for players to access it.
Using AWS services, we implemented hosting that is not only straightforward but also flexible enough to meet our exact needs and requirements.
We wanted players to be able to enjoy the game on both PC and mobile devices. Hosting with AWS eliminated the need for platform-specific implementations - any device with an internet browser can access our game through a simple URL.
We also wanted a memorable domain name that reflects the game itself. Using AWS Route53, we were able to assign our CloudFront site a custom domain name at a great price. This is how we secured our perfect domain: FarmBuildFight.click 🙂
Our game leverages several AWS services to deliver a seamless cross-platform experience. Let's break down how each service contributes to our infrastructure:
- Amazon S3 (Simple Storage Service): We chose S3 as our primary storage solution because it provides highly reliable and scalable object storage, making it perfect for hosting our WebGL game build files, HTML assets, and website resources.

- Amazon CloudFront: CloudFront serves as our content delivery network (CDN), significantly enhancing our game's performance worldwide. One of CloudFront's standout features is its automatic file compression, which reduces load times for our WebGL build.
- AWS Certificate Manager (ACM): ACM provides SSL/TLS certificates at no additional cost, ensuring all communications between players and our servers are securely encrypted.
- Amazon Route 53: Route 53 does more than just provide our custom domain. Its intelligent DNS routing automatically directs players to the nearest CloudFront edge location, optimizing their gaming experience.
A significant advantage of AWS hosting is the seamless integration between Route 53, CloudFront, S3, and AWS Certificate Manager (ACM), which streamlines our domain management and SSL certification process.
One aspect of the game we’re eager to explore further is online co-op gameplay. The ability to play with friends would undoubtedly enhance player engagement and create even more enjoyable experiences with FBF.
To make this a reality, we plan to leverage AWS GameLift, which offers robust tools for hosting online game sessions and enabling matchmaking. With the potential support of Amazon Q Developer, implementing this feature might be more manageable than expected. We’re excited to delve into this possibility in the near future!
On a more personal note, this experience with making FBF now holds a special place in our hearts. Since we were little kids we always had this dream that seemed so far-fetched at the time - to build our own video game.
As time went by, we each went to his own path in life, but when we heard about the AWS game-builder challenge, we decided that this is going to be it - so we joined forces and rekindled our childhood dream. We really hope you liked the final result 🙂

Please let us know what you think about FBF! If you liked it, please like our post so it would get more exposure to new players! We’d also appreciate your feedback or your shared experience with the game in the comments to this post.
Thank you AWS for the great opportunity, and thank you all dear readers and players for sharing this experience with us!