MIT Battlecode

MIT Battlecode

AI algorithms for robot swarms playing a real-time strategy game

2023AIAlgorithmsGitHubWebsite
Heads Up!

This writeup is a work in progress. I will be updating it with more details in the coming months.

Overview

MIT Battlecode is an annual programming competition run over MIT's Independent Activities Period (IAP) where participants design AI to control a swarm of robots in a real-time strategy game. Teams write code that makes autonomous decisions for resource collection, combat, and territorial control — all without human intervention during matches.

My team, Beaver Bois, competed in three tournaments in Battlecode 2023, including Sprint 1 (Jan. 17), Sprint 2 (Jan. 24) and finally the U.S. Qualifiers (Jan. 30). As freshman in college, we placed 25th in the 96-team qualifying tournament for U.S. college students.


Competition

Battlecode presents unique challenges:

  • Distributed AI: Each robot runs the same code independently
  • Limited Communication: Robots can only share limited information
  • Resource Management: Balance between resource collection and military operations
  • Fog of War: Incomplete information about enemy positions
  • Bytecode Limits: Strict computational budget per turn

Technical Approach

Key technical elements of our strategy:

  • Pathfinding: Efficient navigation with obstacle avoidance
  • Communication Protocol: Encoded messages for swarm coordination
  • State Machines: Behavior transitions based on game state
  • Heuristic Evaluation: Scoring positions and targets
  • Emergent Behavior: Simple local rules creating complex swarm tactics