- Notifications
You must be signed in to change notification settings - Fork285
StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
License
Blizzard/s2client-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The StarCraft II API provides access to in-game state observation and unit control. The API is a wrapper around protobuf defined protocol over a websocket connection.
While it's possible to write directly to the protocol, this library provides a C++ and class-based abstraction. You can see a simple example below.
#include<sc2api/sc2_api.h>#include<iostream>usingnamespacesc2;classBot :publicAgent {public:virtualvoidOnGameStart()final { std::cout <<"Hello, World!" << std::endl; }virtualvoidOnStep()final { std::cout <<Observation()->GetGameLoop() << std::endl; }};intmain(int argc,char* argv[]) { Coordinator coordinator; coordinator.LoadSettings(argc, argv); Bot bot; coordinator.SetParticipants({CreateParticipant(Race::Terran, &bot),CreateComputer(Race::Zerg) }); coordinator.LaunchStarcraft(); coordinator.StartGame(sc2::kMapBelShirVestigeLE);while (coordinator.Update()) { }return0;}
You can find a detailed tutorial on what this code does in docs/tutorial1.md.
You can find API in documentation on ourgithub pages site. The documentation is generated from code automatically, usingDoxygen
To editor and generate the documentation yourself.
- Download and installdoxygen
- Fork the repository and clone it locally
- Checkout the master branch 'git checkout origin/master -b my-documentation-update
- Make changes to the code documentation or docs/ files
- From the root of the project run: doxygen Doxyfile
- Review your documenation changes by opening docs/html/index.html in your browser
- Push your changes to your fork and send us a pull request
This library usesCMake to generate project files. It builds withVisual Studio on Windows and Makefiles on the other platforms. It relies on the following contrib packages.
- Civetweb
- Protobuf
- (optional) SDL
- ipv6-parse
Follow the instructions for submodules and building indocs/building.md.
We do our best to conform to the Google C++ Style Guide with the exception that we use four space tabs insteadof two space tabs.
This repository only comes with a few maps for testing.
Additional maps and replays can be foundhere.
If you are using Visual Studio 2017 and just want precompiled library files you can download the following package:
Additional community built AI libraries can be foundhere.
If you are new to programming, theCommandCenter framework may be a good starting point.
About
StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
