starcraft learning algorithms by logan yarnell, steven raines, and dean antel

23
StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Upload: wilfred-paul

Post on 02-Jan-2016

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

StarCraft Learning Algorithms

By Logan Yarnell, Steven Raines, and Dean Antel

Page 2: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Abstract

The opening or initial build order during a StarCraft match is an integral part of a player’s strategy. If an opening is naively chosen it makes a player vulnerable to tactics that can end the game very quickly. We examine three algorithms for choosing a “good” opener: Bayesian network, a genetic algorithm, and a pathfinding algorithm.

Page 3: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

About StarCraft

Real-time strategy game

Similar to a complex digital version of chess but in real-time

Expert level gameplay is very complex, often requiring over 300 actions per minute.

Considered a national sport in South Korea

Page 4: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

About StarCraft

Playing Starcraft requires simultaneously managing several distinct competencies:

Strategy

Production

Economy

Recon

Tactics

Page 5: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Basic Actions

Build buildings

Build units

Attack the enemy

Gather resources/manage economy

Page 6: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel
Page 7: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel
Page 8: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel
Page 9: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Genetic Algorithm

Modifies some set of “solutions” to a problem in a way similar to natural selection

Has mutation, crossover, and elitism functions

Solution = a build order

Each build order is given a fitness value determined by how successful it is

The number of mutations the build has gone through is also recorded

If a build order has gone through 10 mutations and it’s fitness < 5, elitism removes that build order

Page 10: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Genetic Algorithm

Most important part of genetic algorithm = mutate function

Sometimes the only part implemented if computational resources are limited

Fitness value determination is also important

Considered factors in determining a build’s fitness: time taken, amount of resources used, whether the match was won or lost, number of units/structures that survived…

In the end only win/loss rate was chosen to affect fitness

Page 11: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Genetic Algorithm

Mutate function randomly chooses to add a new unit, reorder the build, or remove a unit

isBuildValid method checks to make sure the mutate function doesn’t produce a useless build order by placing a unit before it’s prerequisite(s)

The newly mutated build is then written to a .txt file with NumOfMutations incremented

A match is run with that build, if it wins the fitness value is incremented, if it looses the fitness is not altered

There is an element of randomness, but complexity is more or less constant

Page 12: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Genetic Algorithm

Page 13: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Genetic Algorithm

Page 14: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Bayesian Network

Use knowledge from earlier games to predict what type of units the opponent is likely to have.

Requires mining a large amount of data from replays

Scouting is essential to make this work effectively

Difficult due to incomplete information available during matches

Page 15: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel
Page 16: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Pathfinding

From what is seen, create a shortest possible build. Relies on scouting.

Dijkstra’s algorithm O(n) complexity.

O(|V|^2)

O(|E|+|V|log|V|)

Intersection O(n^2)

Page 17: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Pathfinding (Continued)

Page 18: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Conclusions

Understanding the complexity of the environment is a key element to creating a learning algorithm for it.

Complementary not competitive.

Page 19: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Why 380?

There are many ways to implement a StarCraft bot that include various algorithms for the different aspects of gameplay:

Finite state machines

Scripting

Dynamic scripting

Probabilistic inference

Influence maps

Neural networks

Swarm intelligence

Potential fields

Genetic programming

Page 20: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Future Work

Enhance unit combat

Increase the amount of units considered in build orders

Optimize building efficiency to allow multiple buildings to be constructed at the same time.

Add dynamic scouting

Page 21: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Questions

What is the computational complexity (O(n)) of Dijkstra’s algorithm without optimization?

Is this a constraint satisfaction problem, or an optimization problem?

What probabilistic relationship is there between nodes in a Bayesian network that represents a StarCraft tech tree?

Page 22: StarCraft Learning Algorithms By Logan Yarnell, Steven Raines, and Dean Antel

Answers

N^2

Optimization

Conditional dependence