Skip to content

Use offline evolution to improve scripts in micro battles

License

Notifications You must be signed in to change notification settings

hieusydo/SparCraft-Evo

Repository files navigation

SparCraft-Evo

The goal of this project is to use offline evolution to make more flexible scripts that are expected to perform better in micro battles compared to fixed scripts.

Environment Setup Guide

  1. Clone this repo

  2. Install Microsoft Visual Studio 2013 Community Edition (either from Microsoft site or here)

  3. Open the solution file SparCraft-Evo/VisualStudio/SparCraft.sln

  4. Include source and lib files:

    • Download the sources (either .zip or .tar.gz) from SDL and SDL_image and extract them
    • In the Solution Explorer menu of Visual Studio, right-click on the projects and select Properties > Configuration Properties > VC++ Directories
    • In the Include Directories option, add the include folder from the extracted sources above
    • Repeat the same steps for Libraries Directories option by adding SparCraft-Evo/lib, and for Source Directories option by adding SparCraft-Evo/source
  5. To build the project, choose the options to build as Release and Win32

  6. After the build is done, run bin/SparCraft.exe from command line (recommend Windows PowerShell). Notes: must include these files in the same folder:

    • SDL2.dll and SDL2_image.dll (downloaded from the same site of the sources above)
    • <config-file-name>.txt file. Notes: must update all the paths to be consistent with the test system
  7. [Optional] Instructions to install MinGW for Windows

How to add new player/script

  1. Add header file to AllPlayers.h
  2. Add new player to AllPlayers::getPlayer and AllPlayers::getPlayerPtr
  3. Add player name to AllPlayers::getPlayerName(const IDType & type)
  4. Add player model to class PlayerModels : public EnumData<PlayerModels> in both enum and init
  5. Add logic handling in SearchExperiment.cpp

Credits

The project is built upon the SparCraft framework, which is open source StarCraft combat simulation package developed by David Churchill.

Files summary

  • Evo_KiterSD uses mu-lambda ES to evolve a population of Player_KiterSD - simple one-param kiter, that is the Safe Distance

  • Evo_KiterMvmt, same as Evo_KiterSD, but for Player_KiterMvmt - a Kiter whose movement (Mvmt) is parameterized into different weights

    • Good seeds: 3158032268, 1294198436, 417277356 (best score = 353)
  • Config note: POE num_generations poe_playout_round_limit population_size num_best_to_keep doOfflineEvo [numEvoStates evoSide mu lambda epoch numSubpop] Typical: Number of generations: 10-20, poe_playout_round_limit: around 20, population size: 18, num_best: 6. Fast: 5 gen, 5 playout limit, 8, 4

About

Use offline evolution to improve scripts in micro battles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published