cosecivi'15 - predicting the winner in two player starcraft games
TRANSCRIPT
Predicting the Winner in Two Player StarCraft Games
Antonio A. Sánchez-Ruiz Complutense University of Madrid
CoSECiVi-2015, Barcelona
CoSECiVi 2015
StarCraft: Brood War
2
StarCra&®: Brood War® ©1998 Blizzard Entertainment, Inc. All rights reserveda
CoSECiVi 2015 3
StarCraft: Brood War
CoSECiVi 2015
StarCraft: Brood War
4
CoSECiVi 2015
StarCraft: Brood War
5
CoSECiVi 2015
StarCraft: Brood War
6
StarCra': Brood War
CoSECiVi 2015
BWAPI
BW
API
Bot
game state
commands
7
CoSECiVi 2015
RTS as testbeds for AI
q RTS games are popular testbeds for AI researchers
q Complex environments
q Macro vs. micro
q Adversarial
q Incomplete information
q Controlled, reproducible
q International competitions
q Different AIs against each other
8
CoSECiVi 2015
Experiment Games
q 2 game AI Terran players
q Expansion Terran Campaign Insane
q Very balanced games
q 1 BWAPI observant player without units
q 100 games
q 1 map
q Each player won 50% of the games
9
StarCra': Brood War
BW
API
Game AI 1
Game AI 2
CoSECiVi 2015
Game Duration
10
0
2
4
6
30 60 90 120time (min)
num
ber o
f gam
esDuration of games
q Average game duration: 60.83 minutes
CoSECiVi 2015
Resources vs. Time
11
1500
2000
2500
3000
3500
4000
0 25 50 75 100time (%)
resources gas minerals
0
20
40
60
0 25 50 75 100time (%)
units troops buildings
CoSECiVi 2015
Units vs. Time
12
CoSECiVi 2015
Feature Selection
13
game frame gas1 minerals1 svc1 marine1 … gas2 minerals2 svn2 marine2 … winner
1 9360 2936 2491 18 23 … 2984 2259 20 26 … 1
1 9450 2952 2531 18 20 … 3000 2315 20 20 … 1
1 9540 2968 2571 18 14 … 3024 2371 20 14 … 1
1 9630 2892 2435 18 12 … 2940 2219 20 7 … 1
q 1 sample each 5 seconds: 730 samples per game
q 56 features
q Game and time
q Resources, troops and buildings of each player
q Winner of that game
CoSECiVi 2015
AI Classification Algorithms
q Linear Discriminant Analysis (LDA)
q Linear combination of features to separate clases. Gaussian distribution with class specific mean and common covariance matrix.
q Quadratic Discriminant Analysis (QDA)
q Similar to LDA but with class specific covariance matrix.
q Support Vector Machines (SVM)
q Kernels to map inputs to high dimensional spaces.
q k-Nearest Neighbour (KNN)
q Instance based learning. Majority vote among the k nearest training samples.
q Weighted K-Nearest Neighbor (KKNN) [12]
q Kernels to weight neighbours according to their distances.
14
CoSECiVi 2015
Parameter Selection and Global Accuracy
q Parameter selection
q 10 fold cross validation on 30% of the samples
q Global accuracy
q 80% training, 20% test
q Mean accuracy value of 16 executions
15
Classifier Accuracy Parameters
Base 0.5228
LDA 0.6957
QDA 0.7164
SVM 0.6950 kernel = polynomial, degree = 3, scale = 0.1, C = 1
k-‐NN 0.6906 k = 5
kk-‐NN 0.6908 kernel = opPmal, kmax = 9, distance = 2
0.4
0.6
0.8
1.0
0 25 50 75 100time (%)
accu
racy
classifier
lda
qda
svm
knn
kknn
CoSECiVi 2015
Accuracy vs. Time
16
CoSECiVi 2015
Accuracy vs. Training Set Size
17
0.55
0.60
0.65
0.70
0 20 40 60 80number of games
accu
racy
classifier
lda
qda
svm
knn
kknn
CoSECiVi 2015
Stability vs. Time
18
0
1
2
3
0 25 50 75time (%)
num
ber o
f sta
ble
gam
es
classifier
lda
qda
svm
knn
kknn
CoSECiVi 2015
Aggregated Stability vs. Time
19
0
5
10
15
20
0 25 50 75time (%)
num
ber o
f sta
ble
gam
es
classifier
lda
qda
svm
knn
kknn
CoSECiVi 2015 20
Conclusions and Future Work
q Academic AI and videogames
q AI to improve game development or game experience
q Games to improve or better understand AI techniques
q More elaborate data representation
q Spatial: influence maps
q Time: game progression vs. snapshots
q More realistic experiments
q Different maps
q Real games with human players
q More useful predictions
q Attacks and type of units, base expansions, player strategies …
CoSECiVi 2015
Thank you
21
Predicting the Winner in Two Player StarCraft Games