Title: Hierarchical Planning in Game AI
1Hierarchical Planning in Game AI
2Outline
- Hierarchical Planning in Dynamic Worlds (chapter
3.5) - Applying Hierarchical Planning
- Strategic Planning for UT Bots
- Multi-Tiered AI Framework (chapter 7.9)
- Explanation for Hierarchical Planning
3Problems with the Reactive Approach
- Relies on the God
- Difficult to perform a sequence of actions
- Difficult to coordinate
4Classical Planning
- Current States ? a plan ? Goal States
- Operator
- A precondition list
- An add list
- A delete list
- Limitation
- Assumes that the world does not change during the
time gap between planning and execution
5Hierarchical Planning
- Idea decompose high-level, abstract tasks into
low-level, concrete tasks (actions) - Strictly more expressive than operator
representation - More effective
- Hierarchical Task Networks (HTN)
- 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
6HTN Example
Explode the target
Plant the bomb
Get a better weapon
Secure the plant site
Approach to the plant site
Guard the bomb
Buy
Select a route
Plant
Pick
Kill enemies
Kill Pick
Cover teammates
7The HTN Planning Procedure
Problem P
Primitive Only?
Resolvable c?
Y
Y
Resolve c
N
N
Return results
Return failure
Choose t
Choose m
Replace t
Resolve c
8Re-planning in HTN
- Partial Re-planning
- Anytime
- Anywhere
- Repair rather than re-plan from sketch
- Propagate the effect of re-planning
Top-Level Task Kill Agent
T2 Attack Agent
T1 Pick-Up Weapon X
9Planning Agent Cooperation
- Why Interaction and dependency of agent actions
- How
- Eliminating conflicts to localize plan effects
to individual agents - Coordinating plans to use synchronization actions
crisper coordination
lower cost / more flexibility
Coordination levels
10Outline
- Hierarchical Planning in Dynamic Worlds (chapter
3.5) - Applying Hierarchical Planning
- Strategic Planning for UT Bots
- Multi-Tiered AI Framework (chapter 7.9)
- Explanation for Hierarchical Planning
11Strategic Planning for UT Bots
- UT Bots
- Event-driven
- Client-Server architecture
- Behavior control
- Java Bots
- Soar Bots
- Operator preconditions and effects
- Rules select/apply/compare/interrupt/terminate
- The Issues
- Individual reaction to dynamic environment
- Contribution to the winning strategy
- Single bot
12HTN Representation of Strategies
13Built-In Preconditions and Effects
- Problems
- Expressions of precondition are difficult and
time-consuming - Effects require complex executions
- Solution
- Hard-coded evaluations and executions
- Each operator affects a single bot the
coordination is reflected in the hierarchy but
not in the specific actions
14Strategy Change vs. Strategy Modification
- Conditions may change when the current strategy
is been pursued - Pre-define a threshold for strategies
- Re-planning
- No need to change all tasks in the plan
15Outline
- Hierarchical Planning in Dynamic Worlds (chapter
3.5) - Applying Hierarchical Planning
- Strategic Planning for UT Bots
- Multi-Tiered AI Framework (chapter 7.9)
- Explanation for Hierarchical Planning
16Multi-Tiered AI Framework
- The Intelligence Structure
- Strategic Intelligence (SI)
- Operational Intelligence (OI)
- Tactical Intelligence (TI)
- Individual Unit (IU)
SI makes general goals and plans
OI is concerned with implementing the general
orders from SI
TI Prepares the data for IU
17Situational Projects
- SPs the basic messages for communications
between different levels of AIs
OI1
18The MTAIF Class Architecture
SI
package of functions and strategies
Unit Object
OI
TI
IU
19Multiple SP Containers
- 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
20Threads
- Some SPs require longer execution time (e.g.,
massing troop or marching) - Use threads for each linked SP container
- Need to update the data and SPs
21Other Applications of MTAIF
- Classical turn-based and RTS games
- Sports games
22Outline
- Hierarchical Planning in Dynamic Worlds (chapter
3.5) - Applying Hierarchical Planning
- Strategic Planning for UT Bots
- Multi-Tiered AI Framework (chapter 7.9)
- Explanation for Hierarchical Planning
23Explanations for HP
- Role of Explanation to improve the game model
which is implemented in HTN planning - 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-doctrin
al behaviors
24Representing Explanations
An explanation is a collection of methods
preconditions and preferences, tasks (compound
and primitive), and actions.
25Representing Explanations (Cont.)
26Explanation Types (for RTS)
- Strategy selection
- Course of action outcome
- Game model update
- Prediction
27Stratagus/Magnant
28References
- 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.