Title: Tactical AI 3
1Tactical AI 3
- Michael Zyda
- Zyda_at_usc.edu
2Week 5 Autonomous Game Play Interaction
- Project 5 Develop an AI client that fights/plays
against the live players in the networked game
using the internal representation of the state of
the game built for project 4. Use a finite state
machine architecture for this. - Reading http//www.aiwisdom.com/bytopic_statemach
ines.html
3Week 6 Genetic Algorithms Evolutionary
Behaviors
- Project 6 Continue developing the fight/play
behavior of your AI client. Consider how to
develop clients that can dynamically evolve and
develop new tactics and behaviors. Consider
developing an entire evolving architecture of
characters that fight/play against the live
characters in the networked game. - Reading http//www.aiwisdom.com/bytopic_genetic.h
tml - http//www.aiwisdom.com/bytopic_genetic.html
- http//aiwisdom.com/bytopic_strategy.html
- http//aiwisdom.com/bytopic_strategy.html
4- Squad Tactics Team AI and Emergent Maneuvers
- William van der Sterren (CGF-AI)
- AI Game Programming Wisdom, 2002.
- Topics Strategy, Tactical, Coordinated Movement,
Cooperation Genres FPS, Action - Abstract AI squad behavior is made up of
coordinated individual actions towards a joint
goal. There are two basic coordination styles
centralized control by a leader, and
decentralized cooperation between individuals.
This chapter discusses the latter style in
detail. Decentralized cooperation can already be
realized with minor changes to "standard
individual AI". This chapter illustrates how some
tactical squad maneuvers can emerge from these
coordinating individual AIs, using a squad
assault as an example. The limitations of the
approach are illustrated using a second example
a squad ambush. This chapter precedes and
complements the chapter "Squad Tactics Planned
Maneuvers".
5Squad Tactics
- When the AI operates in squads, it can do a lot
for a tactical combat game the squads behavior
communications create a more realistic
atmosphere. - Squads fighting against the player will challenge
his tactical capabilities, and squads fighting
with the player might offer him a commander role.
6Decentralized vs centralized approach
- It is easy to answer why squad AI should be part
of a combat game. - However, it is not so easy to answer how to add
squad AI to that game! - There are many approaches to realize (part of)
the required squad behavior, but none of these is
complete or perfect. - This article and the next discuss two ways of
realizing squad AI and squad tactics (Fig 5.3.1).
7(No Transcript)
8- This article presents a decentralized approach to
squad AI - interactions between squad members,
rather than a single squad leader, determine the
squad behavior. - And from this interaction, squad maneuvers
emerge. - This approach is attractive because it is a
simple extension of individual AI, and because it
can be easily combined with level-specific
scripting. - However, this approach is weak at maneuvers
requiring autonomy or tight coordination.
9- The next article discusses a centralized approach
to squad AI, with a single squad level AI making
most of the decisions. - That squad-level AI autonomously plans and
directs complex team maneuvers. - However, that squad-level AI has trouble dealing
with the strengths and needs of individual squad
members.
10- This article briefly defines the key concepts of
squad ai and squad tactics. - It discusses the decentralized design, and its
elements. - Two examples are used to illustrate how this
design enables squad tactics - a squad attack,
and an ambush. - Based on the example, this article discusses the
strengths and weaknesses of the decentralized
design, and some of the workarounds for the
weaknesses. - For clarity and brevity, the squad here is
assumed to consist of infantry soldiers, but the
ideas presented also apply to many other small
combat formations (tank platoons, trolls, naval
vessels, giant robots, and so forth).
11Squads leadership style
- A squad is a small team, consisting of up to a
dozen members, with its own goals. - The squad tries to accomplish its goals through
coordinated actions of its members, even under
adverse conditions. - Casualties and regroupings cause variations in
the squads structure. - Moreover, nearby operating friendly squads might
interfere with the squads operations.
12Squad leader
- Squads typically have a leader.
- In some cases, this leader is very visible and
has a different role than the other squad
members. - In other cases, such as in room-clearing actions,
the leader acts like any other squad member - the
success of the action is primarily due to
training, rather than the leader.
13- The squad selects and executes certain maneuvers
to accomplish its goals. - Such a maneuver provides each squad member with a
role and task. - A squad maneuver can be tightly or loosely
coordinated. - In a tightly coordinated maneuver, squad members
rely on detailed repeatedly rehearsed drills, and
continuously exchange information to synchronize
and adjust their actions. - Much of the synchronization is done through
quick, nonverbal communications, such as
predefined hand signals.
14- In a loosely coordinated maneuver, squad members
synchronize their actions less often, or just
with part of the squad. - The squad relies less on well-known standard
procedures, and needs larger (verbal)
communications to synchronize the actions. - In designing squad ai, these concepts play an
important role.
15Squad AI through cooperating members
- One approach to squad ai is the decentralized
approach, in which the squad members coordinate
their actions without the need for an ai squad
leader. - This approach is attractive for a variety of
reasons - It simply is an extension of the individual AI.
- It robustly handles many situations.
- It deals well with a variety of capabilities
within the team. - It can easily be combined with scripted squad
member actions. - This combination of properties makes the
decentralized approach an attractive choice for
games that have the player fight through levels
of manually positioned teams of opponents.
16Concept behind decentralized AI
- The design of the decentralized approach is show
in Fig 5.3.2. - The squad consists of AI members who all publish
the following info to nearby squad members - Their intentions
- Their observations
17Solo versus Squad Think Loops
18Where is the squad behavior?
- In this decentralized approach, we find the squad
behavior in the interactions of the squad
members, rather than in their individual actions. - Emergent behavior
- Emergent behavior (or self-organizing behavior)
is functionality originating from the
interactions of elements, rather than from
individual actions. - The emergent behavior is generated from
lower-level, simpler behavior. - The tactical behavior of our squad should emerge
from the interaction of the squad members. - More specifically, it should emerge from the
exchanged observations and intentions, and how
this info is used in planning and executing
individual squad member actions.
19Emergent Fire-and-Maneuver Behavior
- Lets assume that our solo ai features some
simple combat behavior - it either fires at a
threat, or moves via the shortest path to a
better position to fire again. - By moving, the ai is able to close in on threats,
and prevents the threat from getting a stable aim
on him. - See Figure 5.3.3
20Solo AI versus Squad Member AI
21- See the timeline and communications between the
three interacting squad members. - These interactions are easily translatable to
audible communications, making the squad behavior
become more expressive and real. - Robust against casualties
- Can also handle different or special capabilities
of the squad members. - But his is not all there is to squad tactics.
22- Imagine the following - a 4-man patrol,
consisting of a patrol leader, a rifleman, a
machine gunner, and a sniper, runs into an enemy
position, and launches an attack (Fig 5.3.5)
23- Now, we want our squad to do more than just fire
and move - the squad is to employ proper tactical
behavior, including - Stay close to cover
- Prevent blocking other team members
lines-of-fire. - Take weapon capabilities into account.
- Maintain team cohesion - in particular, stay
within audible range and preferably maintain a
line-of-sight to other squad members (analogous
to flocking rules for separation, cohesion, and
avoidance). - Spread out, and prevent becoming a bunched-up
target. - Stay aware of enemy positions and movement thus,
try to keep a line-of-sight on the enemy and his
surroundings.
24- We can deal with these requirements in a
straightforward way if we extend - - The squad members mental picture (the
CombatSituation class). - The messages exchanged between the squad members.
- To include additional tactical info about the
other squad members and their positions,
capabilities and actions. - We also need to process this extra info, which is
done using - A next position to move to algorithm, picking
the tactically most suitable destination. - Squad member subclasses (leader, rifleman,
machine gunner, and sniper) defining the
parameters for their specific behavior.
25(No Transcript)
26Communication among squad members - the messages
- The messages exchanged between the squad members
convey the intentions and observations of the
squad members. - The messages should contain all the info needed
by the receiving squad member to update his
mental picture.
27- Each message also includes the id of the sender.
- Upon receiving the message, the squad member
updates his CombatSituation accordingly. - Depending on the squad coordination style, you
might need to introduce additional messages for
tighter synchronization.
28- Why use messages to pass squad member state info
around, when this info is also available by
inspecting SquadMemberAI objects directly? - You can model communication latency by briefly
queueing the messages. - You can present the message in the game using
animations or sound. - You can filter out messages to the player to
rpevent overloading him. - The squad member will send messages to dead squad
members it assumes still to be alive, adding to
the realism (and preventing perfect knowledge). - You can use scripted entities to direct one or
more squad members by having the scripted
entities send messages to these squad members. - You can accommodate human squad members, whose
state info is largely unavailable, but for whom
the AI can emulate messages with observations and
intentions.
29Picking a tactically sound next position
- Acting tactically requires being in the right
spot. - For a squad member involved in our maneuver, this
right spot depends on his personal capabilities
and needs, on the needs of his squad members, and
on the positions of the enemy (see Fig 5.3.6). - In the maneuver, squad members employ brief
moves, taking just a few seconds. - Therefore, if each squad member repeatedly moves
to the tactically best nearby position, given
the positions of all squad members and threats,
some tactically sound maneuvering is likely to
emerge. - Each squad member uses an evaluation function to
pick the most suitable spot from all nearby
spots. - This function evaluates many tactical aspects of
each position, based on the squad members state
and preferences, known squad claims on positions,
and the threats (Listing 5.3.2).
30(No Transcript)
31(No Transcript)
32- The evaluation function is robust - it will
return a spot to move to in all types of
situations and terrain, as long as sufficient
maneuver space is available. - Note that the best next position evaluation
criteria are reactive these criteria are largely
determined by the behavior of the threat and
other squad members. - This reactivity typically leads to varied
behavior when the battle is repeated.
33- However, this reactivity does not provide good
results in the absence of threats. - In such a situation, the squad should occupy
sound tactical locations that in general provide
a good fighting position against any threat. - The squad can do so by avoiding any spot that
limits the ability to attack, such as ladders,
deep water, or elevators. - Additionally, the squad member can try to
maintain its position in the squads formation
(and pay a penalty for spots away from that
position).
34Personalizing the squad member behavior
- Different squad members have different prefs for
a position to move to. - These diffs are due to the squad members
capabilities, the state of the squad member and
his equipment, and the circumstances. - Riflemen behave differently from machine gunners
and snipers - riflemen move quick and often, and
are expected to close in with the enemy. - Machine gunners, on the other hand, will be
slowed by their load, and prefer delivering
support fire from a rather static position.
35- Machine gunners will not move very often, and
consequently need a position providing sufficient
concealment and cover. - A sniper will not close in, but engage the enemy
from a distance. - Having a clear view and some cover is important
for the sniper. - The squad members state also influences the
position preferences - cover is more preferred
when the squad member is wounded or has to reload.
36- The presence of threats and friendly forces
influences how the squad member moves - a large
number of friendly forces and few threats cause
aggressive and audacious moves, whereas the
reverse situation results in more cautious
position choices.
37Waiting in ambush - pros and cons
- Our squad is to perform an L-shaped ambush from a
position near the edge of the woods. - To execute this ambush, our squad needs to be
able to - Wait until the enemy moves into the kill zone,
after which the squad is to aggressively attack
the enemy. - Pull back to a predefined rally point shortly
after engaging the threats. - Return fire, leave the ambush, and pull back to
the rally point when discovered (and engaged) by
the enemy before it reaches the kill zone (Fig
5.3.7).
38(No Transcript)
39- This decentralized approach to squad ai deals
well with half of these ambush requirements. - First, each of the squad members will return fire
when being attacked, without relying on
instructions from a team leader. - It will not be easy for the enemy to take out the
ambush from a distance. - Second, this ai is easily enhanced to include a
strong pref for being near the rally point. - As a result, the squad members will fire and
maneuver toward the rally point. - To enable this behavior, the level designer
should be given access to such an optional,
editable squad member property.
40- By implementing a squad member aggression level
that depends on the number of nearby team
members, and on the number of threats it is
engaging, we can get the squad to briefly engage
the enemy, and fall back when taking casualties. - However, our decentralized approach has trouble
dealing with the other ambush requirements. - Most important, a squad org based on cooperation
rather than an explicit leader will have serious
trouble reaching a decision and executing it
unanimously.
41- For our ambush, this means that our squad is not
organized to collectively hold fire until the
threats reach the kill zone. - We would have to introduce a sleep state, and
wake up the squad either when receiving hostile
fire, or when hostile forces activate a trigger
positioned at the kill zone. - Additionally, the squad lacks autonomy.
- Whereas the squad does consist of autonomous
members, nobody has been tasked to think for the
squad. - If the enemy moves toward the kill zone, but
decides to pull back before reaching it, nobody
in the squad will bother to assault. - Sensors, perception, goals hierarchy missing
- Due to the same lack of autonomy, the squad would
never initiate the L-shape ambush itself. - It is up to the level designers to invent the
ambush and position th squad.
42- Squad Tactics Planned Maneuvers
- William van der Sterren (CGF-AI)
- AI Game Programming Wisdom, 2002.
- Topics Strategy, Tactical, Coordinated Movement,
Cooperation Genres FPS, Action - Abstract AI squad behavior can also be realized
by designing an explicit team leader, responsible
for planning and managing the squad's maneuver.
This AI team leader assesses the squad's state,
picks and plans the most appropriate squad
maneuver. He executes the squad maneuver by
issuing orders, and by interpreting feedback and
information from the squad members. This is
illustrated using a bounding overwatch squad
advance. This centralized style to squad AI is
more complex than the emergent behavior in "Squad
Tactics Team AI and Emergent Maneuvers".
However, it does provide largely autonomous
operating squads, able to execute complex
maneuvers, and often combines well with some
decentralized cooperation among squad members.
43(No Transcript)
44(No Transcript)
45(No Transcript)
46(No Transcript)
47(No Transcript)
48(No Transcript)
49(No Transcript)
50(No Transcript)
51(No Transcript)