Build Order Optimization in StarCraft

Similar documents
Adversary Search. Ref: Chapter 5

MFF UK Prague

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

mywbut.com Two agent games : alpha beta pruning

More on games (Ch )

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Basic Tips & Tricks To Becoming A Pro

More on games (Ch )

: Principles of Automated Reasoning and Decision Making Midterm

Case-Based Goal Formulation

Case-Based Goal Formulation

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

Adjutant Bot: An Evaluation of Unit Micromanagement Tactics

Quantifying Engagement of Electronic Cultural Aspects on Game Market. Description Supervisor: 飯田弘之, 情報科学研究科, 修士

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:

ConvNets and Forward Modeling for StarCraft AI

ARTIFICIAL INTELLIGENCE (CS 370D)

game tree complete all possible moves

Adversarial Search 1

2 person perfect information

Using Automated Replay Annotation for Case-Based Planning in Games

Efficient Resource Management in StarCraft: Brood War

CS61B Lecture #22. Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55: CS61B: Lecture #22 1

Asymmetric potential fields

CS188 Spring 2010 Section 3: Game Trees

A Bayesian Model for Plan Recognition in RTS Games applied to StarCraft

Foundations of Artificial Intelligence

CSC 396 : Introduction to Artificial Intelligence

Set 4: Game-Playing. ICS 271 Fall 2017 Kalev Kask

Applying Goal-Driven Autonomy to StarCraft

Electronic Research Archive of Blekinge Institute of Technology

Artificial Intelligence Adversarial Search

State Evaluation and Opponent Modelling in Real-Time Strategy Games. Graham Erickson

Potential-Field Based navigation in StarCraft

CS 680: GAME AI WEEK 4: DECISION MAKING IN RTS GAMES

Artificial Intelligence

Nested-Greedy Search for Adversarial Real-Time Games

arxiv: v1 [cs.ai] 9 Aug 2012

CS61B Lecture #33. Today: Backtracking searches, game trees (DSIJ, Section 6.5)

Sequential Pattern Mining in StarCraft:Brood War for Short and Long-term Goals

CSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis

High-Level Representations for Game-Tree Search in RTS Games

Artificial Intelligence. 4. Game Playing. Prof. Bojana Dalbelo Bašić Assoc. Prof. Jan Šnajder

Evaluating a Cognitive Agent-Orientated Approach for the creation of Artificial Intelligence. Tom Peeters

CS188 Spring 2010 Section 3: Game Trees

Game-Tree Search over High-Level Game States in RTS Games

CS 380: ARTIFICIAL INTELLIGENCE MONTE CARLO SEARCH. Santiago Ontañón

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

Five-In-Row with Local Evaluation and Beam Search

Search Depth. 8. Search Depth. Investing. Investing in Search. Jonathan Schaeffer

CS325 Artificial Intelligence Ch. 5, Games!

Game Engineering CS F-24 Board / Strategy Games

Data Structures and Algorithms

CS188 Spring 2014 Section 3: Games

AN ABSTRACT OF THE THESIS OF

GHOST: A Combinatorial Optimization. RTS-related Problems

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

Cooperative Learning by Replay Files in Real-Time Strategy Game

Game-playing: DeepBlue and AlphaGo

Optimal Dispatching of Welding Robots

Announcements. Homework 1 solutions posted. Test in 2 weeks (27 th ) -Covers up to and including HW2 (informed search)

Implementing a Wall-In Building Placement in StarCraft with Declarative Programming

CS 387: GAME AI BOARD GAMES. 5/24/2016 Instructor: Santiago Ontañón

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 2 February, 2018

Multiple Agents. Why can t we all just get along? (Rodney King)

Combining Scripted Behavior with Game Tree Search for Stronger, More Robust Game AI

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

Sense in Order: Channel Selection for Sensing in Cognitive Radio Networks

SUPPOSE that we are planning to send a convoy through

Sequential Pattern Mining in StarCraft: Brood War for Short and Long-Term Goals

CS510 \ Lecture Ariel Stolerman

CS221 Project Final Report Gomoku Game Agent

CSE 473: Artificial Intelligence Fall Outline. Types of Games. Deterministic Games. Previously: Single-Agent Trees. Previously: Value of a State

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

2/5/17 ADVERSARIAL SEARCH. Today. Introduce adversarial games Minimax as an optimal strategy Alpha-beta pruning Real-time decision making

Foundations of Artificial Intelligence

CS 4700: Artificial Intelligence

Artificial Intelligence

University of Sheffield. CITY Liberal Studies. Department of Computer Science FINAL YEAR PROJECT. StarPlanner

Generalized Game Trees

JAIST Reposi. Title Attractiveness of Real Time Strategy. Author(s)Xiong, Shuo; Iida, Hiroyuki

CS 387: GAME AI BOARD GAMES

Monte Carlo Tree Search

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

Adversarial Search: Game Playing. Reading: Chapter

STARCRAFT 2 is a highly dynamic and non-linear game.

TD-Leaf(λ) Giraffe: Using Deep Reinforcement Learning to Play Chess. Stefan Lüttgen

CS 387/680: GAME AI BOARD GAMES

Robot Factory Rulebook

AI in Computer Games. AI in Computer Games. Goals. Game A(I?) History Game categories

AIMA 3.5. Smarter Search. David Cline

UCT for Tactical Assault Planning in Real-Time Strategy Games

The Combinatorial Multi-Armed Bandit Problem and Its Application to Real-Time Strategy Games

Reactive Strategy Choice in StarCraft by Means of Fuzzy Control

CMPUT 396 Tic-Tac-Toe Game

Intuition Mini-Max 2

Game Playing for a Variant of Mancala Board Game (Pallanguzhi)

CASE STUDY - KALAH JEFFREY L. POPYACK

Transcription:

Build Order Optimization in StarCraft David Churchill and Michael Buro Daniel Federau Universität Basel 19. November 2015

Motivation planning can be used in real-time strategy games (RTS), e.g. pathfinding of units strategical planning tactical assault planning in this paper: finding an optimal build order for the game StarCraft 2 / 21

StarCraft created by Blizzard Entertainment in 1998 one of the most popular RTS-games the goal is to destroy all enemy buildings the player gathers resources, builds production buildings and combat units consumable resources: minerals, gas and supply building dependencies are saved in tech tree 3 / 21

StarCraft 4 / 21

Build Order Optimization build order is the order in which units/buildings are built optimal build order reaches a given goal as fast as possible (minimize makespan) goal: build number of units/buildings/resources 5 / 21

Overview definition of the search space is needed for search every unit, building and consumable is considered a resource every action has preconditions and produces resources 6 / 21

Action - Definition action a = (δ, r, b, c, p) δ: duration measured in frames r: required resources, need to be present in order to execute action b: borrowed resources, will be available again after action finishes (e.g. production buildings) c: consumed resources, become unavailable after executing action (e.g. minerals, gas) p: produced resources after action finishes 7 / 21

Action - Example action a = Build Terran unit Firebat δ: 576 frames (24 seconds) r = {Academy} b = {Barracks} c = {50 Minerals, 25 Gas, 1 Supply} p = {1 Firebat} 8 / 21

States state S = (t, R, P, I ) t: current game time R: vector with every resource available P: actions currently in progress I : worker income data (10 gather minerals, 3 gather gas) used for abstraction 9 / 21

Abstractions used to reduce search space and increase the performance of the planner: 1. fixed income rate per worker per frame (0.045 minerals, 0.07 gas) 2. assign 3 workers to a refinery when it finishes 3. add 4 seconds to the game time whenever a building is constructed 10 / 21

Action Legality difference between executable and legal actions an action a is legal in state S if: 1. required or borrowed resources are currently available, borrowed or under construction 2. consumable resources are currently available or will be in the future without executing an action 11 / 21

State Transition 3 functions for the definition of the transition function for a given state S: S Sim(S, δ): simulates progression from S during δ without actions increases resource count and finishes actions δ When(S, R): returns duration δ when resources R are available S Do(S, a): execute action a in state S if resources are available (does not increase time of S) transition function T : S = Do(Sim(S, When(S, a)), a) 12 / 21

Search Algorithm depth-first branch and bound algorithm recursive algorithm possible to stop at any time to return best solution so far heuristic functions for pruning nodes search algorithm is optimal if heuristic is admissible 13 / 21

High-level Algorithm DFBB(S) return best solution so far if time runs out update bound whenever a better solution is found expand children: heuristic evaluation of children prune child if cost so far and heuristic is bigger than bound 14 / 21

Heuristics maximum of the two heuristics is used for lower bound: LandmarkLowerBound(S,G) uses landmarks (vital actions for achieving a goal) landmarks can be obtained from tech tree sum of duration of all non-concurrent landmark actions ResourceGoalBound(S,G) sum of all consumed resources needed to build all units/buildings in goal G duration that is needed to gather this amount with current worker count 15 / 21

Macro Actions manually implemented double existing actions every action has a repetition value K defines how often an action has to be executed in a row decreases depth of search but produces non-optimal solutions 16 / 21

Comparison produced build orders were compared to ones from professional players build orders were extracted manually from replays save sequence of all actions that produce resources every 500 frames from beginning of the game until 10000 frames (7 min) or until one of the units dies goals were extracted with GetGoal(B, t s, t e ) build order B, start time t s, end time t e every resource produced by actions issued between t s and t e 17 / 21

Results: CPU-Usage 18 / 21

Results: Comparison with professional replays 19 / 21

Conclusion possible to compute build orders in real time results are close to professional build orders abstractions greatly reduce search time but can lead to non-optimal solution 20 / 21

Discussion comparison in favour of the planner: professional player also has to control units player can change his goal during his build order planner can not detect unit loss 21 / 21

Image Sources Frame 4: http://s3.vidimg02.popscreen.com/original/ 31/NTQ2MDU5MjUz_o_ lets-play-starcraft-brood-war---03-legacy-of-the-xelna jpg Frame 6: http://www.teamliquid.net/forum/ brood-war/226892-techtree-pictures 21 / 21

Search Algorithm Algorithm 1 Depth-First Branch & Bound Require: goal G, state S, time limit t, bound b 1: procedure DFBB(S) 2: if TimeElapsed t then 3: return 4: end if 5: if S safisfies G then 6: b min(b, S t) update bound 7: bestsolution solutionpath(s) 8: else 9: while S has more children do 10: S S.nextChild 11: S.parent S 12: h eval(s ) heuristic evaluation 13: 14: if S t + h < b then DFBB(S ) 15: end if 16: end while 17: end if 18: end procedure 21 / 21

Compare Algorithm Require: BuildOrder B, time limit t, Increment Time i procedure CompareBuildOrder(B, t, i) S Initial StarCraft State SearchPlan DFBB(S,GetGoal(B, 0, ), t) if SearchPlan.timeElapsed t then return MakeSpan(SearchPlan)/MakeSpan(B) else inc i SearchPlan while inc MakeSpan(B) do IncPlan DFBB(S,GetGoal(B,inc i,inc),t) if IncPlan.timeElapsed t then return failure else SearchPlan.append(IncPlan) S S.execute(IncPlan) inc inc +i end if end while return MakeSpan(SearchPlan)/MakeSpan(B) end if end procedure 21 / 21