Skip to content

SparCraft Windows Bot Compilation

davechurchill edited this page Sep 12, 2014 · 5 revisions

It is quite easy to use SparCraft in your own bot! You can simply link it to your existing bot, or you can compile it yourself.

If you want to learn more about integrating AI systems into BWAPI bots, you can read our AIIDE 2012 paper:

Headers

To use SparCraft, you must include its headers. Make sure your project includes the SparCraft/source directory, and from within your program use the following:

#include "SparCraft.h"

Compiling - Prerequisites

To compile SparCraft as a standalone Windows exe, you must have the following:

Compiling SparCraft for use in a BWAPI bot requires the full BWAPI library, you cannot link to the included [bwapidata bwapidata] project.

Compiling - Platform Toolset Settings

To use SparCraft in a BWAPI bot, it must be compiled under the v90 platform toolset. This is the default toolset for SparCraft so no modification is required. Make sure to click do not upgrade when opening the solution in VS2012 for the first time.

Compiling - Step By Step Instructions

To build SparCraft.lib:

  1. Install Visual Studio 2012
  2. Install the Required Compilation Libraries
  3. Set BWAPI_DIR environment variable to bwapidata folder
  4. Launch Visual Studio 2012
  5. Open SparCraft/VisualStudio/SparCraft.sln
  6. Click "Do Not Upgrade" projects (this keeps them as v90)
  7. Change Configuration to Release (if it isn't already)
  8. Build SparCraft project (creates SparCraft.lib)
  9. Build your bot while linking to SparCraft.lib