pycraft2 is a Python package for implementing scripted bots for the real-time strategy game StarCraft II.
pycraft2 currently implements the s2client-proto state machine for:
- Local Bot vs Built-in AI.
- Local Bot vs Bot.
- Joining AI Arena ladder matches - with caveats discussed below.
What's missing?
While pycraft2 can launch a match and play it to completion, bots cannot currently be scripted to do anything as the raw data interfaces are still in development.
There is also the dependency issue when it comes to the AI Arena ladder. AI Arena currently uses sc2-ai-match-controller to facilitate matches between bots on the ladder. Each bot runs in a container created from aiarenaclient-bot-base, which installs all of the dependencies from the major StarCraft II scripted bot frameworks - including python-sc2. Therefore, using pycraft2 for ladder bot development must be done in conjunction with a bundler (e.g. Pyinstaller) to avoid conflicting dependencies.
pycraft2 is in the early stages of development. However, there is a definitive set of features which will be support as part of the 1.0 release:
- A unified interface for running local matches, specifically:
- Bot vs Built-in AI
- Bot vs Bot
- An interface to support play on the AI Arena ladder.
- AI Arena is the defacto ladder for scripted bots, so pycraft2 will provide first-class support for its interfaces.
- A complete implementation of the s2client-proto raw data interface.
- A complete implementation of the s2client-proto debug interface to enable a comprehensive test suite for pycraft2.
What pycraft2 will not implement are any "helper" abstractions for facilitating the development of scripted bot logic (e.g. a re-usable function for finding the nearest base expansion). pycraft2's design goal is to provide clear library interfaces to create, test, and launch scripted StarCraft II bots; this is a library, not a framework. The feature layer interfaceand rendered interface will also not be implemented.
Why release pycraft2 when the python-sc2 library and sharpy-sc2 framework already exist?
Three reasons:
- Personal interest
- Implementing what I believe to be a more concise and stable interface for s2client-proto.
- Investigating documentation holes in s2client-proto and related issues for scripted bot development.
If you are looking to start building scripted bots in Python today, then python-sc2 and sharpy-sc2 are both excellent resources to use. My own requirements have outgrown the architectural foundations of python-sc2, so I have committed to a ground-up rewrite.
For my personal interests, this is also an opportunity to experiment with various software designs, test new development tools, and document my findings to contribute to the StarCraft II AI community discord and AI Arena bot development resources.