In this session we explore how @chad (Dogtato) structures his botβs micro using a layered decision tree that gives every unit self-sufficient behavior β from dodging banelings to retreating toward allies that counter its threats.
Key Takeaways
Layered decision tree per unit β Every unit runs through the same priority chain: avoid effects β use ability β move to repair β attack β retreat β move to position. Each step can be overridden per unit type via subclassing.
Factory pattern for micro instances β MicroFactory.get_micro(unit) returns the correct subclass (MarineMicro, SiegeTankMicro, etc.), so you just call micro.move(position) without worrying about unit-specific logic.
Retreat toward counters, not just away β Instead of fleeing randomly, units retreat toward allies that counter their current threat. Marines retreat toward bunkers; ground units retreat toward tanks. This turns retreat into a tactical repositioning.
Squad-level tactics, individual-level micro β The military class handles high-level decisions (attack, defend, retreat as a group) and tells squads where to go. Individual micro handles the moment-to-moment: kiting, dodging, stutter-stepping. The two layers donβt need to know about each other.
Perfectable unit behavior β Dogtato views each unitβs micro as independently perfectable. You can tweak Siege Tank siege/unsiege logic without touching Marine kiting. Add a new unit type by subclassing BaseUnitMicro and overriding only whatβs different.
Swarm intelligence from simple rules β No central coordinator tells units what to do in combat. Each unit evaluates threats, picks targets, and retreats based on local information, producing coordinated behavior without coordination code.