link

What Inspired Me

Like many developers, I was fascinated by how much fun and strategy Among Us offered with such simple mechanics. But as someone who's obsessed with cloud architecture and serverless solutions, I kept thinking: "What if you could scale a multiplayer game globally without managing a single server?" That led me down the rabbit hole of WebSockets, event-driven architectures, and the wonderful (and slightly chaotic) world of AWS.

How I Built It

The entire game runs on AWS Serverless technologies. Here's a breakdown of the core stack: API Gateway (WebSocket API): For real-time, bidirectional communication between players and the game. AWS Lambda: For processing game logic (movement, voting, sabotage, etc.) using stateless, scalable functions. DynamoDB: To persist player states, game sessions, roles, and votes—all without a traditional database. Amazon Cognito: For authenticating users and keeping impostors honest. S3 + CloudFront: To host the Unity WebGL game client and deliver it globally with minimal latency. CloudWatch & X-Ray: For observability, debugging, and tracing in real-time.

Challenges I Faced

WebSocket Disconnects: Players dropping mid-game could break logic. I used TTLs in DynamoDB and Lambda triggers to gracefully clean up zombie connections. Scaling Writes: With multiple players moving simultaneously, write spikes to DynamoDB became expensive. I implemented batched writes and on-demand capacity to keep costs low and performance high. Broadcast Costs: Broadcasting updates to every player meant multiple Lambda calls. I optimized this using batching and binary-encoded payloads. Cold Starts in Lambda: Some critical game logic functions were affected, so I used Provisioned Concurrency to keep them warm. Security: Ensuring players couldn't spoof actions was critical. I validated Cognito JWTs and used Lambda authorizers to lock things down.

What I Learned

How to design a truly event-driven architecture for real-time applications. The power (and quirks) of AWS WebSocket APIs. Real-world DynamoDB patterns like TTL, Streams, GSIs, and Transactions. Game logic doesn't have to live on a server—serverless gaming is real and viable. Debugging distributed systems with X-Ray feels like being a space detective.

Built With

Share this project:

Updates