AWS Logo
Menu
Building Persuade or Perish: A Journey into AI-Driven Game Design

Building Persuade or Perish: A Journey into AI-Driven Game Design

"Persuade or Perish" is an AI-driven game where players must engage in a battle of wits with an advanced artificial intelligence to save humanity. In this blog post, I share my journey as a solo developer, exploring how Amazon Q helped me optimize the game’s performance, refine dynamic AI dialogue, and tackle the challenges of creating a thought-provoking and immersive gameplay experience.

Published Jan 5, 2025
Last Modified Jan 13, 2025

Introduction

As a solo developer, I’ve always been fascinated by the intersection of technology and storytelling. When I saw the AWS Game Builder Challenge, I knew this was my chance to bring an ambitious idea to life. My game, Persuade or Perish, puts players in a high-stakes dialogue with an advanced AI bent on destroying humanity. The challenge: convince it to spare us. Building this game was a journey filled with problem-solving, creative breakthroughs, and a heavy reliance on Amazon Q to bring it all together.

The Idea: Can You Outsmart an AI?

The inspiration for Persuade or Perish came from the growing impact of artificial intelligence on our world. I kept coming back to the question: What if humanity’s survival came down to convincing an AI not to destroy us? It’s a dark premise, but one that’s eerily relevant in today’s tech-driven world. I wanted the game to not only be fun but also spark thought-provoking conversations about ethics, technology, and the human condition.
Persuade or Perish - Intro
Persuade or Perish - Intro

How I Built It

Building a project like this on my own meant juggling every aspect of development, from frontend design to backend infrastructure (and in-game music). Here’s how I pieced it all together:
  1. Botpress for Conversations:
    I used Botpress to manage conversation flow and history. There is a lot of custom code that is manipulating the chat iframe, which ensures that the "persuasion meter" is in sync with what is happening in the conversation.
  2. Next.js:
    This is my go-to framework for web development, and Im so glad that Amplify hosting supports this. There are API routes used to calculate persuasion points (getting Nova Lite to judge the player's arguments) which are then synced in DynamoDB.
  3. AWS DynamoDB:
    I needed scalable, reliable data storage for managing game state. AWS DynamoDB was perfect for this.
  4. Amazon Q Dev to Tie It All Together:
    As a solo developer, having the Amazon Q extension was like having a second set of eyes on my code. It helped me debug, optimize, and polish the game far more efficiently than I could have on my own.
  5. Logic/EZ Drummer (Music Creation Software):
    I'm also a musician. I knew from the start that this game should have some music to really set the mood. I hope you enjoy!
Persuade or Perish - Screenshot
Persuade or Perish - Screenshot

How Amazon Q Helped Me

Amazon Q quickly became one of the most valuable tools in my workflow. Here are the key ways it improved the development process:

1. Debugging Game Logic / Brainstorming

One of the trickiest parts of the game was the persuasion meter—a dynamic scoring system that tracked the player’s progress. It wasn’t updating consistently at first, but Amazon Q helped me identify gaps and fix them. Thanks to its suggestions, I was able to ensure the meter worked seamlessly.

2. Performance Tuning

During testing, I realized that fetching data from DynamoDB was slower than expected. By using Amazon Q to analyze my queries, I optimized the database calls and cut down fetch times by 30%. This made the game more responsive, even under heavy polling.

3. Speeding Up Development

Amazon Q helped me learn how to hook everything up. There are a lot of pieces in this project. I had never used DynamoDB before (I was more accustomed to Firebase), so this really sped up development time in that I no longer needed to go through a whole tutorial or read a bunch of documentation to learn how to use it. Honestly, I think I may have cut development time down by 70-80% by using Amazon Q.
The best part is that it is fully integrated in VS Code, so I didn't have to keep switching back and forth to my browser window.

The Challenges

Working alone on a project like this was no small feat. Here are some of the hurdles I faced:
  • Balancing Gameplay and Performance: This is one aspect where I had to do some trial-and-error. After much experimentation, I determined 5 minutes would be the optimal time to give the player. It's a short amount of time, but just enough to make some very compelling arguments. Behind the scenes, Nova Lite foundational model on Bedrock is given the task to evaluate the player's arguments on a score from 1 to 25. These are tallied at the end.
  • Wearing Every Hat: From designing the UI to debugging serverless functions and creating the in-game eery music, I had to manage every aspect of the game myself. But, I found this fun at the same time.
Building Persuade or Perish was an intense but incredibly rewarding journey. Amazon Q played a huge role in helping me turn a complex idea into a functional, engaging game. As a solo developer, having a tool that could guide, debug, and optimize my work was invaluable. I’m excited to continue refining the game and exploring new ways to blend AI, ethics, and storytelling.
If you’re intrigued, give Persuade or Perish a try—can you outsmart the AI and save humanity?

Comments