StarCraft NeuroEvolution Unit AI

evolving the past, one generation at a time

NeuroEvolution, or better yet Real Time NeuroEvolution of Augmenting Topologies(rtNEAT) uses generic algorithms and selective breeding to both train and shape neural networks into their optimal configuration. The original C++ rtNEAT algorithm was developed at the University of Texas, at Austin by Dr. Kenneth Stanley.

My experiment in rtNEAT ported the C++ centered algorithm into a Java implementation and implemented both C++ and Java algorithms into StarCraft for performance and feasibility testing.

The 2010 AI and Interactive Digital Entertainment Conference hosted an AI StarCraft competition which pitted various StarCraft bots against one another in numerous setups. I used the Tier 1 tournament maps against the built in StarCraft computer to both train and test rtNEAT.

the Design

in the beginning

The design was simple, just like the goals, to build ever evolving, ever improving, autonomous agents. The approach I choose was a frugal approach based around the needs of the tier 1 AIIDE maps.

Two state managers were used:

the MapStateManager – kept the current state of the map geometry and was used for querying distance calculations between units and geometry

the UnitStateManager – kept knowledge about all current ally and known enemy units. Used for querying both ally and enemy distance, locations, and health.

Each ally was represented by a RtNeatUnit which contained StarCraft specific unit logic as well as a rtJavaNeat organism which determined the unit’s actions.

the Library

after the beginning

The library powering the neuroevolution algorithm was very closely modeled after the original rtNEAT implementation by Dr. Kenneth Stanley.

My implementation of the library though took a handful of shortcuts in order to speed up and short circuit implementation of recursion. The overall architecture of the neural networks, mutation, and evolution remained unchanged.

the Creation

in the wild

the Documentation

Because documentation always comes first!

the Tech

Libraries

The Brood War Application Programming Interface (BWAPI) is a free and open source C++ framework for creating AI modules for Starcraft: Broodwar. Using BWAPI, programmers can retrieve information on players and individual units in Starcraft as well as issue a wide variety of commands to units, opening the doors for custom AIs with new micro and macro algorithms.

Utilities

Chaoslauncher is a program which serves as a GUI for a number of Starcraft plugins. It supports plugins using the BWL4 format which fully integrate with the launcher, and DLLs which are directly injected into Starcraft.