Skip to content
Adam Heinermann edited this page Sep 17, 2022 · 8 revisions

Will there be an API like this for Starcraft II?

There is an official API for Starcraft II here.

When are units deleted? When do Unit pointers become invalid?

Units are deleted only after the match ends.

Should I Make an AI DLL Module or an AI Client Program?

It is completely up to you. Each type has advantages and disadvantages. If you are a beginner, the DLL module is recommended.

DLL Module

  • Low overhead
  • Most functional
  • Must compile with Visual C++

Client Program

  • Can use any compiler
  • Prevents potential cheating (unable to read memory from another process)

Why use Visual Studio?

The BWAPI uses Visual C++ for its friendly interface and powerful debugger. Users that are new to BWAPI or C++ can simply download the Integrated Developer Environment (IDE), install BWAPI, open the project, and click "Build". It is very easy to use and the only drawback is that it is not up-to-date with the new C++ language standard.

Can I use another compiler?

You can only use another compiler for a Client AI. Compiling AI DLL Modules to be loaded by BWAPI directly, or even BWAPI itself can only result in incompatibilities with modules compiled in Visual C++. This is because maybe elements of the C++ standard are implementation defined, including structure of stl containers and implementation of virtual functions.

Is the API thread-safe?

No. The API is not thread safe. Adding thread-safety to the API will only add unnecessary overhead. If you want your bot to use the API in a multi-threaded environment, you will have to put locks on copies of the data retrieved during the onFrame callback.

What is a Force?

A Force is another name for Team. In fact, the term "Team" is never used by Starcraft's Campaign Editor "StarEdit". Default team names are also called "Force #" by Starcraft. In addition, players in the same Force are not necessarily allies, and thus not part of the same team.

In-game forces

Where is Heal Move?

You can HealMove by using either of the following calls;

pUnit->attack(position);
pUnit->useTech(TechTypes::Healing, position);