Research Related to Real-Time Strategy Games Robert Holte November 8, 2002.

Slides:



Advertisements
Similar presentations
Algorithm Design Techniques
Advertisements

Heuristic Functions By Peter Lane
Heuristic Searches. Feedback: Tutorial 1 Describing a state. Entire state space vs. incremental development. Elimination of children. Closed and the solution.
Review: Search problem formulation
Informed Search Algorithms
Heuristic Search techniques
Informed search strategies
AI Pathfinding Representing the Search Space
An Introduction to Artificial Intelligence
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
Solving Problem by Searching
Cooperative Pathfinding
Recent Progress in the Design and Analysis of Admissible Heuristic Functions Richard E. Korf Computer Science Department University of California, Los.
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
Search: Representation and General Search Procedure Jim Little UBC CS 322 – Search 1 September 10, 2014 Textbook § 3.0 –
Search: Representation and General Search Procedure CPSC 322 – Search 1 January 12, 2011 Textbook § 3.0 –
Review: Search problem formulation
Games with Chance Other Search Algorithms CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 3 Adapted from slides of Yoonsuck Choe.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Pattern Databases Robert Holte University of Alberta November 6, 2002.
Non-Conservative Cost Bound Increases in IDA* Doug Demyen.
Heuristics CSE 473 University of Washington. © Daniel S. Weld Topics Agency Problem Spaces SearchKnowledge Representation Planning PerceptionNLPMulti-agentRobotics.
Informed Search Idea: be smart about what paths to try.
Using Abstraction to Speed Up Search Robert Holte University of Ottawa.
Chapter 5.4 Artificial Intelligence: Pathfinding.
1 Game AI Path Finding. A Common Situation of Game AI A Common Situation of Game AI Path Planning Path Planning –From a start position to a destination.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Informed (Heuristic) Search
Li Wang Haorui Wu University of South Carolina 04/02/2015 A* with Pattern Databases.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Heuristic Search Andrea Danyluk September 16, 2013.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
The A* and applications to Games Sources: My own Joseph Siefers presentation 2008.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Heuristic Functions.
By J. Hoffmann and B. Nebel
Heuristic Search Planners. 2 USC INFORMATION SCIENCES INSTITUTE Planning as heuristic search Use standard search techniques, e.g. A*, best-first, hill-climbing.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Review: Tree search Initialize the frontier using the starting state
Announcements Homework 1 Full assignment posted..
Abstraction Transformation & Heuristics
Artificial Intelligence Problem solving by searching CSC 361
Finding Heuristics Using Abstraction
The A* Algorithm Héctor Muñoz-Avila.
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
EA C461 – Artificial Intelligence
Heuristics Local Search
Informed search algorithms
Informed search algorithms
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
HW 1: Warmup Missionaries and Cannibals
Midterm Review.
Informed Search Idea: be smart about what paths to try.
Informed Search.
Presentation transcript:

Research Related to Real-Time Strategy Games Robert Holte November 8, 2002

No Games Knowledge, but… Single-agent search = sequential decisions with additive costs –path-finding occurs in RTS games –are there other occurrences ? –transfer from 1-agent to 2-agent or N-agent games ? –is a 2-agent game with a deterministic opponent a single-agent search problem ? Path-finding research group (P. Yap, Yngvi, …)

and … Combinatorial optimization = resource allocation with complex constraints –combinatorial auctions –“boolean programming” –hill-climbing, ESG, a bit of CPLEX

and … Machine Learning –opponent-modelling (poker) –user-modelling (adaptive games, personalization) –learning to make good moves (M. Mueller) Interactive Systems –mostly-automatic evaluation methodology Abstraction in Poker

Using Abstraction to Speed Up Search

Search = path-finding in a graph GIVEN: –A graph –Two nodes in the graph (“start”, “goal”) FIND: – a shortest path from start to goal

Labyrinth at the gardens of Versailles (could be a computer game!)

“Implicit” Graphs Instead of an adjacency list/matrix, Define a graph by a successor function, succ, and one or more “seed” nodes. Nodes of the graph = transitive closure of succ applied to the seed nodes An edge exists from n 1 to n 2 iff n 2  succ(n 1 ) A graph can be exponentially larger than its description.

Towers of Hanoi puzzle for D disks: –graph has 3 D nodes –description is O(D 2 )

3-disk State Space

Speed up Search by Using Extra Information Solution “skeleton” = chain of subgraphs leading from start to goal –Refinement: search in the first subgraph until you reach the second, then search in the second until you reach the third, etc. –very fast but path found not guaranteed to be optimal Heuristic = h(n) = estimate of the distance from node n to the goal node. –if it never overestimates, it can eliminate (prune) parts of the graph and still guarantee finding an optimal path

My Research Aim: to generate heuristics or skeletal solutions automatically Method: 1.Create an abstraction of the given graph (simplified version of your problem that “approximately” preserves “important” features of the problem). 2.Find a solution path in the abstract graph. 3.Use the abstract solution as a skeletal solution, or use its length as a heuristic.

Example: Towers of Hanoi start goal

Abstraction: “Ignore the smallest disk” start goal

Abstract Solution start goal

Key Techniques For Automatically Generating Abstractions –explicit graphs: STAR abstraction –implicit graphs: domain abstraction –select among abstractions using Korf & Reid’s method for predicting search time Search Methods –refinement: AltO –heuristic: Hierarchical A*, pattern databases –anytime combination of refinement and heuristic search

STAR abstraction Abstract state = connected subgraph (all nodes within distance R of a given node) Fully automatic (but need to amortize cost) Fine control over granularity (R) Can be applied recursively (abstraction hierarchy) Guarantees refinement will succeed Produces a consistent heuristic

AltO Refinement Technique Conduct abstract search in the opposite direction to the base-level search; Use the whole abstract search graph for refinement. 12% faster than standard refinement and produces better solutions (20% shorter) Robust – not sensitive to the abstract solution found, and not very sensitive to the radius of abstraction times faster than A* (same abstraction) and solutions usually within 30% of optimal

Pattern Database Successes Joe Culberson & Jonathan Schaeffer (1994). –15-puzzle –PDB + Manhattan Distance (MD) reduced MD- alone search tree 1000-fold Rich Korf (1997) –PDBs enabled optimal solutions of Rubik’s Cube Stefan Edelkamp (2001) –PDBs competitive with best planners Istvan Hernadvolgyi –PDBs reduced macro-table solution lengths from 90 to 50

Example: 8-puzzle Domain = blank ,440 states

“Patterns” created by domain mapping This mapping produces 9 patterns Domain = blank Abstract = blank corresponding patternoriginal state

Pattern Database Pattern Distance to goal Pattern Distance to goal 3 3 4

Calculating h(s) Given a state in the original problem Compute the corresponding pattern and look up the abstract distance-to-goal Heuristics defined by PDBs are consistent, not just admissible.

Domain Abstraction ,240 patterns Domain = blank Abstract = blank 6 7 8

Automatic Creation of Domain Abstractions Easy to enumerate all possible domain abstractions They form a lattice, e.g. is “more abstract” than the domain abstraction above Domain = blank Abstract = blank Domain = blank Abstract = blank

8-puzzle: A* vs. PDB size # nodes expanded (A*) pattern database size (# of abstract states)

Hierarchical A* Unlike pattern databases, each h(n) is computed on demand. If h(n) is not already known compute it by searching at the abstract level. The search at an abstract level can be informed by a heuristic defined by a higher abstract level. * many abstract searches for one base-level search * naïve implementation is 10 times slower than blind base-level search.

Speed versus Optimality Refinement –very fast (when refinability guaranteed) –suboptimal paths A* –much slower –optimal paths See also: bidirectional search,  -admissible A*

Hybrid of HA* and Refinement (1) Although the algorithms seem very different there are actually only two differences. (1)The relative weight given to g and h. HA*: g + h Refinement: h (use g to break ties) Generalization:  *g + (1-  )*h ( 0    1 )

(2) What to do if a node n is encountered for which h(n) is not known from the first abstract search ? HA*: compute h(n) by doing another abstract search Refinement: ignore n Generalization: choose randomly between the two strategies with probability P ( 0  P  1 ) Hybrid of HA* and Refinement (2)

2-d Space of Algorithms  = weight given to g 1.0 P A* Refinement Graph Traverser Optimal Refinement