AWS Logo
Menu
How I made the creepiest game of 2024 (according to my 10-year-old daughter)

How I made the creepiest game of 2024 (according to my 10-year-old daughter)

The shocking story of building “THAT AINT HUMAN!” in 3 days with Amazon Q Developer

Basil Fateen
Amazon Employee
Published Nov 21, 2024

Rarely do I get to work on something that brings together so many things I love; coding, gaming, AI, cloud computing and terrifying myself.

Well this is one of those rare projects.
And yes, I had an odd childhood.
When I heard about the AWS Game Builder Hackathon, I jumped at the chance to take part and create a sample game that uses AWS services.
They said, “It can be as simple as tic-tac-toe”.
And I instantly thought, “It definitely won’t be tic-tac-toe. It will be creepy as hell.”
So, the genre was already decided: horror.
An odd choice for an AWS hackathon, indeed. But we have already established that I am an odd person.
Now the next order of business was figuring out the concept of the game itself.
I’m a bit of a horror connoisseur and the genre has a broad spectrum of concepts that can get under your skin. From paranormal jump scares to psychological thrillers to slow-burns that are subtly unsettling in a way that you can’t comprehend but clearly feel. But above all, I was always a big fan of classics like ‘The Thing’ and ‘Invasion of the Body Snatchers’.

There’s nothing creepier than something that looks human…but isn’t.

That concept instantly brought in the technology dimension. We are now living in a time where AI-generated images are becoming eerily indistinguishable from photos of reality. Which, from a business perspective, opens a world of exciting possibilities from creative industries to e-commerce.
From a horror perspective, it introduces the question: what if we absolutely cannot tell the difference between real human photos and fake human photos? And what if at some point it goes beyond the screen and enters real life and these deepfakes are now walking among us as humanoid robots….AND WHAT IF one day they malfunction and start attacking humans?!
The storyline:
It's the near future and the deep-fake AI robots have started attacking humans everywhere. Nobody knows if it's a malfunction or a planned attack. It doesn't matter. You managed to escape and take refuge in an abandoned house. People are frantically coming and knocking trying to get in. You have to determine quickly if its human or not, before they break down the door. If it's a human, they have important supplies to keep you alive as well as images of AI to look out for. If it's not human, do not let it in. Some of them look eerily similar to humans, but you have to focus quickly to notice things about them that don't seem natural. But you have to make a decision quick or they attack and break down the door. While it's not clear if help is coming or not, you have one objective...to survive.
Pause here. If you still have not played the game, I suggest that you play it now without any spoilers:

Welcome back! If you enjoyed it, don't forget to give this article a 'Like' and let me know your experience in the comments below :)

So anyway, once those gears started turning in my head, I took off my freak hat and put on my geek hat to figure out how I was going to bring this project to life.

I decided that I would use Amazon Bedrock to generate all the photos of the AI generated humans. By experimenting with various prompts, I would have a vast amount of convincing fake people photos.
Amazon Bedrock image playground
Creepy person with slight smile staring at the camera, outdoors, solid black background, night time, candid shot, 35mm film, DSLR, 50mm prime lens, high resolution, close-up, head shot
Scared Person staring at the camera, centered in image, black background, evening time, DSLR, candid shot, medium shot, brightly lit face,high resolution
The great thing about the Bedrock Playground is that it becomes very easy to fine-tune prompts and see almost instant results while experimenting with the various Image generation models such as Amazon Titan and Stability XL. I found that each one excels with different styles of images and prompt details. I decided to use a mix of results from different models so that the visual style would not be identical.
But before committing further to developing this, I decided to create a small prototype of the game. I downloaded some regular photos of people from Adobe Stock and then I generated photos using Stability AI on Amazon Bedrock.
I decided to put the images into a folder and ask someone to try and determine the real people from the fake people, to test if the core task is exciting.

For this I would need a beta tester...

One of the main reasons I got married and had children is so I can use them as beta testers for my weird coding projects. I keep a roof over their heads, they keep testing my code for free, that’s the deal.
So, I summoned my adorable little 10-year-old angel Laila (aka Looly) for this important task.
Looly
Now before you start writing an angry comment below about how I could do that to a child, she's already a big fan of creepy things and there is nothing in the game that could cause irreversible damage.
Or at least I don't think so. I'll find out in 10 to 15 years.
I watched her as she looked through the folder of photos. Just picking out which she thought was human or not and me telling her the result seemed to be a fun challenge, which was a good sign. Then I discovered that the longer she looked, the more she was able to notice subtle differences and guess correctly, but when put under pressure of a short time it became more difficult. So putting the user under pressure would be an important element of the game mechanics, using some kind of timer.
And then I realized that part of the pressure would be what happens if you guess incorrectly. That’s when I decided to bring another horror-genre element: JUMPSCARES! I wanted to simulate the feeling of the AI attacking if you let them in, to increase the anxiety when making a choice.
I could just make the original image jump out by increasing the size…or…what if I could alter the photo itself to show them attacking with a rabid and terrifying expression?!
At any previous point in history, that would be impossible without the help of a digital artist or taking a professional photo with a model. Now it’s not only possible, but instant.

So...back to Bedrock!

I discovered this amazing feature in addition to generating images is ‘modify image’ while attaching a photo and providing a prompt of what you want to be changed. This really blew my mind. It took a few prompts to get the level of change that I wanted, but I was happy with the result and tested it on a few samples.
Amazon Bedrock Generate Variations
Then the next order of business was to automate this process in order to generate dozens of basic AI images and then generate versions of them that I can use as jumpscares when you pick incorrectly.
To do that, I turned to Amazon Q Developer, which generated the python scripts in seconds.
Write a python script which uses Stability AI stable diffuson on Amazon Bedrock to generate variations of images found in a local folder 'inputs' with the prompt "Screaming and angry person" and then upload that variation to an S3 bucket titled 'TAHassets' in a folder called 'variations'. Make sure to resize the input photo in a format that is expected before sending.
Now that I had my concept validated and my main assets created, it was time to build out the game frontend. I decided I would avoid any frameworks and go for raw HTML/JavaScript/CSS like the old-school dinosaur that I am.

This was the first prompt I used to build out the skeleton:

"I want you to help me create a web game using HTML, CSS and Javascript. The game loads photo from two folders, one containing photos of real humans and the other folder contains AI-generated photos. The game shows one picture at random from either one of those folders and the use must guess if it is "human" or "AI" by clicking on one of two buttons. If they guess correctly, they get a point, if they are wrong they lose a point. Then the next random image shows until all of the images in the folders are finished and then the total score is shown."

Now this is where things got interesting.

As a tech evangelist, my work is usually focused on specific use-cases, proofs of concepts and demo code to accompany my content. Rarely do I have the liberty nor the bandwidth to develop something end-to-end using Amazon Q Developer and AWS technologies.
Well, this was my chance, and it completely opened my eyes about how enormously the development process has changed.
AI not only became the concept of the game, but with Amazon Q Developer it also became an essential co-developer which generated the hundreds of assets of the game as well as about 80% of the codebase!
I used Amazon Q Developer to help generate large portions of:
  • Project roadmap
  • Frontend code handling the game logic
  • Backend functions to load/save data
  • Adding gameplay elements with inline function suggestions
  • Connecting moving parts
  • Preparing and optimizing assets
  • Deployment instructions
This experience kind of blew my mind, to actually build something end-to-end with an AI assistant like Amazon Q Developer.
You see, I come from the olden days. When I started coding, there was no coding companions, no Stack Overflow, there wasn’t even Google when I started.

We had ‘Ask Jeeves’. And Jeeves was mostly a useless dude if you were looking for help with a coding problem.

The thing that I appreciated the most is the level of contextual awareness that Amazon Q Developer has as it sits within your IDE. For example, I highlighted a function that handled a certain level and chose 'Send to prompt' and asked 'What can I add to make this game level more interesting?' and it not only suggested specific gamification elements to add, it generated the code for it within that function, without damaging the prior elements of the level. 🤯
Now I want to make it clear that I'm not saying that it can developed an end to end game like this completely by itself. As the complexity of the codebase increased, there become certain aspects that I was better suited to handle, otherwise there would have been too much back and forth. I would have had to write such a detailed prompt that it would have been about the same size as the code itself.

It is in determining the ideal synergy between the developer and the AI code-generator that the most efficiency was established.

For the backend functions, of course I made use of Lambda. Because as Confucius famously said, “why launch a server to run code when there are serverless functions?”
Write a python lambda function to read the contents of a folder within an S3 bucket and return the paths of all the images as a json array.
The functions I generated with Amazon Q Developer:
  • Retrieve game assets (Allows me to easily add more photos and assets without changing the main game files)
  • Retrieve leaderboard scores
  • Submit new score
  • Log game events
To store the leaderboard and events data, I used the awesome DynamoDB, which has just recently had a massive 𝟓𝟎% 𝐏𝐫𝐢𝐜𝐞 𝐑𝐞𝐝𝐮𝐜𝐭𝐢𝐨𝐧 for on-demand throughput!
And finally, to host my staging and production environments I relied on Amplify which allowed me to have my game up and running in seconds.
To sum up, here are all the AWS Services used to make the game in about 3 days:
  • Amazon Q - to generate about 80% of the code
  • Bedrock - to generate the AI images and their variations
  • S3 - to store all of the asset files
  • CloudFront - to allow the assets to be accessible and load faster
  • Lambda - to host the backend functions that connect with S3 and DynamoDB
  • API Gateway - to allow the Lambda functions to be accessible from the frontend
  • DynamoDB - to store the leaderboard data and game events easily
  • Amplify - to host the game and handle performance
If you're ready to build your own game, AWS is running a hackathon through the month of November. From a simple tic tac toe game built with HTML/CSS/JS to a complex Unity game -- all skill levels and tech stacks are welcome.
First create your Builder ID here and then join on DevPost: https://awsdevchallenge.devpost.com for prizes of up to $150,000!
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

4 Comments