Skip to content

Build instructions

Anderson edited this page Sep 7, 2016 · 8 revisions

Requirements

Pre-requisites:

  • Windows 7 (these instructions were tested on Win7 64 bits - but might work on posterior versions. Won't work on WinXP because VS2012 cannot be installed there)
  • StarCraft patched to 1.16.1

For the items below, install and configuration instructions are given on this page:

  • BWAPI 3.7.4
  • Visual C++2008 with SP 1
  • Visual C++2010
  • Visual Studio 2012
  • Boost 1.60.0

Instructions

BWAPI

  • Get BWAPI.3.7.4.7z file from: https://github.com/bwapi/bwapi/releases/tag/v3.7.4.
  • (if you don't have 7zip to unpack .7z files, grab it here: http://www.7-zip.org/)
  • Extract the contents of BWAPI.3.7.4.7z to c:\software\BWAPI3.7.4. Note that you cannot have empty spaces on path.
  • Open a console with admin privileges, go to c:\software\BWAPI3.7.4 and type install.exe. The setup will ask you for the location of Starcraft.exe and copy appropriated files there.
  • If you get no errors, your BWAPI setup is finished and you can skip the remainder of this section
  • If you get errors, you'll have to go the python way:
  • Install a python distribution (I recommend Enthought Canopy: https://store.enthought.com/downloads/ because it already comes with easy_install)
  • Open a console with admin privileges and type easy_install winshell
  • Go to c:\software\BWAPI3.7.4 and type python install.py. The setup will ask you for the location of Starcraft.exe and copy appropriated files there.

Visual Studio(s)

All three versions of Visual Studio are required. In section "Compiling" you'll see that you need to open the project with VS2012, but use VC++2008 toolset to compile. VC++2010 is what allows VS2012 to use 2008's toolset. This is needed because code does not compile with VS 2012 toolset and does not link in VC++2008 nor VC++2010.

Boost

Environment Variables

You must configure 2 environment variables:

  • BWAPI_DIR pointing to where you unpacked BWAPI (if you followed these instructions it will be: c:\software\BWAPI3.7.4
  • BOOST_DIR pointing to where you installed Boost (if you followed these instructions it will be: c:\software\boost

On Windows 7, the procedure is as follows:

  • Open Start menu, right click "Computer" then "Properties"
  • Click "Advanced system configuration"
  • In "Advanced" tab, click "Environment variables"
  • In "System variables" click "New"
  • Set the name and value as indicated (e.g.: name: BWAPI_DIR / value: c:\software\BWAPI3.7.4)

Compiling the code

  • Get MegaBot's code (clone the repo or dowload the source at releases)
  • Go to MEGABOT_DIR/MegaBot/ and open MegaBot.v11.sln (not MegaBot.sln or MegaBot.v10.sln) in Visual Studio 2012. MEGABOT_DIR is where you cloned or unpacked MegaBot's sources.
  • If Visual Studio prompts you about updating project files, select "Don't update"
  • Make sure all projects will be built with VC++2008 (v90) toolset
  • Set the configuration to 'Release'
  • Hit "build" (Menu Build->Build solultion or hit F7) and wait for some (a lot) time and warnings...
  • At the end, MegaBot.dll is available at MegaBot/Release.