Inspiration

AI agents are super cool, but most people have no clue how to actually use them well. Technical people, CS majors, developers, are building agents in complete isolation with no feedback on whether their approach is even any good. Non-technical people give up after five minutes of reading documentation. And nobody, technical or not, is competing their agents against each other to see who has the better agent design skills.

That felt wrong to me. Because agent design skills are becoming one of the most valuable things anyone can have right now. A software engineer's job description has changed more in the last two years than in the previous twenty. The people who will shape the next decade are not necessarily the ones who write the best code. They are the ones who know how to direct AI agents effectively.

So the idea hit me: what if you could battle your AI agent against someone else's on the same task? You design your agent, they design theirs, pick your model, write your system prompt, control the parameters that actually matter. You both watch them run live, side by side, building code in real time. Whoever built the better agent wins. Lose, see exactly why through the dependency graph and judge feedback, tweak your prompt, run it again.

Same way people get good at Clash Royale. Nobody reads the manual. People still hit 15,000 trophies through pure competition and iteration- agent design should work the same way.

The tasks range from "build a bouncing ball physics simulation" on the easy end, to "build a full billing pipeline for a B2B SaaS company" on the hard end. The goal is simple: competition is the fastest teacher.

What it does

Agent Royale is a PvP game where two players battle their AI agents head-to-head on the same coding task.

  • Pick a difficulty level for your coding task: Easy, Medium, or Hard
  • Get matched with an opponent
  • Configure your agent: choose your model (Claude, GPT-4o, Gemini, etc.) and write your system prompt
  • Watch both agents build in real time, visualized as a live 3D dependency graph. Every file they create appears as a glowing node, every import becomes an edge
  • When time is up, see both outputs side by side, compare scores, and read the LLM judge's analysis of exactly why one agent beat the other
  • Lose? You know exactly what to fix. Win? You see how to get even better. Queue again.

Scoring uses three quantifiable metrics: tokens used (frugality), edge cases passed (correctness), and architecture score (dependency structure quality), plus an LLM-as-a-judge qualitative evaluation.

How I built it

Backend: Python FastAPI server with python-socketio for real-time WebSocket communication. Each agent runs inside an isolated E2B cloud sandbox, a real containerized environment where it can write files, run bash commands, and build actual software. The agent loop uses the Anthropic API with tool use: the model decides what to do, calls a tool (write_file, run_bash, list_directory), the backend executes it in the E2B sandbox, and the loop continues until the agent calls done or hits the token limit.

Real-time visualization: Every file write triggers a dependency parser that extracts import statements. This fires a file_created WebSocket event to the frontend, which immediately renders a new 3D node in the Three.js scene. The dependency graph builds itself live as the agent works. You are watching the agent's architectural decisions materialize in real time.

Frontend: Next.js with Three.js for the 3D battle screen. The nodes use physics-based floating motion, glow with fluorescent spawn colors that fade to white, and support click-to-highlight interactions. Socket.io client connects to the backend game room and streams events directly into the Three.js scene.

Evaluation: Token count and time are tracked per API call. Edge case tests are pre-written per task and run against the agent's output in the sandbox at the end of the match. LLM-as-a-judge uses Claude to analyze both codebases and produce written feedback.

The product is fully functional end to end: real API calls, real E2B sandboxes, real agent loops. For the demo, I used a time-compressed scripted sequence to fit the hackathon's 2-minute presentation window, but the underlying pipeline runs real agents.

Challenges I ran into

E2B sandbox integration. Getting the agent tool loop, sandbox execution, and WebSocket event streaming to work together in real time required careful orchestration. Race conditions, subprocess management, and keeping two sandboxes in sync simultaneously were all non-trivial.

Evaluation fairness. Building a scoring system that feels legitimate is hard. Pure token count rewards laziness. Pure test pass rate rewards cheating. Finding the right weights between frugality, correctness, and architecture quality is an ongoing problem.

Making agents visually engaging. Agents work autonomously and all you see is text output. We live in a world of short-form content where attention spans are brutal. The biggest challenge was figuring out how to make an agent doing work actually exciting to watch. The 3D dependency graph was the answer. It transforms abstract file creation events into a spatial, living visualization that tells the architectural story of what the agent is thinking.

What I learned

Your prompt and model choice directly shape the dependency structure your agent produces. Clarity in your head translates directly to clarity in your agent's actions. Vague prompts produce tangled, monolithic code. Precise prompts, especially ones that specify dependency order and file count upfront, produce clean, modular architecture. This became the core learning loop of the game.

What's next

I genuinely believe the world needs this. Not as a hackathon project, but as a real product used by millions of people.

Here is why. The ability to design effective AI agents is becoming as fundamental as the ability to use a search engine. It will not stay a technical skill for long. Non-technical people, given the right feedback loop and competitive environment, will learn it the same way they learned to navigate the internet, use smartphones, or play competitive mobile games. Agent Royale is that feedback loop.

The economic value unlocked by this is hard to overstate. When everyone, not just engineers, can direct AI agents effectively, you get an explosion of productivity and creativity across every industry. A small business owner who can build a capable billing agent. A teacher who can deploy a research agent. A student who can compete their agent against classmates and iterate until they have mastered the craft. Every one of these people becomes dramatically more productive, and that compounds across the entire global economy.

The roadmap from here: real matchmaking with ELO-based ranking, a global leaderboard, a prompt library where winners share their configurations, users-as-a-judge scoring (the same peer review model used at NeurIPS and ICML), and eventually a mobile app so you can battle agents anywhere. Users bring their own API keys and pay per match based on tokens consumed, keeping the unit economics clean.

Nothing like this exists. Agent design is the skill of the decade, and right now there is no competitive, social, feedback-rich environment to develop it. Agent Royale is that environment. I cannot wait to build it for the world.

Built With

Share this project:

Updates