Opening tech prediction through machine learning for Starcraft AI
C++ Python Shell Objective-C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
clustering
scrapers
scripts
tests
Makefile
PvP.txt
PvPx.txt
PvT.txt
PvTx.txt
PvZ.txt
PvZx.txt
README.markdown
TODO.markdown
TvP.txt
TvPx.txt
TvT.txt
TvTx.txt
TvZ.txt
TvZx.txt
ZvP.txt
ZvPx.txt
ZvT.txt
ZvTx.txt
ZvZ.txt
ZvZx.txt
arff.py
count_min.py
enums_name_tables.h
enums_name_tables_tt.h
full.txt
fullx.txt
lPall.txt
lPallx.txt
lPvP.txt
lPvPx.txt
lPvT.txt
lPvTx.txt
lPvZ.txt
lPvZx.txt
lTall.txt
lTallx.txt
lTvP.txt
lTvPx.txt
lTvT.txt
lTvTx.txt
lTvZ.txt
lTvZx.txt
lZall.txt
lZallx.txt
lZvP.txt
lZvPx.txt
lZvT.txt
lZvTx.txt
lZvZ.txt
lZvZx.txt
model.cpp
model.h
model.pdf
noisy.sh
parameters.h
plot_all_Time_per_Opening_and_X.sh
replays.h
tPvP.txt
tPvPx.txt
tPvT.txt
tPvTx.txt
tPvZ.txt
tPvZx.txt
tTvP.txt
tTvPx.txt
tTvT.txt
tTvTx.txt
tTvZ.txt
tTvZx.txt
tZvP.txt
tZvPx.txt
tZvT.txt
tZvTx.txt
tZvZ.txt
tZvZx.txt
techtrees.cpp
techtrees.h
test_functional_dirac.cpp
test_getBuildings.cpp
test_getOpeningVal.cpp
test_lambda.cpp
test_learning.cpp
test_x_values.cpp
update_model.pdf
x_values.h
x_values_tt.h

README.markdown

Opening/BuildTree prediction for StarCraft: Broodwar

Dependency:

ProBT
Boost.serialization (optional, note: compiled with ./bjam --with-serialization --build-type=complete --layout=versioned toolset=darwin architecture=x86 address-model=32)

Input format:

One replay/game per line, lines such as
First_Building_Name Time_Built; Second_Building_Name Time_Built2;

See the *v*.txt files

It does:

  1. Learn the possible tech trees (X) from replays (or you can generate them)
  2. Learn the distributions of P(Time | X, Opening) and P(X | Opening)
  3. Learn the distributions of P(Time | BuildTree) with TECH_TREES switched on
  4. Infer P(Opening | Observations, Time)

See model.pdf or CIG'11 publication for 1,2,4 and AIIDE'11 publication for 3.

Workflow:

  1. (Optional, our labels) Clusterize from clustering/launch_labeling.sh
  2. Transform (transmute) arff files into txt files with scripts/transmute.sh
  3. To perform evaluations, cut the txt files into learn and test files with the scripts/cut* scripts
  4. Compile (make) and test either with make targets or export (DY)LD_LIBRARY_PATH=<probt/lib(+boost/lib)> && ./model lXvX.txt tXvX.txt

More is more:

You will always need one runtime library: probt (probt22 in Makefile, any probt >= 2.2 should do). depending on how it was compiled, the main of model.cpp (model (Ben Weber openings), mymodel (my openings, c.f. clustering/), or tt (tech trees only) in the Makefile) will learn and exit from file (match-up) XvY.txt if given:

    ./model XvY.txt

or will learn on XvY and test on WvZ if given:

    ./model XvY.txt WvZ.txt

Example:

    ./model lZvT.txt tZvT.txt

The prediction will always be against X or W, for instance in ZvT, the predictions will be as a Terran player against a Zerg one (the learning is also of Zerg build/tech trees and openings).

  1. To just compile and run the Opening prediction model with Ben Weber's openings labels:

     make model
     make run OR (with appropriate DYLD_LIBRARY_PATH) ./model XvT.txt [WvZ.txt]
    
  2. To compile and run the Opening prediction model with Ben's openings labels and serialization, you need to be able to link to a boost >= 1.45 serialization dylib/dll/so:

     make model_with_serialization
     make run_with_serialization OR (with appropriate DYLD_LIBRARY_PATH) ./model XvT.txt [WvZ.txt]
     ex here: ./model PvT.txt
    
  3. The same with my openings (c.f. clustering/clustering.py):

     make mymodel[_with_serialization]
     make run[_with_serialization] OR (with appropriate DYLD_LIBRARY_PATH) ./mymodel XvY.txt [WvZ.txt]
     ex here: ./mymodel PvTx.txt
    
  4. To compile and run the (build/)tech trees prediction only:

     make tt
     make run_tt OR (with appropriate DYLD_LIBRARY_PATH) ./tt XvY.txt [WvZ.txt]
     ex here: ./tt PvT.txt
    
  5. A lot of plotting options, see Makefile