Marble Madness: Humans vs Agents!
inspo
there was a massively popular, simple web game in the summer of 2015: agar.io. I've always been intrigued by the simplicity of those mechanics and I've always liked the isomorphic style of the marble madness arcade with its simple track ball control. So I thought this would be a great opportunity to put humans and agents head-to-head with a game that has simple mechanics and is fun at the same time
But why a game? most agent-enabled websites treat AI as an assistant operating behind the scenes.i wanted to explore something more playful: what happens when humans and agents become participants in the same real-time world? I wanted to switch the script up from people telling agents what to build and instead trying to play with them and see how they evolve in real time on the screen
the WebMCP Challenge asked how a project can become meaningfully better when people and agents use them together. This project explores the frontier of this where you are competing with an agent directly in real time.
Marble Madness was an ideal foundation. Its isometric courses reward planning, precise movement, recovery, and risk management—abilities that are interesting for humans and agents alike.
What We Built
We (codex and i) rebuilt Marble Madness as an eight-course, browser-based 3D arcade game with:
- Real-time marble physics and hazards
- Human controls through keyboard, touch, and device tilt
- Multiplayer races and shared leaderboards
- Extracted retro fonts, marble animations, objects, and course artwork
- Original course music and sound effects
- Distinct AI and natural-intelligence leaderboard identities
through WebMCP, an agent can directly use five structured game tools, finding out what tool should even be exposed was part of the fun of this project. At this point we have the following:
get_game_statesteer_trackballapply_brakestart_or_respawnsubmit_leaderboard_score
the agent receives structured information about position, velocity, terrain, hazards, objectives, and remaining time. It can then steer and brake without guessing where controls are on the screen.
humans still experience a colorful arcade game. Agents experience the same world as a stateful control problem.
How We Built It
the client is written in TypeScript and rendered with Three.js. A lightweight Node.js server hosts the game, maintains multiplayer state, and records leaderboard results, it offers users an oauth username fetch from github or twitter; but supports anonymous play. light ddos/griefing guardrails were added like DBSC and rate limiting via Caddy.
Physics runs on a fixed timestep,
$$ \Delta t = \frac{1}{60}\text{ seconds}, $$
so movement remains consistent across displays with different refresh rates. Steering applies acceleration to the marble while friction, slopes, collisions, surface materials, gravity, and braking shape its trajectory.
i extracted assets from the original sprite sheets rather than merely using them as visual references. The resulting runtime includes bitmap glyphs, animated marble frames, enemies, obstacles, goals, and other arcade objects.
WebMCP forms the control layer between the browser and an agent. Instead of translating generated mouse movements into uncertain UI actions, the agent invokes narrowly defined gameplay operations with validated arguments.
What We Learned
Games are surprisingly effective environments for human-agent collaboration. They provide immediate feedback, measurable objectives, consequences for poor decisions, and countless opportunities for recovery.
I also learned that exposing an action is not enough. An agent needs useful state, clear tool semantics, bounded inputs, and feedback explaining what changed after every action.
The best interface was not one giant “play the game” command. It was a small vocabulary of composable actions that preserves decision-making:
- Observe the world.
- Choose a direction and force.
- Apply an impulse.
- Reassess the result.
- Brake or correct course.
That loop makes the agent an actual player rather than a scripted animation.
A custom trackball with real haptics that renders with the game renderer on mobile, foldablles, and desktop.. The desktop track ball controls are pretty wild as we wanted to handicap players with a bigger screen, but you should be able to figure it out. It's fun!

Challenges: Haptics on the web!
The hardest challenge was balancing arcade responsiveness with reliable agent control. Early physics moved too quickly and varied with browser refresh rate. Fixed-step simulation, browser-driven gameplay tests, and measurable speed limits made tuning reproducible.
Restoring the visual identity was another substantial task. The source artwork arrived as packed sprite sheets, so we built extraction and validation pipelines for fonts, marble animation frames, objects, enemies, and transparency.
Audio presented a similar problem because the original files had opaque numeric names. We audited every track, created explicit course mappings, normalized playback levels, and added a persistent music-volume control.

We were surprised to learn that rich haptics are just not possible on the web today even on mobile, which prompted us to scope creep a bit and build a native android rapper so we could get access to sub 20 ms haptic feedback for the track ball. The height maps and the collision maps for each of the levels was much harder than I originally thought it took. Let's see GPT56 tried five times fable five tried once fable 5.1 tried twice Gemini 37 tried twice. It was a disaster.!
Finally, multiplayer introduced identity and synchronization problems that do not appear in a single-player demo. We had to distinguish humans from agents, filter duplicate self-rendering, synchronize remote marbles, and keep gameplay responsive despite network updates.
If you have an android try out our android app with wicked trackball control! Its only 500KB!
- Sign in to the Google account used by your Android Play Store.
- Join the Marbles Alpha Testers group: https://groups.google.com/g/marbles-alpha-testers-2026
- Using the same Google account, open the Marbles testing page: https://play.google.com/apps/testing/build.secure.marbles
- Select “Become a tester.”
- Follow the Google Play instructions to install or update Marbles. The testing page will become available after Google finishes reviewing the release. Make sure the same Google account is selected in Google Groups and the Play Store. Remain in the group while testing.
What’s Next
I want to develop better agent racing strategies, cooperative team modes, replayable agent traces, and courses where humans and agents must coordinate rather than simply compete.
marble madness: humans vs agents demonstrates that an agent-ready web does not have to feel like automation software. It can feel like an arcade—shared, competitive, unpredictable, and fun!! Try it now and dm me if you enjoyed: maceip on twitter
Built With
- android-cli
- codex
- d3.js

Log in or sign up for Devpost to join the conversation.