Compilation Instructions:
-
Install the required libraries
libsdl2-dev
libsdl2-image-dev
-
Clone the BWAPI github repository somewhere on your system
git clone https://github.com/bwapi/bwapi.git
-
Edit the Makefile to point to the directory that you cloned
BWAPI
BWAPI_DIR=/where_you_cloned_to/bwapi/bwapi
P.S. it is
bwapi/bwapi
here -
If your BWAPI_DIR doesn't contain the file
svnrev.h
, you need to generate it using the vbs script in that dir (note: this may have to be done in windows, but you can just copy the generated .h files to Linux and it will work) -
Run
make
in the SparCraft directory, the binary will go to theSparCraft/bin
directory -
cd to
SparCraft/bin
and run./SparCraft ../sample_experiment/sample_exp.txt
Begin
Time {gameTime}
Unit {Player} {HP} {firstTimeFree} {Position x} {Position y}
Unit {Player} {HP} {firstTimeFree} {Position x} {Position y}
Move {unitIndex} {Player} {MoveType} {moveIndex} {Position x} {Position y}
...
Move {unitIndex} {Player} {MoveType} {moveIndex} {Position x} {Position y}
End
example:
moves.add(Action(unitIndex, playerIndex, ActionTypes::ATTACK, u));
SparCraft::Action::Action(
const SparCraft::IDType &unitIndex,
const SparCraft::IDType &player,
const SparCraft::IDType &type,
const SparCraft::IDType &moveIndex
)
unitIndex
-> index of unit
playerIndex
-> unit's owner
moveIndex
-> move target, here is the enemy Unit u
for (IDType d(0); d < Constants::Num_Directions; ++d)
...
moves.add(Action(unitIndex, playerIndex, ActionTypes::MOVE, d, dest));
Action::Action(
const IDType &unitIndex,
const IDType &player,
const IDType &type,
const IDType &moveIndex,
const Position &dest
)
unitIndex
-> index of unit
playerIndex
-> unit's owner
moveIndex
-> Here is the index of direction,not the move target
TODO
- Add Bottom Up Search
- Add simulated annealing
Add player id to Player_PythonTest 2 python players at the same time and palyPython random vs Python randomPython AttackClosest vs Python AttackClosestPython random vs Python AttackClosest