Скачать презентацию Hierarchical Planning in Game AI Ke Xu 9 22 2004 Скачать презентацию Hierarchical Planning in Game AI Ke Xu 9 22 2004

cf2b8e3a8f4f60de82ec64026a278b21.ppt

  • Количество слайдов: 28

Hierarchical Planning in Game AI Ke Xu 9/22/2004 Hierarchical Planning in Game AI Ke Xu 9/22/2004

Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Strategic Planning for UT Bots n Multi-Tiered AI Framework (chapter 7. 9) n n Explanation for Hierarchical Planning

Problems with the Reactive Approach n n n Relies on the “God” Difficult to Problems with the Reactive Approach n n n Relies on the “God” Difficult to perform a sequence of actions Difficult to coordinate

Classical Planning n n Current States a plan Goal States Operator n n A Classical Planning n n Current States a plan Goal States Operator n n A precondition list An add list A delete list Precondition list Add list Delete list Limitation: n Assumes that the world does not change during the time gap between planning and execution

Hierarchical Planning n n Idea: decompose high-level, abstract tasks into low-level, concrete tasks (actions) Hierarchical Planning n n Idea: decompose high-level, abstract tasks into low-level, concrete tasks (actions) Strictly more expressive than operator representation More effective Hierarchical Task Networks (HTN) n n Tasks: primitive (action) / non-primitive (compound tasks) Methods (task reduction schemas): expand or reduce non-primitive tasks Operators (no preconditions, only effects): reduce methods Critics: remove conflicts to reduce backtracking

HTN Example Task Get a better weapon Buy Pick Kill & Pick Operator Explode HTN Example Task Get a better weapon Buy Pick Kill & Pick Operator Explode the target Approach to the plant site Secure the plant site Plant the bomb Select a route Method Head: Plant Bomb Cover teammates Preconditions: Bomb Site Secured Subtasks: Plant Kill enemies Guard the bomb Plant

The HTN Planning Procedure Problem P Primitive Only? N Choose t Choose m Replace The HTN Planning Procedure Problem P Primitive Only? N Choose t Choose m Replace t Resolve c Y Resolvable c? Y Resolve c N Return failure Return results

Re-planning in HTN n Partial Re-planning n n Anytime Anywhere Repair rather than replan Re-planning in HTN n Partial Re-planning n n Anytime Anywhere Repair rather than replan from sketch Propagate the effect of re-planning n Example Top-Level Task Kill Agent T 1 T 2 Pick-Up Weapon X Attack Agent

Planning Agent Cooperation n n Why: Interaction and n Coordinating HP dependency of agent Planning Agent Cooperation n n Why: Interaction and n Coordinating HP dependency of agent lower cost / actions more flexibility Coordination How : n n Eliminating conflicts: to localize plan effects to individual agents Coordinating plans: to use synchronization actions levels crisper coordination

Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Strategic Planning for UT Bots n Multi-Tiered AI Framework (chapter 7. 9) n n Explanation for Hierarchical Planning

Strategic Planning for UT Bots n n n Event-driven Client-Server architecture Behavior control n Strategic Planning for UT Bots n n n Event-driven Client-Server architecture Behavior control n n Java Bots Soar Bots n n Operator: preconditions and effects Rules: select/apply/compare/inter rupt/terminate n The Issues n n n Individual reaction to dynamic environment Contribution to the winning strategy Single bot

HTN Representation of Strategies n Method n Operator HTN Representation of Strategies n Method n Operator

Built-In Preconditions and Effects n Problems Expressions of precondition are difficult and time-consuming n Built-In Preconditions and Effects n Problems Expressions of precondition are difficult and time-consuming n Effects require complex executions n n Solution Hard-coded evaluations and executions n Each operator affects a single bot; the coordination is reflected in the hierarchy but not in the specific actions n

Strategy Change vs. Strategy Modification n Conditions may change when the current strategy is Strategy Change vs. Strategy Modification n Conditions may change when the current strategy is been pursued n n Pre-define a threshold for strategies Re-planning n No need to change all tasks in the plan

Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Strategic Planning for UT Bots n Multi-Tiered AI Framework (chapter 7. 9) n n Explanation for Hierarchical Planning

Multi-Tiered AI Framework n The Intelligence Structure: Strategic Intelligence (SI) n Operational Intelligence (OI) Multi-Tiered AI Framework n The Intelligence Structure: Strategic Intelligence (SI) n Operational Intelligence (OI) n Tactical Intelligence (TI) n Individual Unit (IU) n SI OI TI IU SI makes general goals and plans OI is concerned with implementing the general orders from SI TI Prepares the data for IU

Situational Projects n SPs: the basic messages for communications between different levels of AIs Situational Projects n SPs: the basic messages for communications between different levels of AIs OI 1 SP 1 SI SP 2 OI 1 TI 1 IU 1 OI 2 TI 2 IU 2 TI 3 … IUn

The MTAIF Class Architecture SI package of functions and strategies Empire Manager Player Object The MTAIF Class Architecture SI package of functions and strategies Empire Manager Player Object Player Core (basic functionality) City Manager Objects Offensive Defensive City Manager Object Field Manager Objects Unit Objects OI TI Neutral Unit Object IU

Multiple SP Containers n n n A concept of RTS – load balancing: Allow Multiple SP Containers n n n A concept of RTS – load balancing: Allow the processing of a SP and the subsequent action to occur over multiple frames A series of linked SP containers - pathfinding

Threads n n Some SPs require longer execution time (e. g. , massing troop Threads n n Some SPs require longer execution time (e. g. , massing troop or marching) Use threads for each linked SP container SP SPC n SPC … SPC Need to update the data and SPs

Other Applications of MTAIF n n Classical turn-based and RTS games Sports games Other Applications of MTAIF n n Classical turn-based and RTS games Sports games

Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Outline n n Hierarchical Planning in Dynamic Worlds (chapter 3. 5) Applying Hierarchical Planning Strategic Planning for UT Bots n Multi-Tiered AI Framework (chapter 7. 9) n n Explanation for Hierarchical Planning

Explanations for HP n Role of Explanation: to improve the game model which is Explanations for HP n Role of Explanation: to improve the game model which is implemented in HTN planning n n Allowing users to interrogate the behavior of a computer player Explaining what caused/lead to the current state Explaining the motivation for knowledge/reasoning refinement Preventing the learning of unrealistic/non-doctrinal behaviors

Representing Explanations An explanation is a collection of methods’ preconditions and preferences, tasks (compound Representing Explanations An explanation is a collection of methods’ preconditions and preferences, tasks (compound and primitive), and actions.

Representing Explanations (Cont. ) Method 1 Method 2 Representing Explanations (Cont. ) Method 1 Method 2

Explanation Types (for RTS) n n Strategy selection Course of action outcome Game model Explanation Types (for RTS) n n Strategy selection Course of action outcome Game model update Prediction Capture. Supply. Road(X, TF 1 )

Stratagus/Magnant Stratagus/Magnant

References n n n AI Game Programming Wisdom 2 H. Munoz-Avila & T. Fisher, References n n n AI Game Programming Wisdom 2 H. Munoz-Avila & T. Fisher, Strategic Planning for Unreal Tournament Bots. H. Munoz-Avila & D. Aha, On the Role of Explanation for Hierarchical Case-Based Planning in Real-Time Strategy Games.