-
Notifications
You must be signed in to change notification settings - Fork 1
Add a new Algorithm
GuilhermeOliveira edited this page Apr 13, 2018
·
1 revision
For MetaBot, an algorithm is an AIModule that executes all game actions. So, to implement a new algorithm or behavior, you need to implement an (independent) AIModule and integrate it into MegaBot. This page explains how to do it
Currently, MetaBot is implemented in BWAPI 3.7.4 (version 3.7.5 is compatible). So, to create a new AIModule, you can start with the ExampleAIModule bundled with BWAPI 3.7.5 and add your code there.
- Open
MetaBot.slnin Visual Studio - Right click in
Solution 'MetaBot' -> Add -> Existing Project - Locate the AIModule .vcproj or .vcxproj file (if an upgrade is asked, accept)
- Check include directories to grab BWAPI headers from default location
- Configure the toolset to v90
- Configure the output to "Library" (.lib)
- Right click in MetaBot's project -> Properties
- Go to
Common properties -> References - Click
Add New Referenceand check the box of the project to be included
In file Strategy/MetaStrategy.h:
- Give an
#includeon the new AIModule's header file - Add a
static const stringto the new behavior
In file Strategy/MetaStrategy.cpp:
- Initialize the new behavior's
const string - Add a new line with
portfolio.insert(make_pair(...));for the new AIModule
Done! MetaBot will be able to use the new AIModule now.