2. FSMS AND A*
F.E.A.R. uses both FSMs and A*.
There are only three states in the FSM
Goto
Animate
UseSmartObject
A* is used to plan both paths and sequences of actions
3. ONLY THREE STATES?
AI decision making is really just moving to places and
playing animations. The animation tells the audio system
what sounds to play, but this isn't really part of decision
making.
So the only difference between Goto and Animate is that
Goto is playing an animation while moving, and Animate
only plays the animation.
4. FSMS VS. PLANNING
FSM: tells the AI how to behave in every situation, and is
procedural
Planning: tells the AI what their goals and available
actions are, and lets the AI decide how to sequence them.
Is declarative.
5. A QUICK REVIEW OF STRIPS
STanford Research Institute Problem Solver
Goals: describe the desired state of the world.
Actions: represented in terms of preconditions and
effects.
States update and run code to animate and make
decisions
Delete old knowledge of a variable and add new
knowledge of a variable
6. F.E.A.R. PLANNING
The planner takes a goal set and uses the AI's actions to
fulfill the highest priority possible goal
Different characters can fulfill the same goal in different
ways
7. THREE BENEFITS OF PLANNING
Decoupling goals and actions (satisfying the same goal in
different ways)
Layering simple behaviors to make more complex
behaviors
Give characters dynamic problem solving abilities
8. DIFFERENCES BETWEEN F.E.A.R.
AND STRIPS
1. Cost per action
2. Eliminated add and delete lists for effects
3. Added procedural preconditions
4. Added procedural effects
9. COST PER ACTION
Adding cost per action forces the AI to prefer one plan over
another.
A* plans out a sequence of actions using the cost per action.
Example: getting food - make pie or order pizza?
10. ADD AND DELETE LISTS
F.E.A.R. represents preconditions and effects in a fixed-
length array
Actions just change the variable in the list instead of
removing the old knowledge and adding the new
knowledge. Makes finding an action with a desired effect
trivial.
Attention-selection sub-system deals with multiple weapons
outside the planner so the planner only has to worry about
one weapon at a time.
11. PROCEDURAL PRECONDITIONS
The fixed-size array representing the world state isn't
practical.
Add the ability to run additional precondition checks.
Example: figure out if there's a safe path only when needed.
12. PROCEDURAL EFFECTS
We don't want effects to be instantaneous; to fix this,
sequentially activate the actions and have them set the
current state
13. PSEUDOCODE FOR ACTION CLASS
class Action
{
// Symbolic preconditions and effects,
// represented as arrays of variables.
WORLD_STATE m_Preconditions;
WORLD_STATE m_Effects;
// Procedural preconditions and effects.
bool CheckProceduralPreconditions();
void ActivateAction();
};
14. SQUAD BEHAVIOR
Global coordinator reclusters AI into squads based on
proximity.
Two categories of squad behavior: simple and complex.
Simple: suppression fire, sending AI to different positions,
following.
Complex: flanking, coordinated strikes, retreats, calling
for/integrating reinforcements.
15. SIMPLE SQUAD BEHAVIORS
Get-to-Cover: get all squad members not in valid cover to
valid cover while one AI lays suppression fire.
Advance-Cover: move members of the squad to valid
cover closer to the threat while one AI lays suppression
fire.
Orderly-Advance: moves squad to some position in single
file line. Each AI protects the one in front, last AI faces
backward to cover from behind.
Search: splits squad into pairs that cover each other while
searching rooms.
16. FOUR STEPS OF SQUAD BEHAVIORS
1. Find AI participants
2. Send orders to AI
3. Monitor individual progress
4. AI succeeds or fails to complete goal
17. COMPLEX SQUAD BEHAVIORS
There really aren't any.
The simple behaviors give the impression of being complex
on their own.
Looks like the AI are coming from all sides on purpose, but
might just be getting to closest cover to player.