-
Notifications
You must be signed in to change notification settings - Fork 182
FAQ
Should I use the pysc2 or python-sc2 library?
If you plan on making scripted hardcoded bots, python-sc2 is simpler in its syntax.
If you want to make a machine learning/deep learning bot, pysc2 is probably the better choice since it uses the UI and feature layers (spatial interfaces).
Feel free to take a look at the protoss/terran/zerg examples.
You have access to:
-
all the basic BotAI class properties and functions listed here and here through
self.<property_name>
which contain basic functions that handle macromanagement, -
all the game state variables through
self.state.<variable_name>
which contain data that can change each step, -
all the game info variables through
self._game_info.<variable_name>
which contain static map and player related data, -
all the game data variables through
self._game_data.<variable_name>
which contain static unit/ability/buff related data, -
your units
self.units
and visible enemy unitsself.known_enemy_units
which is a list-like object and contain units of typeUnit
. Both have properties and functions available.
realtime=False will wait for your bot step to finish before confirming the next game loop.
realtime=True on the other hand will not wait and will strictly continue. So your bot will only have a fixed amount of time to complete its step before the next game loop is called, regardless if your bot step is finished or not. That means calculating placement locations using self.find_placement()
or self.expand_now()
may result in a delayed action.
Bots that have been put on the Bot ladder can be found here:
- Bot by Hannessa
- Bot by BuRny
- a collection of ladder bots (not restricted to python-sc2) https://github.com/m1ndgames/sc2ai-ladderbot-collection
Also the source code of bots from the ladder are sometimes publicly available.
The command to install from github is
pip install --upgrade git+https://github.com/Dentosal/python-sc2.git