From Starcraft 2 AI
Jump to: navigation, search

(please add your problems here if you don't find yours here)


CommandCenter bot Compile Error: "Cannot open include file: 'corecrt.h': No such file or directory"

On Windows, several people have gotten this error.

  1. Go to the file menu Project->"Command Center Properties", and then choose the "VC++ Directories" in the left sidebar.
  2. Make sure "Include Directories" includes the entry "C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;"
  3. Make sure "Library Directories" includes the entry "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64;"
  • Specifically, in your CommandCenter.vcxproj, make sure the below sections contain those include/lib directories as follows:
 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64;C:\Libraries\SC2AI\sc2api_precompiled\lib;$(LibraryPath)</LibraryPath>
   <IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;C:\Libraries\SC2AI\sc2api_precompiled\include;$(IncludePath)</IncludePath>
 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <LibraryPath>C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64;C:\Libraries\SC2AI\sc2api_precompiled\lib;$(LibraryPath)</LibraryPath>
   <IncludePath>C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt;C:\Libraries\SC2AI\sc2api_precompiled\include;$(IncludePath)</IncludePath>

"Regional mismatch" when trying to open a Replay

You need to launch the "Blizzard launcher" (Windows) or " app" (Mac) and update the Starcraft II game to the latest version.

"Unable to open map" when trying to open a Replay

Symptom: When opening a replay from Finder (Mac) or the in-game menu, an in-game popup will say "Unable to open map".

General cause: This happens when the SC2 game cannot find the map file referenced in the replay or when the cashed version is outdated.

Fix #1: Make sure you have the indicated map in the default /Maps/ directory in SC2.
(This could be in "/Applications/Starcraft II/Maps/" or "/Users/Shared/Blizzard/", or maybe "/Library/Application Support/Blizzard/Starcraft II")

Fix #2: Delete the cashed data. Start a Custom->Melee game with the indicated map, and have the game download the cache of it, then try the Replay again.

Start game by map name: black screen or wrong patch level

Manually deleting the cache and re-caching it by playing one game in the client can solve both problems. See also here.

When using the ladderManager the screens stay black

Try regenerating your Variables.txt (Win: C:\Users\D\Documents\StarCraft II\Variables.txt) by deleting it and starting the SC2 client once.

Linux Renderer (or FeatureLayer) Rendering examples don't work

One trick here is to find either a software or hardware rendering library (or both) and to add them into the relative paths below "#if LINUX_USE_SOFTWARE_RENDER" in whatever file you're trying to run. On Fedora 28 I found mine in /usr/lib64/ but this will obviously depend somewhat on the OS.

Using the C++ api source code as a submodule produces include errors related to protobuf

There are a few things we need to go and change here. The first thing is to follow the normal procedures for cloning the repository, building the build folder, and then making the executables. Once that is done (within the subrepo folder) you may find like I did that some of the includes related to protobuf have errors and cannot be found. In order to fix this there are a couple places you need to look:

  • sc2_proto_interface.h: #include "s2clientprotocol/sc2api.pb.h" is the suspect line here and I ended up changing it to "#include "../../build/generated/s2clientprotocol/sc2api.pb.h" this file can be found in include/sc2api in the main s2client-api folder
  • Multiple files in /s2clientapi/build/generated will have include statements here with a path before the folder, even though the files they are referencing here are within the same directory. Look for any includes that reference other files within the directory and change them from: "#include "s2clientprotocol/*.h" to "#include "*.h" where * in both cases is the name of the particular file. Note that nearly every header in this folder has an include reference to another file within the folder, so its probably best to just go through them one by one. The includes with "" rather than <>, generally speaking, are the ones you're looking for.

After this you're ready to setup your bot. Get a CMakeLists.txt file going in the main folder and refer to s2client-api as a subdirectory and you should be on your way. Good luck and feel free to join us on Discord with any further questions!

Unable to get into game when using multiple bots (the 'black screen bug' )

This is a known issue from clients on sc2 versions later than 4.6 Potential fix will be detailed soon


Chrono does not work

Cast 3755 to ABILITY_ID.