1 CO3301 - Games Development 2 Week 17 – Goal-Oriented Action Planning Gareth Bellaby.

Slides:



Advertisements
Similar presentations
Planning.
Advertisements

Practical Planning: Scheduling and Hierarchical Task Networks Chapter CS 63 Adapted from slides by Tim Finin and Marie desJardins.
REVIEW : Planning To make your thinking more concrete, use a real problem to ground your discussion. –Develop a plan for a person who is getting out of.
Language for planning problems
CSE391 – 2005 NLP 1 Planning The Planning problem Planning with State-space search.
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.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
Andrew Courter Texas Tech University CS5331.  PKS Why PKS? STRIPS The Databases Inference Algorithm Extended Features  PKS Examples  Conclusion and.
Artificial Intelligence 2005/06
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Artificial Intelligence Chapter 11: Planning
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Planning Russell and Norvig: Chapter 11. Planning Agent environment agent ? sensors actuators A1A2A3.
Planning Planning is a special case of reasoning We want to achieve some state of the world Typical example is robotics Many thanks to Robin Burke, University.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Classical Planning Chapter 10.
1 CO Games Development 1 Week 5 Deriving a "look at" function + Graph Theory Gareth Bellaby.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
April 3, 2006AI: Chapter 11: Planning1 Artificial Intelligence Chapter 11: Planning Michael Scherger Department of Computer Science Kent State University.
Recursion Chapter 7. Chapter Objectives  To understand how to think recursively  To learn how to trace a recursive method  To learn how to write recursive.
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
Artificial Intelligence: Planning Lecture 6 Problems with state space search Planning Operators A Simple Planning Algorithm (Game Playing)
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Section 3.1: Proof Strategy Now that we have a fair amount of experience with proofs, we will start to prove more difficult theorems. Our experience so.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
110/19/2015CS360 AI & Robotics AI Application Areas  Neural Networks and Genetic Algorithms  These model the structure of neurons in the brain  Humans.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
First-Order Logic and Plans Reading: C. 11 (Plans)
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
Artificial Intelligence in Game Design
1 CO Games Development 1 Week 2 Game Agents Gareth Bellaby.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
Stephen Flockton.  What is my Project?  What is Planning?  Advantages and Disadvantages of Planning.  Description of the Product.  Product Demonstration.
Lecture 2: 11/4/1435 Problem Solving Agents Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
1/16 Planning Chapter 11- Part1 Author: Vali Derhami.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 CO Games Development 1 Week 13 - Revision Lecture AI Revision Gareth Bellaby.
Intro to Planning Or, how to represent the planning problem in logic.
(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)
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
1 CMSC 471 Fall 2004 Class #21 – Thursday, November 11.
Planning I: Total Order Planners Sections
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
1 CO Games Development 2 Week 16 Blackboard Model Gareth Bellaby.
Consider the task get milk, bananas, and a cordless drill.
Some Thoughts to Consider 5 Take a look at some of the sophisticated toys being offered in stores, in catalogs, or in Sunday newspaper ads. Which ones.
1 CO Games Development 1 Week 9 - part 2 Pathfinding Considerations Gareth Bellaby.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
CLASSICAL PLANNING. Outline  The challenges in planning with standard search algorithm  Representing Plans – the PDDL language  Planning as state -
CO Games Development 2 Week 16 Blackboard Model
SNS College of Engineering Department of Computer Science and Engineering AI Planning Presented By S.Yamuna AP/CSE 5/23/2018 AI.
CO Games Development 2 Week 19 Extensions to Finite State Machines
Class #17 – Thursday, October 27
Graphplan/ SATPlan Chapter
CIS 488/588 Bruce R. Maxim UM-Dearborn
Class #19 – Monday, November 3
Class #20 – Wednesday, November 5
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
CO Games Development 2 Week 21 Turing Machines & Computability
Presentation transcript:

1 CO Games Development 2 Week 17 – Goal-Oriented Action Planning Gareth Bellaby

2 Introduction ●In AI literature tend to just use the word "planning". ●In games the phrase "Goal-Oriented Planning" (GOAP) is common. ●One way to think about a planning system is a version of a FSM. ●Like a FSM it uses states. However, the boxes represent actions whilst states are the input into, and output from, an action.

3 STRIPS ●STRIPS (Stanford Research Institute Problem Solver) ●Formal language developed by Richard Fikes and Nils Nilsson. ●"STRIPS: A New Approach to the Application of Theorem Proving to Problem Solving" published in ●Assumes that all conditions not stated to be true are false.

4 Importance ●Used in a number of recent games. ●F.E.A.R. Demonstrated its commercial importance. The AI in F.E.A.R. is highly regarded. It was perceived to have aided the success of the game. ●F.E.A.R. 2: Project Origin. ●Fallout 3. ●Silent Hill: Homecoming. ●Empire: Total War. ●Not a comprehensive list.

5 Justification ●The search techniques we've looked at are not useful for certain types of problems because ●large branching factor ●problem of decomposing some problems into discrete states ●finding an efficient heuristic function

6 Planning ●Planning is the process of divising a sequence of actions to achieve a goal. ●Search techniques such as pathfinding are an example of planning. ●Could try to deal with problems as they arise but this is inefficient. Get stuck in blind alleys. Having to repeat actions. Having to backtrack. Planning turns out to be a far better approach.

7 Language ●Using actions, states and goals. ●Need a language for representing problems. ●The process is one of expressing the world as logical conditions. ●Propositional logic. ●Statements. ●First order representations of actions. ●Logical structure.

8 Example ●Consider the problem of moving from A to B. ●The start state is being at location A. ●The goal state is being at location B. ●The action is movement from A to B. ●The problem is described using logical statements. ●In order to move from A to be you would have to be at location A. ●If you have moved to location B you would now be at location B. ●How else to represent this?

9 State ●Expressed as logical statements, e.g. ●At( B ) ● Logical statements can be combined together, e.g. ●At( door ) AND holding( key ) ●If you look at literature you will see that it tends to use logical symbols: ●At( door ) ^ holding( key )

10 State ●Formally the state is a conjunction of literals. ●Propositional literals. ●First-order literals. ●The literals are function-free ●So can't have: ●At( open( door ) )

11 Goal ●A goal is expressed as a state. ●For example, ●At( B )

12 Actions ●An action is specified in terms of preconditions and effects ●For example, move from A to B ●Move(A, B) ●Preconditions: At(A) ●Postconditions: not At(A), At(B)

13 Actions ●Every literal not explicitly referred to in the effect remains unchanged. ●The postcondition has to state the negation of the precondition in order to remove it from the list. ●Uses a list

14 Reasoning ●Precondition is the entry state. ●Postcondition is the exit state. ●The exit state and entry state are logical statements. ●An action takes the system from an entry state to an exit state. An action is expressed in terms of a change in state of the system. ●The system as a whole answers a question.

15 Example ●Want to go from point A to point B. ●Unfortunately there is a closed and locked door in the way. ●There are three actions, each leading to the logical statement "The door is open". ●The door can be unlocked and opened if you have the key. ●The door can be picked open if you have the lockpicks. ●The door can be destroyed if you the explosives.

16 Example ●The goal state is ●At( B ) ●The Move action is: ●Move(A, B) ●Preconditions: At(A) ●Postconditions: not At(A) ^ At(B)

17 Unlocking the door ●Door is closed and locked. ●Player has a key ●Action is to unlock the door thus opening it ●Unlock(door) ●Preconditions: holding( key ) ^ At( A ) ^ door( closed ) ●Postconditions: door( open )

18 Picking the lock ●Door is closed and locked. ●Player has lockpicks ●Action is to Pick lock thus opening it. ●Pick(door) ●Preconditions: holding(lockpicks ) ^ At( A ) ^ door( closed ) ● Postconditions: door( open )

19 Destroying the door ●Player has explosives ●Action is to destroy the door thus opening it. ●BlowUp(door) ●Preconditions: holding(explosives ) ^ At( A ) ^ door( closed ) ● Postconditions: door( open )

20 3 ways to open the door

21 Opening the door

22 Goal state

23 Combining actions

24 Analysis ●Notice the way in which this is different from a FSM. There are no specified links. The system merely attaches preconditions to postconditions. ●Need to specific the representation of the system. ●Break the problem into a set of discrete actions and logical statements. ●Notice the way that I don't have to specify that the door is unlock (picked, destroyed) because it is implicit in the change of state from closed to open.

25 Scenario ●If the door was just open then the agent would simply go through it. ●If the door was closed then select the solution which is applicable. ●Obvious to see how it could be extended, e.g. the agent doesn't have the key but they ke is held by a guard, or the agent doesn't have the explosive but it can be found in the ammo safe. ●And further... the key can be obtained if the guard is killed... or unconscious... need a gun... or a the knockout gas... and so on.

26 Advantages ●Flexible. If the door was just open then the agent would simply go through it. Could supply one of the objects. Could chain with other actions to create multiple scenarios. In this way we can specify the language of moving from one location to another and of opening doors. ●Efficient. ●Multiple agents. ●Dynamic: system can change with the agent inside in it.

27 Forwards and backwards chaining ●There are multiple forms of branching. Could fan out, could fan in, multiple routes, etc. ●Multiple paths, some leading to dead ends. ●Multiple solutions (some more efficient than others). ●Need to employ backwards and forwards chaining algorithms.

28 Forwards and backwards chaining ●Forwards chaining - moving forward from the start state, chaining postconditions onto preconditions. ●Backwards chaining - moving backwards from the goal state, chaining preconditions onto postconditions.

29 Efficiency ●Multiple solutions. How to gauge which to use? ●Mentioned efficiency. ●Could simply count the number of steps in the solution (number of links). ●However, some actions could be difficult than others. ●Perhaps ascribe a complexity score to the actions. ●Employ a search algorithm.

30 Extensions ●Planning within the context of deterministic, observable, finite systems. ●Change occurs when the agent acts. ●There are extensions which bring in nondeterministic systems. ●The planning languages used have been systematised within a common syntax. This is called the Planning Domain Definition Language.

31 References ●The following URL has lots of relevant articles, including key ones by Fikes and Nilsson. ● ●Russell and Norvig, Atificial Intelligence, Chapter 11. ●"Command Hierarchies Using Goal-Oriented Action Planning", David Pittman, AI Game Programming Wisdom 4. ●"Applying Goal-Oriented Action Planning to Games", Jeff Orkin, AI Game Programming Wisdom 2. ●"Implementing Practical Planning for Game AI", Jamie Cheng, Game Programming Gems 5.

32 References ●Jeff Orkin ● ●Good collection of resources. Includes his own: ●"3 States and a Plan: The AI of F.E.A.R.", GDC ●"Agent Architecture Considerations for Real-Time Planning in Games", AIIDE ●"Symbolic Representation of Game World State: Toward Real-Time Planning in Games", AAAI Challenges in Game AI Workshop ●"Applying Goal-Oriented Planning for Games", draft for AI Game Programming Wisdom 2. ●Also other useful links.