Skip to content

alkurbatov/suvorov-bot

Repository files navigation

suvorov-bot

Build Status

About

Starcraft 2 rule-based bot capable to play for all races.

Suvorov currently provides the following features:

  • Supports Windows, OS X and Linux.
  • Plays all 3 races.
  • Manages resource gathering and worker allocation.
  • Supports all available buildings upgrades (e.g. Orbital Command, Planetary Fortress, Lair).
  • Supports all available zerg units mutations (e.g. Overseer, Baneling, Ravager).
  • Calls down MULEs, casts chronoboost.
  • Builds Terran addons.
  • Warps in gate units.
  • Automatically builds new supplies when needed.
  • Supports launch under Sc2LadderServer.

Notable forks

Support

Feel free to post questions on the unofficial Starcraft II AI Discord server. Invite Link

Build requirements

  1. Download the actual map pack.

  2. Put the downloaded maps into the Maps folder (create it if the folder doesn't exist):

  • Windows: C:\Program Files\StarCraft II\Maps
  • OS X: /Applications/StarCraft II/Maps
  • Linux: anywhere.
  1. Download and install CMake.

  2. A compiler with C++14 support.

  3. Windows: Download and install Visual Studio (2019 or older).

  4. Linux: Install 'gcc-c++'.

  5. Linux: Install the 'make' utility.

  6. OS X: Install XCode.

  7. OS X: Install XCode command-line tools.

Build instructions

Windows (Visual Studio)

:: Get the project.
$ git clone --recursive git@github.com:alkurbatov/suvorov-bot.git
$ cd suvorov-bot

:: Generate Visual Studio project files.
$ cmake -B build -G "Visual Studio 16 2019"

:: Start Visual Studio and build the project.
$ start build/Suvorov.sln

:: Launch the bot with the specified path to a SC2 map, e.g.
$ build\bin\Debug\Suvorov.exe Ladder2019Season3/AcropolisLE.SC2Map

Linux (cmdline)

# Get the project.
$ git clone --recursive [email protected]:alkurbatov/suvorov-bot.git && cd suvorov-bot

# Generate a Makefile.
# Use 'cmake -DCMAKE_BUILD_TYPE=Debug ../' if debuginfo is needed.
$ cmake -B build

# Build the project.
$ cmake --build build --parallel

# Launch the bot with the specified absolute path to a SC2 map, e.g.
$ ./build/bin/Suvorov "/Users/alkurbatov/work/tmp/Ladder2019Season3/AcropolisLE.SC2Map"

OS X (Xcode)

# Get the project.
$ git clone --recursive [email protected]:alkurbatov/suvorov-bot.git && cd suvorov-bot

# Generate a Makefile.
# Use 'cmake -DCMAKE_BUILD_TYPE=Debug ../' if debuginfo is needed.
$ cmake -B build -G Xcode

# Start Xcode and build the project.
$ open build/Suvorov.xcodeproj

# Launch the bot with the specified path to a SC2 map, e.g.
$ ./build/bin/Suvorov "Ladder2019Season3/AcropolisLE.SC2Map"

Additional options

Game client version

By default, the API assumes the latest version of the game client. The assumed version can be found in cmake's output, e.g.:

$ cmake ../ | grep 'SC2 version'
Target SC2 version: 5.0.5
...

However, sometimes one may need to compile with an older version of the game, e.g. to play with a Linux build which is always behind the Windows version. It is possible by specifying the game version manually, e.g.:

$ cmake -DSC2_VERSION=4.10.0 ../

AIArena ladder build

To compile a bot capable to play on the AIArena ladder, configure the project in the following way:

$ cmake -DBUILD_FOR_LADDER=ON -DSC2_VERSION=4.10.0 ../

Coding Standard

We follow slightly modified Google C++ Style Guide. See the linter job in GitHub Actions CI.

License

Copyright (c) 2017-2022 Alexander Kurbatov

Licensed under the MIT license.