-
Notifications
You must be signed in to change notification settings - Fork 1
How to Debug Starcraft Programs (BWAPI bots)
Acquire the file 4160d.dll:
-
Download BWAPI 3.7.4.7z from https://code.google.com/p/bwapi/downloads/list
-
After extracting, copy the file BWAPId.dll from the folder Chaoslauncher/
-
Paste that file into the Starcraft/bwapi-data/revisions/ folder where Starcraft is installed on your computer
-
Rename that file to be 4160d.dll
How to debug a Starcraft BWAPI bot:
-
Ensure that you can compile your bot in Debug mode (not Release). For assistance, see https://code.google.com/p/bwapi/wiki/Debugging
-
Compile your bot in debug mode
-
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).
-
When Starcraft is at the menu screen before the match starts, go back to Visual Studio. At the top click Debug->Attach to Process...
-
Select the currently running Starcraft.exe process
-
Go back to Starcraft, start the game
-
Now once a breakpoint is hit, Starcraft should wait and you can debug your program. Happy Debugging :)
After finished debugging
-
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)
-
In chaoslauncher deselect the DEBUG injector and select the RELEASE injector (checkboxes in the upper left of the chaos launcher window)