Inspiration
We wanted to design an AI that thinks like a detective — analyzing the grid, predicting danger, and planning survival. The idea of using geometric reasoning instead of brute-force learning inspired us to build CentroidMind, an agent that “feels” balance rather than just reacting to walls.
What It Does
CentroidMind intelligently navigates a 2D grid, competing head-to-head against another AI. It uses: A weighted centroid to identify the safest central zone of open cells. A guard system to predict and avoid head-on collisions. Seal mode to trap the opponent when a chokepoint appears. Solo mode to efficiently fill space when isolated.
How We Built It
Implemented entirely in Python (Flask) with modular decision logic. The agent processes each state, evaluates possible moves with BFS, Voronoi scoring, and centroid heuristics. Dockerized using a lightweight Python image for CPU-only builds. Tested locally using the provided judge simulation for fairness and symmetry.
Challenges We Ran Into
Early models drifted downward due to hidden directional bias. Symmetric starts caused inconsistent results. Planning seal paths sometimes caused self-traps. We solved these with axis alternation, mirror-safe logic, and guard-checked path planning.
Accomplishments We’re Proud Of
Built a mirror-safe AI that performs equally from top or bottom halves. Created a weighted centroid heuristic that guides moves like a geometric compass. Achieved draws or wins in symmetric setups — showing balanced intelligence, not luck.
What We Learned
Subtle design choices — even in tie-breaking or direction ordering — can dramatically alter behavior. True AI “strategy” comes from harmony between spatial awareness and survival instinct.
What’s Next for CentroidMind
We plan to integrate Monte Carlo lookahead for deeper foresight and self-play tuning to refine move weighting, bringing CentroidMind closer to a fully adaptive game theorist.

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