
Weekend Showcase Challenge: The Infinite Enigma — An Autonomous AI Game Master
Every puzzle game hits the same wall — eventually, you finish all the levels. Designers can't create content fast enough, and players move on. The Infinite Enigma eliminates this problem entirely by replacing the human game designer with an autonomous AI "Game Master" that procedurally generates a completely new visual puzzle, logic challenge, or technical assessment every single day — forever, without human intervention.
🧩 The Vision: A Puzzle Game That Never Ends
Every puzzle game hits the same wall — eventually, you finish all the levels. Designers can't create content fast enough, and players move on. The Infinite Enigma eliminates this problem entirely by replacing the human game designer with an autonomous AI "Game Master" that procedurally generates a completely new visual puzzle, logic challenge, or technical assessment every single day — forever, without human intervention.
But this isn't random generation. The agent is intelligent and adaptive. Every morning, it evaluates how the community performed on yesterday's challenge. If 80% of players solved it in under two minutes, today's enigma will be significantly harder — more complex logic chains, subtler clues, carefully placed red herrings. If players struggled (under 20% solve rate), the agent dials back the difficulty. The system targets a 30–50% solve rate — the psychological sweet spot that keeps players challenged but not frustrated.
Here's how it works for players:
- Visit the platform → see today's AI-generated puzzle complete with narrative backstory, a photorealistic visual environment, and layered clues
- Attempt to solve → submit your answer → earn points calculated from speed, puzzle difficulty, and how many hints you used
- Climb the global leaderboard → compete with the community daily
- Come back tomorrow → a completely new, difficulty-adjusted challenge awaits
The puzzle types rotate between logic grids, ciphers, pattern sequences, spatial reasoning challenges, circuit traces, code-breaking exercises, and mathematical puzzles. No two days are ever the same, and the difficulty curve is always personalized to the community's skill level.
🛠️ How I Built It
The Process
I built The Infinite Enigma over the final weekend of the AWS Summer Showcase Challenge. The core architectural insight was that Amazon Bedrock's multi-modal capabilities — text generation paired with image generation — could replace an entire game design team when orchestrated within a single Lambda function.
Key Design Decisions
- Fully serverless, zero idle cost — The entire platform runs on Lambda + EventBridge. Between player interactions, the infrastructure cost is literally $0. The Game Master "wakes up" once at midnight, does its work, and goes back to sleep.
- Separation of generation and serving — The daily generator Lambda (triggered by EventBridge cron) handles the expensive Bedrock calls once per day. The three API Lambdas that serve players simply read from DynamoDB — sub-50ms responses, minimal cost.
- Adaptive difficulty as a feedback loop — Rather than hand-tuning difficulty levels, I built an algorithm that treats yesterday's community performance metrics as direct input to today's generation prompt. This creates a self-balancing system that evolves with the playerbase.
- Progressive hint system with scoring trade-offs — Players can request up to 3 hints per puzzle, but each hint costs 25% of their base score. This adds a strategic decision layer on top of the puzzle itself — do you sacrifice points for guidance, or push through for the full reward?
Challenges Faced
- Prompt engineering for consistent puzzle quality — Getting Nova Pro to reliably output valid, logically solvable puzzles with exactly one correct answer required extensive prompt iteration. The breakthrough was providing an exact JSON schema and a detailed difficulty rubric (1–10 scale with specific examples for each band).
- Nova Canvas integration for meaningful visuals — Ensuring generated images embed visual clues relevant to the puzzle (rather than generic atmospheric art) required chaining the puzzle's
visual_promptfield with strict style constraints and negative prompts.
- DynamoDB schema design — Balancing query flexibility with cost efficiency led me to implement GSIs for date-based lookups (fetching today's challenge) and challenge-based submission aggregation (calculating solve rates).
☁️ AWS Services & Architecture Overview
Service | Role in the Architecture |
|---|---|
Amazon Bedrock (Nova Pro) | Generates puzzle logic, narrative backstory, clues, hints, and the verified solution |
Amazon Bedrock (Nova Canvas) | Renders the photorealistic visual environment that embeds the day's clues |
AWS Lambda | 4 functions — Daily Generator agent + GetChallenge + SubmitAnswer + GetLeaderboard |
Amazon EventBridge | Cron rule triggers the Game Master at midnight IST daily |
Amazon DynamoDB | 3 tables: Challenges, Submissions, Leaderboard (PAY_PER_REQUEST billing) |
Amazon S3 | Stores generated puzzle images with public read access |
Amazon API Gateway | REST API with full CORS support for the frontend |
AWS SAM | Infrastructure-as-code — the entire stack defined in a single template.yaml |
Architecture Flow
EventBridge (cron @midnight IST) → Lambda [Daily Generator — The Game Master] → DynamoDB [Read yesterday's solve rate & avg time] → Bedrock Nova Pro [Generate adaptive puzzle JSON] → Bedrock Nova Canvas [Render visual environment] → S3 [Upload puzzle image] → DynamoDB [Publish new challenge]
Players (browser frontend) → API Gateway → Lambda [GetChallenge] → DynamoDB (read active puzzle) → Lambda [SubmitAnswer] → DynamoDB (validate, score, update leaderboard) → Lambda [GetLeaderboard] → DynamoDB (return top players)
The entire infrastructure deploys in under 3 minutes with
sam build && sam deploy --guided . Twenty-one AWS resources are created automatically from a single template.
📚 What I Learned Across the Summer
This summer's AWS challenges took me from "I know what Lambda is" to "I can architect autonomous multi-service agent systems." Here are the five biggest takeaways:
- Bedrock is production-ready for generative pipelines — Multi-modal orchestration (text generation → image generation in a single Lambda invocation) works seamlessly. The Nova models are fast, the API is clean, and costs stay predictable.
- EventBridge + Lambda = autonomous agents — You don't need a server running 24/7 to build "always-on" intelligent systems. A cron rule waking a Lambda function once a day is all it takes. This pattern powered my MealPlanner, my WeeklyDigest, and now The Infinite Enigma.
- Feedback loops are what separate generation from intelligence — Static AI generation is impressive, but piping output metrics back as input to the next generation cycle creates genuinely adaptive, self-improving behavior.
- SAM makes iteration dangerously fast — Going from idea to fully deployed cloud infrastructure in under an hour removes all friction between "what if" and "let's try it." Template-driven IaC is a superpower.
- Design your DynamoDB schemas upfront — Getting partition keys, sort keys, and GSIs right from the start saves painful migrations later. I learned this the hard way on earlier projects this summer.
🔗 Repository
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article