Competition AI · Systems Design · Java · 2025

Battlecode Bot

An autonomous strategy agent built for MIT's annual programming competition — where the battlefield is a grid, the units are code, and every decision you make costs you something.

MATCH RESULT — STRATEGY LOG

Units deployed. Resources allocated. Objective: outlast, outmaneuver, win.

Overview

Battlecode is MIT's annual programming competition where teams build autonomous bots to fight for control of a simulated battlefield — no human input once the match starts. That year's game had units called rats and cats. The strategy space is enormous: when to build, when to attack, when to hold, when to spend resources and when to hoard them.

My teammate handled pathfinding and cheese — an exploitative early-game strategy designed to catch opponents off-guard. I owned strategy design: specifically two modes I developed, Kingbuilder and Kamikaze.

Kingbuilder, Kamikaze, and What Actually Worked

Kingbuilder: I discovered you could spawn multiple kings. My instinct was that more kings meant more power — so I designed a mode built around building as many as possible. It was wrong. Multiple kings tripled resource costs and starved the rest of the army. The theory was sound on paper. The math killed it in practice. I learned more from that failure than from most things that worked.

Kamikaze: This one worked. The baby rats would relentlessly swarm the cats — no retreat, just pure aggression on target. Combined with my teammate's cheese keeping opponents pinned high up on the map, the kamikazes had room to work. At our peak they were dealing over 3,000 damage to the cats in a single engagement.

I designed the code with tweakable knobs throughout — adjustable parameters that let me dial in thresholds and find the sweet spots without rewriting logic every iteration. Resource management was a constant tension across both modes: the Kingbuilder needed too much, the Kamikaze mode needed just enough to keep the swarm alive long enough to do damage.

Outcome

A competition entry with two distinct strategic modes — one that worked and one that taught us why it didn't. The project built real fluency in game AI, resource constraint reasoning, and iterative tuning. It also confirmed that the most interesting engineering problems are the ones where your intuition is wrong and the math tells you why.