AWS Logo
Menu
Multiplayer Photo Game with AWS: Bringing People Together

Multiplayer Photo Game with AWS: Bringing People Together

Discover how we built a multiplayer photo game using AWS services to foster connection, friendly competition, and the joy of sharing memories with loved ones

Published Jan 4, 2025
Staying connected with friends and family in today's busy world can be challenging. To make it easier and more fun, we created a multiplayer game where players gather in virtual rooms, upload pictures based on prompts, and vote for the best one. This simple yet engaging game fosters connection and friendly competition, all built using powerful AWS tools.
Let's take a closer look at how we built it:
The Game Flow:
  • Create or join a room: Players can start a game by creating or joining a virtual room through a user- friendly web interface
  • Get a prompt: Each round kicks off with a creative prompt (ex: "Show your favorite outdoor photo")
  • Upload pictures: Players submit photos that fit the prompt, keeping the competition lighthearted and entertaining
  • Vote: Everyone votes for their favorite photo, and scores are tallied across multiple rounds to determine the winner
  • Display the winner in the UI
AWS: The Engine Behind the Game
  1. AWS Step Functions for Game State Orchestration
    Step Functions coordinate the game's workflow and provide a simple and robust way to express game state and flow. It mostly calls AWS Lambdas (explained in the next point) and the API Gateway connection management endpoint to send messages to the clients. We used Amazon Q extensively during the development of our state machine as it helps greatly with iteration speed.
  2. AWS Lambda for Backend Logic
    With Lambda, the application scales effortlessly, accommodating players without server management overhead.Lambda functions form the core of the game logic, including:
    - Managing game rooms and player interactions- Generating prompts for each round- Validating and processing photo uploads
    With assistance from Amazon Q, we were able to quickly integrate the management of other services (ex: Step Function callbacks), in the end saving us hours of researching in online documentation.
  3. AWS API Gateway
    Using API Gateway with websocket support allows instant notifications for new prompts, submission, and voting results and updated scores. Its low-latency performance ensures smooth and responsive gameplay. The integration with Step Functions allows us to send messages to clients without having to add any code for managing the connections.
  4. S3 for Storage
    We used S3 to create pre-signed URLs which can be used by clients directly to upload photos with minimal overhead.
    S3 also serves the resources for our React Native Web app
All of the above resources were created using AWS Serverless Application Model. Amazon Q also saved us a lot of time while creating the template. We used its suggestions to generate the resource syntax, making tweaks as needed when setting parameters.
Why we built this game:
This game offers a refreshing way to connect with others. It's great for staying in touch. Whether you're far from loved ones or just looking for a new way to bond, sharing memories through photos creates a sense of connection. This game allows players to relive special moments while enjoying a fun and interactive experience together.
PS: We wanted to give a big shoutout to Amazon Q for always being available to answer our questions and help us build the backend for this app!
 

Comments