Skip to content

How to Debug Starcraft Programs (BWAPI bots)

dtdannen edited this page Sep 4, 2013 · 3 revisions

Acquire the file 4160d.dll:

  1. Download BWAPI 3.7.4.7z from https://code.google.com/p/bwapi/downloads/list

  2. After extracting, copy the file BWAPId.dll from the folder Chaoslauncher/

  3. Paste that file into the Starcraft/bwapi-data/revisions/ folder where Starcraft is installed on your computer

  4. Rename that file to be 4160d.dll

How to debug a Starcraft BWAPI bot:

  1. Ensure that you can compile your bot in Debug mode (not Release). For assistance, see https://code.google.com/p/bwapi/wiki/Debugging

  2. Compile your bot in debug mode

  3. Run Chaoslauncher, and select BWAPI Injector (1.16.1) Debug (top right of Chaoslauncher window). Its probably best if you also set the value "pause_dbg = ON" in config file (bwapi.ini located in bwapi-data).

  4. When Starcraft is at the menu screen before the match starts, go back to Visual Studio. At the top click Debug->Attach to Process...

  5. Select the currently running Starcraft.exe process

  6. Go back to Starcraft, start the game

  7. Now once a breakpoint is hit, Starcraft should wait and you can debug your program. Happy Debugging :)

After finished debugging

  1. Change the "pause_dbg = OFF" option in the bwapi.ini config file (Actually you can leave it set to on all the time, does nothing for release mode)

  2. In chaoslauncher deselect the DEBUG injector and select the RELEASE injector (checkboxes in the upper left of the chaos launcher window)

Clone this wiki locally