Giter Site home page Giter Site logo

blank-bot's Introduction

blank-bot

Build

About

Starter bot for StarCraft II with integrated cpp-sc2.

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++17 support.

  3. Windows: Download and install Visual Studio (2017 or newer).

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

  5. Linux: Install the 'make' utility.

  6. OS X: Install XCode.

Build instructions

Windows (Visual Studio)

:: Get the project.
$ git clone git@github.com:cpp-sc2/blank-bot.git
$ cd blank-bot

:: Create Visual Studio project files in the directory "build".
:: For Visual Studio 2022
$ cmake -B build -G "Visual Studio 17 2022"

:: Build the project using Visual Studio.
$ start build\BlankBot.sln

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

Linux (command line)

# Get the project.
$ git clone [email protected]:cpp-sc2/blank-bot.git && cd blank-bot

# Generate CMake build tree.
$ cmake -B build

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

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

OS X (Xcode)

# Get the project.
$ git clone [email protected]:cpp-sc2/blank-bot.git && cd blank-bot

# Generate CMake build tree.
$ cmake -B build -G Xcode

# Build the project using Xcode.
$ open build/BlankBot.xcodeproj

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

Additional options

WSL2 Support

Cross compiling for Windows under WSL2 is supported through cpp-sc2. See the cpp-sc2 documentation for build requirements. The build flag remains the same, setting -DWSL_CROSS_COMPILE=ON.

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 -B build 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 -B build -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 -B build -DBUILD_FOR_LADDER=ON -DSC2_VERSION=4.10.0

Managing CMake dependencies

BlankBot uses the CMake FetchContent module to manage and collect dependencies. To use a version of cpp-sc2 outside of the pinned commit, modify the GIT_REPOSITORY and/or the GIT_TAG in cmake/cpp_sc2.cmake:

...
FetchContent_Declare(
    cpp_sc2
    GIT_REPOSITORY <target-cpp-sc2-git-rep>
    GIT_TAG <git-commit-hash>
)
FetchContent_MakeAvailable(cpp_sc2)
...

With the updated configuration, re-run the build configuration and the dependency will be updated to the new configuration:

$ cmake -B build

Troubleshooting

If you see that some of cmake options don't take effect (e.g. project was configured with cmake -B build -DBUILD_FOR_LADDER=ON and a bit later with cmake -B build) remove the build folder or the CMakeCache.txt file, or explicitly re-specify the desired default behavior (e.g. cmake -B build -DBUILD_FOR_LADDER=OFF).

License

Copyright (c) 2021-2024 Alexander Kurbatov

Licensed under the MIT license.

blank-bot's People

Contributors

alkurbatov avatar jrtknauer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.