The Problem
Writing an autonomous game bot is easy to start and difficult to improve.
A bot can generate valid-looking code, but one successful match does not prove that its strategy is genuinely better. Players need repeatable experiments, measurable comparisons, historical evidence, and a safe way to promote only verified improvements.
Inspiration
GridBot Arena started with a simple question:
What if an AI coding assistant could improve a bot by playing against other bots, studying the results, and proposing the next version?
That idea evolved into two complementary AI capabilities:
- AI Bot Lab: a guided, user-friendly improvement workspace for turning goals and match evidence into a candidate strategy.
- Autonomous Evolver: a bounded experimentation engine that repeatedly generates, validates, benchmarks, and compares bot candidates.
Together, they make bot improvement feel less like prompting and guessing, and more like running a disciplined scientific experiment.
What We Built
GridBot Arena is a deterministic strategy arena for autonomous TypeScript bots. Players can:
- write or generate a bot;
- validate it against the GridBot rules;
- run deterministic practice matches;
- inspect match and replay evidence;
- ask Gemini to author or improve bot code;
- use AI Bot Lab to study selected historical matches;
- generate reviewable Bot DNA and strategy assessments;
- reuse compatible summaries and evidence across improvement sessions;
- use the Autonomous Evolver to test multiple candidate versions; and
- explicitly promote a verified candidate through the normal submission workflow.
AI Bot Lab
AI Bot Lab is designed for both technical and non-technical users. A player describes an improvement goal in plain language, selects a strategy preset, and optionally chooses completed practice matches as evidence.
The Lab then:
- interprets the player’s goal;
- creates a structured Bot DNA representation;
- extracts privacy-safe, deterministic replay facts;
- summarizes selected matches through bounded Gemini calls;
- builds compact campaign memory instead of sending huge raw replay payloads;
- generates a candidate proposal;
- validates the candidate through the existing server-authoritative pipeline;
- runs a factual practice campaign when available; and
- presents the evidence, candidate lineage, and recommendation for human review.
The Lab uses multiple bounded AI calls when necessary. Historical matches are summarized first, allowing later calls to work from compact evidence rather than exceeding the model context window.
The interface exposes progress through a guided workflow, active-stage feedback, audit history, advanced AI diagnostics, smart defaults, and clear recovery messages when Gemini is unavailable or rate-limited.
Autonomous Evolver
The Evolver is optimized for systematic experimentation. It begins with the active bot as a baseline and explores several candidate iterations against deterministic benchmark scenarios.
It:
- defines an optimization goal;
- collects trusted match evidence;
- asks Gemini to generate a candidate;
- validates the candidate in an isolated pipeline;
- plays bounded benchmark matches;
- compares score, win rate, deliveries, invalid actions, and other metrics;
- rejects candidates that do not improve the weighted objective;
- repairs or continues candidates when appropriate; and
- recommends the strongest verified candidate for human review.
The two systems share the same Gemini provider boundary, resilience layer, validation authority, evidence model, and promotion gate. AI Bot Lab provides a guided evidence-to-improvement experience, while the Evolver provides deeper iterative search.
Nothing becomes active automatically. Promotion is always an explicit human decision.
A Positive Evolution Run
For our demonstration, the Autonomous Evolver used Gemini 3.6 Flash with three bounded iterations on a 13×13 board.
The baseline achieved an average score of 20. Candidate results were:
| Version | Average score | Invalid actions | Result |
|---|---|---|---|
| Baseline | 20 | 0 | Starting point |
| Candidate 1 | 20 | 0 | Rejected |
| Candidate 2 | 30 | 0 | Improved |
| Candidate 3 | 35 | 0 | Best candidate |
The final candidate improved the score by 75% while preserving the zero-invalid-actions constraint. It was then promoted through the normal authenticated submission pathway.
AI Bot Lab complements this workflow by allowing a player to begin with selected historical matches, receive a compact evidence summary, and review a candidate strategy without needing to understand the underlying replay or model context limitations.
How We Built It
The backend is written in TypeScript with Fastify. The frontend uses React and Vite. The deterministic game engine remains server-authoritative, so every candidate is evaluated under the same rules, board, seed, opponents, and turn limit.
Gemini is accessed through a structured provider boundary shared by Bot Authoring, AI Bot Lab, Replay Coach, and the Autonomous Evolver. The shared recovery layer handles:
- transient API failures;
- rate limits;
- timeouts;
- exponential backoff;
- model switching;
- token-aware request preparation;
- bounded input and output sizes; and
- transparent fallback and partial outcomes.
AI Bot Lab avoids sending full replay payloads directly into every model request. It extracts verified replay features locally, summarizes matches through bounded calls, and stores compact campaign memory for subsequent steps.
The Evolver stores an auditable timeline for each run, including planning, candidate generation, validation, benchmarking, comparison, rejection, repair, and promotion events.
The Lab stores its own durable checkpoint, evidence ledger, Bot DNA, summaries, candidate lineage, campaign projections, and provider diagnostics. Sessions can be resumed, closed without deleting useful work, or restarted with compatible previous summaries when the user explicitly chooses to reuse them.
Candidate source remains untrusted until it passes the existing validator, sandbox, deterministic match runner, and server-side evaluation pipeline.
What We Learned
The most important lesson was that “failed” does not necessarily mean useless. A candidate can fail to improve the score while still proving that validation works, revealing a strategy weakness, or providing evidence for the next iteration.
We also learned that context management is a product problem, not only a model problem. Sending complete replay histories directly to an AI quickly becomes impractical. Extracting deterministic facts, summarizing them in stages, caching compatible memory, and showing users what was used creates a much more reliable workflow.
Model-generated code needs strong boundaries. The model should propose code and strategy ideas, but the deterministic engine must decide whether that code is valid, safe, reproducible, and actually better.
Finally, AI should not hide uncertainty. Users need to know whether Gemini succeeded, fell back to deterministic evidence, hit a rate limit, or produced a candidate that simply did not improve the objective.
Human approval remains important. Autonomous agents can explore many possibilities quickly, but players should decide which verified candidate becomes the active bot.
Challenges
The main challenges were:
- keeping simulations deterministic while testing generated code;
- preventing invalid or unsafe bot actions;
- fitting source, rules, evidence, and replay data within model token budgets;
- summarizing multiple matches without losing important strategic information;
- reusing previous AI work without silently using stale evidence;
- handling Gemini timeouts and rate limits without losing useful progress;
- supporting different board sizes, player counts, opponents, and turn limits;
- comparing candidates fairly against identical benchmark scenarios;
- explaining why a candidate was accepted, rejected, or unable to complete; and
- making the result understandable instead of showing users only “passed” or “failed.”
GridBot Arena addresses these challenges by combining Gemini’s generative capabilities with deterministic evaluation, staged evidence summarization, durable campaign memory, replay inspection, resilience controls, transparent diagnostics, and an explicit promotion gate.
The result is a unified AI-assisted improvement system: AI Bot Lab helps people understand and improve their bot, while Autonomous Evolver helps them explore what is possible.

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