Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cpp-sc2/commandcenter
Original version of CommandCenter focused on the StarCraft 2 part of the bot.
https://github.com/cpp-sc2/commandcenter
ai artificial-intelligence bot cpp game sc2 starcraft-ii starcraft-ii-bot starcraft2 starter
Last synced: about 1 month ago
JSON representation
Original version of CommandCenter focused on the StarCraft 2 part of the bot.
- Host: GitHub
- URL: https://github.com/cpp-sc2/commandcenter
- Owner: cpp-sc2
- License: mit
- Fork: true (davechurchill/commandcenter)
- Created: 2020-10-20T14:48:44.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-13T04:22:21.000Z (12 months ago)
- Last Synced: 2024-08-02T13:19:18.687Z (5 months ago)
- Topics: ai, artificial-intelligence, bot, cpp, game, sc2, starcraft-ii, starcraft-ii-bot, starcraft2, starter
- Language: C++
- Homepage:
- Size: 2.64 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sc2-ai - cpp-sc2/commandcenter
README
# CommandCenter: AI Bot for Starcraft II
[![Build](https://github.com/cpp-sc2/commandcenter/actions/workflows/ci.yml/badge.svg)](https://github.com/cpp-sc2/commandcenter/actions/workflows/ci.yml)
The original CommandCenter is a StarCraft AI bot that can play both StarCraft: Broodwar and StarCraft 2. This fork is focused on the StarCraft 2 part of the bot.
![CommandCenter Screenshot](https://i.imgur.com/SbTymsO.jpg)
CommandCenter is written in C++ using fork of Blizzard's [StarCraft II AI API](https://github.com/cpp-sc2/cpp-sc2). It is written by [David Churchill](http://www.cs.mun.ca/~dchurchill/), Assistant Professor of [Computer Science](https://www.cs.mun.ca/) at Memorial University, and organizer of the [AIIDE StarCraft AI Competition](http://www.cs.mun.ca/~dchurchill/starcraftaicomp/).
CommandCenter is based on the architecture of [UAlbertaBot](https://github.com/davechurchill/ualbertabot/wiki), and is intended to be an easy to use architecture for you to quickly modify, play with, and build your own bot. The bot itself does not contain much in the way of hard-coded strategy or tactics, however it provides a good starting point for you to implement your own strategies for any race.
This CommandCenter fork currently provides the following features:
* Plays only Starcraft II
* Plays all 3 races with generalized micro controllers for combat units
* Performs online map analysis, extracting information such as base locations and expansions
* Keeps track of all previously seen enemy units and their last known locations on the map
* Has a WorkerManager which manages resource gathering and worker allocation / buiding
* Is able to carry out predefined build-orders written in a configuration file
* Allows you to easily create your own build-orders and modify them on the fly in-game
* Contains a building placement algorithm, finding the closest buildable location to a given position for a given building
* Scouts the map with a worker unit, discovering where the enemy base is located
* Once a specific condition has been reached (having 12 combat units, by default), it will commence an attack, sending waves of units at the enemy base
* Squads can be formed, consisting of multiple units following a specific order such as attack or defend a given locationCommandCenter should eventually have all of the functionality of UAlbertaBot, however much of its features are not currently completed. Here is an up-to-date list of features currently missing from CommandCenter that will be implemented soon:
* Only units and basic buildings can be constructed via the ProductionManager. No add-ons, research, or upgrades yet.
* There is no automatic build-order planning system
* There is no combat simulation package for predicting combat battle victory
* The bot only plays 1v1, and will have undefined behavior / crash if played against multiple enemies or on teams# Download and Run CommandCenter
StarCraft 2: You must have an up-to-date retail version of StarCraft II installed to run the bot. You must also download and install some maps to use with the bot, which you can find here: https://github.com/Blizzard/s2client-proto#downloads. Please note that there is a password provided on that page to extract the maps from the zip files.
The bot comes with a configuration file named [BotConfig.txt](https://github.com/davechurchill/commandcenter/blob/master/bin/BotConfig.txt) in which you can modify build orders, print various debug information to the screen, and set some bot parameters. You can define multiple builds orders in the 'Strategies' section of the file, and choose which named strategy to implement when the bot plays a specific race. Unit names in the build-order are case sensitive, and must be exactly how they appear in-game with no spaces. Some of the options in the configuration file are currently not implemented, such as the KiteWithRangedUnits option.
Please note that this config file is in JSON format, and the bot will not run unless it is well-formatted JSON. The configuration file must be in the same directory as CommandCenter.exe in order for the bot to run correctly. If you have made an error in the JSON syntax and can't find it on your own, you can use an online [JSON Validator](https://jsonlint.com/) to check for you.
By default when you run CommandCenter.exe, it will play as Random race vs. a Random race built-in SC2 Easy AI. You can modify which races are played in the configuration file via the "BotRace" and "EnemyRace" options. You can also modify which map to be played by specifying the "MapFile" option. Please note that the MapFile option is relative to your StarCraft II maps directory, which by default is located in your StarCraft_Install_Directory/maps/, and the bot will not run without specifying a valid map file.
If the bot crashes or does other nasty things, please bear with me while I make it more stable :)
# Developer Install / Compile Instructions
## Windows
* Download and install [Visual Studio 2017 or newer](https://www.visualstudio.com/downloads/)
* Install [CMake](https://cmake.org/download/) and do```bat
:: Get the project.
$ git clone [email protected]:cpp-sc2/commandcenter.git
$ cd commandcenter:: Create Visual Studio project files.
:: For Visual Studio 2022.
$ cmake -B build -G "Visual Studio 17 2022":: Build the project using Visual Studio.
:: The binary "CommandCenter_API.exe" should appear in the build/bin/ directory
$ start CommandCenter.sln:: Launch the bot with the specified path to a SC2 map.
:: Warning: The CommandCenter/bin/BotConfig.txt file must be in the same directory as the .exe to run properly
$ build\bin\Debug\CommandCenter.exe Ladder2019Season3/AcropolisLE.SC2Map
```## OS X
* Download and install XCode and XCode command-line tools.
* Install [CMake](https://cmake.org/download/).```bash
# Get the project.
$ git clone [email protected]:cpp-sc2/commandcenter.git && cd commandcenter# Generate CMake build tree
$ cmake -B build -G Xcode# Build the project.
$ cmake --build build --parallel --verbose# Launch the bot with the specified path to a SC2 map.
# Warning: The CommandCenter/bin/BotConfig.txt file must be in the same directory as the executable to run properly
$ build/bin/CommandCenter Ladder2019Season3/AcropolisLE.SC2Map
```## Linux
* Install 'gcc-c++' with C++17 support and the 'make' utility.
* Install [CMake](https://cmake.org/download/).```bash
# Get the project.
$ git clone [email protected]:cpp-sc2/commandcenter.git && cd commandcenter# Generate CMake build tree
$ cmake -B build# Build the project.
$ cmake --build build --parallel --verbose# Launch the bot with the specified path to a SC2 map.
# Warning: The CommandCenter/bin/BotConfig.txt file must be in the same directory as the executable to run properly
$ build/bin/CommandCenter Ladder2019Season3/AcropolisLE.SC2Map
```# Bot Development
If you are familiar with the architecture of UAlbertaBot, the logic of CommandCenter is quite similar. The biggest difference is that information relating to the map, baselocation, etc are no longer globally accessible. This data now lives inside the main CCBot class, and must be accessed via a reference to the instance of that class. Because of this, most classes in CommandCenter carry with them a reference to the bot's main CCBot object, from which all game related information, observations, and queries can be made.
An in-depth development guide will be coming soon, but please refer to the [UAlbertaBot wiki](https://github.com/davechurchill/ualbertabot/wiki) for now since the architecture is so similar (minus the build order planner and combat simulator).