DEV Community

kang wang
kang wang

Posted on AI-assisted

Building an AI-Directed Browser Roguelite with a Deterministic Baseline

I gave two coding agents the same brief: build a browser marble roguelite that can be played without an account or download.

The result is Marble Alchemy, with two public builds:

  • The AI Director build writes one bounded daily challenge with GLM-5.3 Flash, validates the rule locally, and lets Matter physics execute it in the browser.
  • The deterministic baseline keeps the same core loop while using fixed rules, so the comparison stays reproducible.

What we built

Both builds use TypeScript, Phaser, and Matter. Each has five stages, six upgrades, mouse and touch controls, procedural visuals, and synthesized audio. The public entry point lets a player choose either build, while the field guide explains the rules and evidence.

The AI layer is deliberately constrained. The model proposes a challenge; the game accepts only a bounded rule shape, then runs the actual collision and damage logic locally. The model does not decide whether a collision happened. That boundary makes the daily challenge inspectable and keeps the game playable when the model is unavailable.

Verification beyond the first screen

The Codex build started with four input and responsive-layout defects. After the fixes, 13 rule tests and 19 browser tests passed, and a normal UI run completed all five stages.

The fable build passed 24 unit tests and 19 end-to-end tests. In 12 random-aim runs it won 5 times and stalled 0 times. These are different protocols, so they are not one combined score.

What I learned

A model feature becomes easier to evaluate when its authority is small and its output has a deterministic execution boundary. It also makes debugging more concrete: a failure can be assigned to the prompt, validation, physics, input handling, or presentation instead of being treated as one vague AI result.

Play both builds: https://chaoschemy.com/

AI Director: https://chaoschemy.com/gpt6/?utm_source=devto&utm_campaign=engineering_note&utm_content=gpt6

Evidence guide: https://chaoschemy.com/guide.html?utm_source=devto&utm_campaign=engineering_note&utm_content=guide

Source and test evidence: https://github.com/convee/marble-alchemy

I would love feedback on the first impression, the comparison protocol, and the defects that remain after real interaction.

Top comments (0)