Automated Planning & Computer Games: Perspectives and Applications

Slides:



Advertisements
Similar presentations
Practical Planning: Scheduling and Hierarchical Task Networks Chapter CS 63 Adapted from slides by Tim Finin and Marie desJardins.
Advertisements

In the name of God An Application of Planning An Application of PlanningJSHOP BY: M. Eftekhari and G. Yaghoobi.
Planning
Hierarchical Task Network (HTN) Planning Hai Hoang 4/17/2007.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
Automated Planning & Computer Games: Perspectives and Applications Hector Munoz-Avila.
1 Planning. R. Dearden 2007/8 Exam Format  4 questions You must do all questions There is choice within some of the questions  Learning Outcomes: 1.Explain.
AI – Week 8 AI + 2 Player Games Lee McCluskey, room 3/10
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
(Classical) AI Planning. Some Examples Route search: Find a route between Lehigh University and the Naval Research Laboratory Project management: Construct.
General Purpose Case-Based Planning. General Purpose vs Domain Specific (Case-Based) Planning General purpose: symbolic descriptions of the problems and.
Strategic Planning for Unreal Tournament© Bots Héctor Muñoz-Avila Todd Fisher Department of Computer Science and Engineering Lehigh University USA Héctor.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
Planning (Chapter 10)
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Hierarchical Plan Representations for Encoding Strategic Game AI Hai Hoang Stephen Lee-Urban Héctor Muñoz-Avila Lehigh University
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Planning (Chapter 10)
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Automated Planning Dr. Héctor Muñoz-Avila. What is Planning? Classical Definition Domain Independent: symbolic descriptions of the problems and the domain.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
(Classical) AI Planning. General-Purpose Planning: State & Goals Initial state: (on A Table) (on C A) (on B Table) (clear B) (clear C) Goals: (on C Table)
1 CMSC 471 Fall 2004 Class #21 – Thursday, November 11.
1 CMSC 471 Fall 2002 Class #24 – Wednesday, November 20.
Causal-link planning 1 Jim Blythe. 2 USC INFORMATION SCIENCES INSTITUTE Causal Link Planning The planning problem Inputs: 1. A description of the world.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Team Member AI in an FPS and Goal Oriented Action Planning.
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
SNS College of Engineering Department of Computer Science and Engineering AI Planning Presented By S.Yamuna AP/CSE 5/23/2018 AI.
Planning (Chapter 10) Slides by Svetlana Lazebnik, 9/2016 with modifications by Mark Hasegawa-Johnson, 9/2017
Inference in Bayesian Networks
Planning (Chapter 10)
Subject Name: File Structures
Planning (Chapter 10)
C ODEBREAKER Class discussion.
CS 4700: Foundations of Artificial Intelligence
Review for the Midterm Exam
Chapter 15 QUERY EXECUTION.
CO Games Development 2 Week 19 Extensions to Finite State Machines
Chapter 23 Planning in the Game of Bridge
CSE373: Data Structures & Algorithms Lecture 14: Hash Collisions
Planning José Luis Ambite.
CSE373: Data Structures & Algorithms Lecture 14: Hash Collisions
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Code Shape III Booleans, Relationals, & Control flow
CIS 488/588 Bruce R. Maxim UM-Dearborn
Chapter 23 Planning in the Game of Bridge
Class #20 – Wednesday, November 5
CSE 2010: Algorithms and Data Structures Algorithms
Chapter 23 Planning in the Game of Bridge
Authors: Barry Smyth, Mark T. Keane, Padraig Cunningham
Some Additional Notes about GOAP
Lecture 10, Computer Networks (198:552)
Mini-Max search Alpha-Beta pruning General concerns on games
Search.
The Rich/Knight Implementation
Search.
Implementation of Learning Systems
CS51A David Kauchak Spring 2019
Class #17 – Tuesday, October 30
The Rich/Knight Implementation
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Automated Planning & Computer Games: Perspectives and Applications Hector Munoz-Avila

General-Purpose Planning: State & Goals Initial state: (on A Table) (on C A) (on B Table) (clear B) (clear C) Goals: (on C Table) (on B C) (on A B) (clear A) Initial state Goals C B A B C (Ke Xu)

General-Purpose Planning: Operators No block on top of ?x No block on top of ?y nor ?x ?x ?y transformation ?y ?x … … On table Operator: (Unstack ?x) Preconditions: (on ?x ?y) (clear ?x) Effects: Add: (on ?x table) (clear ?y) Delete: (on ?x ?y)

Planning: Search Space B C A B C B A B A C B A C B A B C C B A B A C A C A A B C B C C B A A B C (Michael Moll)

Some Examples Which of the following problems can be modeled as AI planning problems? Route search: Find a route between Lehigh University and the Naval Research Laboratory Project management: Construct a project plan for organizing an event (e.g., the Musikfest) Military operations: Develop an air campaign Information gathering: Find and reserve an airline ticket to travel from Newark to Miami Game playing: plan the behavior of a computer controlled player Resources control: Plan the stops of several of elevators in a skyscraper building. Answer: ALL!

Classes of General-Purpose Planners General purpose planners can be classified according to the space where the search is performed: We are going to discuss these forms Hierarchical Disjunctive plans state plan SAT

State- and Plan-Space Planning State-space planners transform the state of the world. These planners search for a sequence of transformations linking the starting state and a final state State of the world (total order) Plan-space planners transform the plans. These planners search for a a plan satisfying certain conditions (partial-order, least-commitment)

Why Plan-Space Planning? 1. Motivation: “Sussman Anomaly” Two subgoals to achieve: (on A B) (on B C) A C B A B C

Why Plan-Space Planning? Problem of state-space search: Try (on A B) first: put C on the Table, then put A on B Accidentally wind up with A on B when B is still on the Table We can not get B on C without taking A off B Try to solve the first subgoal first appears to be mistaken A A B C A B C B C

But… Does Automated Planning has any use in Computer Games? F.E.A.R. not! Intro: http://www.youtube.com/watch?v=iNiss2ccDjA Combat sequence

Implementation Points in FEAR Goal Three categories of gaming goals Relaxed Investigative Aggressive Planner Search: state-space planning World Representation: compiled in a data structure Planner Optimization: compiled operators, heuristics (factoring the gaming goals)

Automated Planning: Uses in Games AI paradigm used to implement opponent’s behavior in FEAR (see previous class) Automated Planning is used to gain flexibility in designing Game AI behavior An action: Attack positioned Weapon ready Enemy attacked effects preconditions

Example positioned Enemy attacked Attack Weapon is ready positioned FEAR defines 30+ such actions. So could generate many plans. How else could we use to create an opponent AI? Attack positioned Weapon is ready Enemy attacked Stay-put positioned Take cover Prepare Weapon Ammo loaded Holding weapon Weapon is ready How many plans can we generate to achieve Enemy attacked? FSMs (Project 1)

Optimization: Representation Declared as a C++ procedure: Action Attack() { if (positioned && WeaponISReady) EnemyAttacked = true; } Attack positioned Weapon is ready Enemy attacked Declared as a variable in standard C++: Boolean EnemyAttacked; Discussion points: Complexity versus an standard AI planner So why AI planners do not adopt this?

Optimization: Search C A B C A B C B A B A C B A C B A B C C B A B A C (Michael Moll)

Implementation Continued

Implementation Continued Operators are represented as code Allows fast running time evaluation

FSM vs AI Planning (for details see Stanislav’s presentation) FSM: Planning Operators Patrol Preconditions: No Monster Effects: patrolled Fight Monster in sight (for details see Stanislav’s presentation) Patrol Fight Monster In Sight No Monster FSM: A resulting plan: Patrol patrolled Fight No Monster Monster in sight Neither is more powerful than the other one

Planning Gives More Flexibility But Developer May Loose Control “Separates implementation from data” --- Orkin reasoning knowledge Many potential plans: Patrol Fight … Planning Operators Patrol Preconditions: No Monster Effects: patrolled Fight Monster in sight … If conditions in the state change making the current plan unfeasible: replan!

Hierarchical (HTN) Planning Principle: Complex tasks are decomposed into simpler tasks. The goal is to decompose all the tasks into primitive tasks, which define actions that change the world. Travel(UMD, Lehigh) Travel from UMD to Lehigh University Fly(National, L.V. International) Travel(L.V. Int’nal,Lehigh) Travel(UMD,National) Seats available Travel by plane Enough money for air fare available Travel by car Enough money for gasoline Roads are passable Taxi(UMD,UMD-Metro) Metro(UMD-Metro,National) alternative methods Taxi(L.V. Int’nal,Lehigh)

Application to Computer Bridge Chess: better than all but the best humans Bridge: worse than many good players Why bridge is difficult for computers It is an imperfect information game Don’t know what cards the others have (except the dummy) Many possible card distributions, so many possible moves If we encode the additional moves as additional branches in the game tree, this increases the number of nodes exponentially worst case: about 6x1044 leaf nodes average case: about 1024 leaf nodes Not enough time to search the game tree (Dana S. Nau)

How to Reduce the Size of the Game Tree? Bridge is a game of planning Declarer plans how to play the hand by combining various strategies (ruffing, finessing, etc.) If a move doesn’t fit into a sensible strategy, then it probably doesn’t need to be considered HTN approach for declarer play Use HTN planning to generate a game tree in which each move corresponds to a different strategy, not a different card Reduces average game-tree size to about 26,000 leaf nodes Bridge Baron: implements HTN planning Won the 1997 World Bridge Computer Challenge All commercial versions of Bridge Baron since 1997 have include an HTN planner (has sold many thousands of copies) (Dana S. Nau)

Why “Classical”? Classical planning makes a number of assumptions: Symbolic information (i.e., non numerical) Actions always succeed The “Strips” assumption: only changes that takes place are those indicated by the operators Despite these (admittedly unrealistic) assumptions some work-around can be made (and have been made!) to apply the principles of classical planning to games Neoclassical planning removes some of these assumptions