Installation Instructions - smithe0/ualbertabot GitHub Wiki

UAlbertaBot Installation & Tutorial Video

Click the image below to watch the installation & tutorial video. The video covers every step of the process after installing Starcraft and Visual Studio.

Download

  • To download the source code, simply clone the repo to your machine

Prerequisites

UAlbertaBot is currently being maintained using Visual Studio 2013, which is required to open the project file and build the source code. Visual Studio 2015 has been released, but UAlbertaBot has not yet been tested with it and the project file is still being actively maintained in Visual Studio 2013.

List of Prerequisites for Bot Compiling:

Note: Install BWAPI and BWTA after you have installed and patched Starcraft to version 1.16.1. The BWAPI installer copies files to the Starcraft directory which are required to run BWAPI bots, and this will not be performed if you install it first.

Note: I recommend installing BWAPI and BWTA to directories without spaces in the directory name. This is due to a Visual Studio error when including libraries from directories with spaces which come from windows environment variables. Please change the default BWAPI install location from Program Files to a folder that does contain any spaces. For ease of use I recommend creating a folder on your drive called c:\libraries\ and installing both BWAPI and BWTA to that location.

The UAlbertaBot project files use Windows Environment Variables to point to its required BWAPI and BWTA libraries. You must edit your windows environment variables to point to the installation directories chosen for those libraries.

List of Required Windows System Environment Variables:

  • BWAPI_DIR - BWAPI 4.1.2 installation root directory
  • BWTA_DIR - BWTA 2.2 installation root directory

How to edit Windows environment variables

  1. Right click My Computer (This PC in Windows 10)
  2. Click Properties
  3. Click Advanced System Settings
  4. Click Environment Variables
  5. Click New...
  6. Enter the variable name on top and the associate directory on bottom

Environment Variables

How to Compile

  1. Open UAlbertaBot/VisualStudio/UAlbertaBot.sln in Visual Studio 2013
  2. Edit the onStart() function in UAlbertaBotModule.cpp so that the call to parseConfigFile() points to where the UAlbertaBot configuration file exists on your machine. If you do not point to the correct location, UAlbertaBot's default settings will be used and an error message will print on game start.
  3. Select Release mode
  4. Build the UAlbertaBot project (all projects will be built)
  5. Compiled .dll will go to the UAlbertaBot/bin directory

How to Run

  1. Install Starcraft: Broodwar and upgrade it to version 1.16.1
  2. Install BWAPI 4.1.2 from the link above.
  3. Ensure Chaoslauncher.exe and Starcraft.exe are set up to run as Administrator. Right click the .exe file, select Properties > Compatibility > check Run as Administrator
  4. Run Chaoslauncher.exe (comes with BWAPI)
  5. Modify Chaoslauncher's BWAPI config to point to the compiled UAlbertaBot.dll
  • In Chaoslauncher click the BWAPI 4.1.2 Injector [RELEASE] option and make sure that it is checked
  • Click the Config button near the bottom
  • Edit the ai parameter to point to your path/to/UAlbertaBot.dll
  • Make sure to save the text file after editing
  1. Edit the UAlbertaBot configuration file to your liking
  2. Run StarCraft using Chaoslauncher
  3. To test the bot, start a game using Single Player > Expansion > Play Custom, select any standard multiplayer map and use Melee settings to start. Note: The bot will not work with more than one opponent or in the single player campaign. Make sure to set the bot race to Protoss if you are using the default configuration.

Note: If when you run UAlbertaBot it seems to be hanging, this means BWTA is parsing the map file for the first time. Please leave a minute or two to finish its analysis. This will only happen one time per map, as BWTA will save the data locally on disk after it finishes.

Note: If you get an error message that libgmp-10.dll or libmpfr-4.dll as missing it's because you didn't copy the BWTA2 dll files into your Windows directory, go back and follow the installation instructions

If you run into any issues while running the bot, please check the Common Issues and Solutions page for help.

How to Debug

Debugging errors in a BWAPI bot can be very challenging. Luckily you can make use of Visual Studio's debugger to set break points and step through your code when errors occur. To debug UAlbertaBot:

  1. Follow the above How to Compile instructions but select Debug instead of Release
  2. The debug version of UAlbertaBot will go to UAlbertaBot\bin\UAlbertaBot_d.dll
  3. Follow the above 'How to Run` instructions with the following modifications
  • In Chaoslauncher click the BWAPI 4.1.2 Injector [DEBUG] option and make sure that it is checked. Also make sure that the [RELEASE] option is unchecked
  • Click the Config button near the bottom
  • Edit the ai_dbg parameter to point to your path/to/UAlbertaBot_d.dll
  • Edit the pause_dbg parameter to ON. This will pause Starcraft at the menu until it detects that you have correctly attached the Visual Studio Debugger to the Starcraft process
  • Open the UAlbertaBot project as Administrator
  • Under the Debug menu click Attach to Process... while Starcraft is running
  • Select Starcraft.exe and click the Attach button. This may take a minute the first time you do it as it is loading all the debug symbols
  • If you chose auto_menu in the BWAPI configuration, Starcraft will detect that the debugger is attached and start the game. If you are not using auto_menu you can now start the game normally
  • The debugger is now attached, you should see a red Stop button in Visual Studio. You can now create break points by clicking to the left of the line number in the text editor (a red dot should appear)