Artificial Intelligence in Games Week 7 - PowerPoint PPT Presentation

About This Presentation
Title:

Artificial Intelligence in Games Week 7

Description:

Artificial Intelligence in Games Week 7 Steve Rabin steve.rabin_at_gmail.com www.aiwisdom.com/uw * – PowerPoint PPT presentation

Number of Views:99
Avg rating:3.0/5.0
Slides: 61
Provided by: aiwisdomCo3
Category:

less

Transcript and Presenter's Notes

Title: Artificial Intelligence in Games Week 7


1
Artificial Intelligence in GamesWeek 7
  • Steve Rabin
  • steve.rabin_at_gmail.com
  • www.aiwisdom.com/uw

2
Pathfinding Integration Project
  • How did it go?
  • Any problems?
  • How much time did it take?

3
Euphoria Demo
4
Tactics and Terrain Analysis
5
Terrain Analysis
  • Algorithmic analysis of terrain
  • Automated with no human intervention
  • Alternative to hard-coding regions of interest
  • In general
  • Are there spots on the terrain that are
    advantageous to me?
  • How can these be determined algorithmically?
  • Given the current terrain, how can I tease out
    this info?

6
Terrain AnalysisReal-Time Strategy Games
  • What are static points of interest on an RTS map?
  • What are dynamic points of interest during an RTS
    battle?

7
Terrain AnalysisReal-Time Strategy Games
  • Chokepoints
  • Barriers force units through narrow path
  • Barriers can be cliffs, walls, water, etc.
  • Ambush sites
  • High terrain overlooking low terrain chokepoint
  • Wall building sites
  • Low cost for building walls
  • Natural barriers so not much wall required
  • Cliffs
  • Water
  • Edge of map
  • Identify front of the battle
  • Identify flanking routes
  • Identify inferior forces

8
Terrain AnalysisFirst-Person Shooter Games
  • What are static points of interest in an FPS map?
  • What are dynamic points of interest during an FPS
    fight?

9
Terrain AnalysisFirst-Person Shooter Games
  • Cover points
  • Shielding
  • Darkness
  • Sniper points
  • Good cover point (shielding, darkness)
  • Potential high visibility to a large area
  • Rear coverage
  • Height advantage
  • Escape route
  • Safe paths to move from area to area
  • Low casualties in path
  • Low visibility to other areas
  • Good cover along path
  • Line-of-sight vulnerability
  • Stay out of other's line-of-sight

10
Tactical Reasoning in a First-Person Shooter
  • Visibility is a good tactical indicator
  • Does spot provide cover?
  • Front cover and rear cover?
  • How safe is it?
  • Does spot provide accessibility?
  • Is a given spot good to shoot from?
  • Can we escape easily?
  • How dangerous is it?

11
Tactical Reasoning with WaypointsHalf-Life 2
(first-person shooter)
  • Implementation strategy
  • Preprocess terrain, storing visibility info
  • Can area A see area B?
  • Store visibility info in waypoint nodes
  • Node As ability to see every other node
  • How would you store it?

12
Tactical Reasoning with WaypointsStoring
Visibility Information
  • Store visibility info with bit strings
  • Can perform operations on groups
  • and
  • or
  • not

13
Tactical Reasoning with WaypointsSafe and
Dangerous Nodes
  • Which locations are
  • Potentially safe?
  • Potentially dangerous?
  • Safe pathfinding
  • Penalize dangerous nodes
  • These are node visibilities
  • What about the actual enemies?

14
Tactical Reasoning with WaypointsAttack
Positioning
  • Visible nodes
  • Show where you could attack from
  • But no cover
  • Better strategy
  • Find a node to attack enemy X from
  • Which is also shielded from other enemies

15
Tactical Reasoning with WaypointsAttack
Positioning
  • 1. Get nodes visible to selected enemy
  • 2. Get nodes visible to other enemies
  • 3. Get safe nodes to attack from 3 1 !2

16
Tactical Reasoning with WaypointsAttack
Positioning
  • Other strategies
  • Take cover from everyone
  • Find a safe node that is close to a completely
    safe node (in case NPC needs to reload)
  • Flanking
  • Eliminate attack points that the enemy is facing
  • For sneaking up on enemies

17
Tactical Reasoning with WaypointsStatic
Waypoint Analysis
  • Determine danger of each node in a static
    environment
  • Weight each node based on number of nodes that
    can see it
  • If pathfinding takes into consideration
  • Paths are less likely to be visible to enemies

18
Tactical Reasoning with WaypointsStatic
Waypoint Analysis
  • Nodes marked for visibility count
  • Sniper nodes have high exposure next to nodes
    with low exposure

19
Tactical Reasoning with WaypointsPinch Points
and Squad Tactics
  • Identify pinch points as ambush spots
  • 1. Find node (N) with only two neighbors
  • 2. One neighbor node must be in confined area
  • 3. Nodes connected to other neighbor nodes are
    ambush spots

20
Tactical Reasoning with WaypointsLimitations
  • Must use hierarchy of networks to reduce size of
    bit strings
  • Ducking action can make some nodes both good
    cover and good attack locations
  • Annotate these nodes
  • Unidirectional connections makes it a little more
    complicated
  • Density of waypoints impacts quality of reasoning

21
Influence Mapping
22
Influence Mapping
  • Abstracts distribution of power
  • 2D grid superimposed on terrain
  • Unit strength is summed into grid cells
  • Influence declines exponentially with distance
  • Helps determine
  • Weaknesses
  • Neutral routes to flank enemy
  • The front of the battle

23
Influence MappingBasic Influence Map
24
Influence MappingEngagement
25
Influence MappingAnalysis of Options
26
Influence MapsOther Uses
  • SimCity
  • Non-violent use
  • Influence of crime, pollution, police, fire
    stations, etc

27
Spatial Database for Spatial Analysis
28
Spatial Database for Spatial Analysis
  • Generalize terrain reasoning with waypoints
  • Use a grid instead
  • Expand to capture dynamic features
  • Capture other interesting aspects

29
Spatial Database for Spatial AnalysisMany
Layers of Grids
  • Visibility
  • How many squares are visible
  • Openness layer
  • Proximity to static obstacles
  • Cover layer
  • Locations where AI can take cover from gunfire
  • Area occupancy layer
  • Number of units in an area
  • Line-of-fire layer
  • Direction that weapons are being aimed
  • Light level layer
  • Brightness or darkness of any spot
  • Area search layer
  • Spots that have been searched

30
Spatial Database for Spatial AnalysisOpenness
Layer
31
Spatial Database for Spatial AnalysisArea
Occupancy Layer
32
Spatial Database for Spatial AnalysisLine-of-Fir
e Layer
33
Spatial Database for Spatial AnalysisCombine
Layers
  • Combat desirability layer
  • Represents desirability of moving into any given
    area in combat
  • Combines openness, static cover, area occupancy
    layers

34
Project 3Implement Terrain Analysis
  • Due next week (May 19th)
  • (100) Create at least 3 simple layers of grids
    and 1 combined layer that can be toggled through
    (with the "L" key)
  • Possible layers Openness Layer, Occupancy Layer,
    Line-of-Fire Layer, Cover Area Layer, Area Search
    Layer, and Combat Desirability Layer
  • Extra Credit (10) Have the agents use the
    information to do something intelligent

35
Squad Tactics
36
Squad TacticsDecentralized vs Centralized
37
Squad TacticsDecentralized Squad
38
Squad TacticsDecentralized Squad
  • Key points
  • Extension of individual AI
  • Easy to add to existing AI
  • Robustly handles many situations
  • Deals well with a variety of capabilities within
    the team
  • Can be easily combined with scripted squad member
    actions
  • Cooperation and group behavior emerges from
    individual behaviors
  • Technique used in original Half-Life

39
Squad TacticsDecentralized Squad
  • void SoloAIThink()
  • CombatSitiation sit
  • GetSituation()
  • sit-gtObserve()
  • for each available action
  • if(action.IsApplicable(sit))
  • determine value of action
  • in sit
  • if better than best action,
  • make best action
  • execute best action()
  • void SoloAIThink()
  • CombatSitiation sit
  • GetSituation()
  • sit-gtObserve()
  • sit-gtProcessTeamIntentions()
  • sit-gtProcessTeamObservations()
  • for each available action
  • if(action.IsApplicable(sit))
  • determine value of action
  • in sit
  • if better than best action,
  • make best action
  • nearbySqdMembers-gtAnnounceAction()
  • execute best action()

40
Squad TacticsSolo AI vs Squad Member
  • Fire-and-maneuver behavior
  • If too many static squad members, move up
  • If too many engaging threat, won't stop to engage
    same threat
  • Robust against squad member casualties
  • Interactions easily translated to audio for
    effect/realism

41
Squad TacticsSquad Assault
  • Tactical behavior (on top of fire/move)
  • Stay close to cover
  • Don't block other's line-of-fire
  • Take weapon ability into account
  • Maintain team cohesion / line-of-sight
  • Spread out to avoid being a single target
  • Keep a line-of-sight on enemy

42
Squad Tactics Squad Assault Squad Members
Mental Picture
  • For each squad member
  • Current pos and activity
  • Claimed destination
  • Line-of-fire
  • For each opponent
  • Last known position and state
  • Estimated position
  • Squad members engaging this opponent
  • Line-of-fire
  • For other threats (grenades, fires)
  • Known/estimated position
  • Damage radius

43
Squad Tactics Squad Assault with Four-Man Patrol
in Hostile Situation
44
Squad TacticsLeader evaluating positions and
picking one (center, top)
45
Squad TacticsExecuting L-Shaped Ambush
  • Wait until enemy enters kill zone, aggressively
    attack, pull back to predefined rally point
  • Problems
  • Decentralized squad has trouble waiting until
    right moment to attack. Attack moment requires
    some kind of coordination
  • Squad lacks autonomy
  • Can't create L-shape itself, can't abort if enemy
    doesn't show up

46
Squad TacticsDecentralized Squad (reference)
47
Squad TacticsRelation Between Squad and Squad
Member
48
Squad TacticsCentralized Approach
  • Advantages
  • Separates concerns reduces number of problems
    each AI has to deal with
  • Saves CPU do computations once
  • AIs can be specialized independently from each
    other

49
Squad TacticsCentralized Approach
  • Authoritarian command style
  • No "I" in "team"
  • Squad can sacrifice a member to achieve a goal
  • Squad member's view might conflict with squad's
    objective
  • Told to defend a front, but sniper is behind
  • Coaching command style
  • Each squad member given tasks
  • Can choose to ignore and tell squad he can't
    comply
  • Deals with sniper case
  • But squad members get distracted easily

50
Squad TacticsSituation and Extracted Features
  • Force ratio 53, line-of-fire ratio 21

51
Squad TacticsFSM for Valid Maneuvers
  • Avoids oscillations
  • FSM prevents attacking before completing pullback

52
Squad TacticsBounding Overwatch Pullback
  • Tail Squad Members Behavior
  • Teammates lay down suppression fire

53
Squad TacticsBounding Overwatch Pullback
  • Pullback path, Cover fire locations, and two
    bounding moves in progress

54
Squad TacticsStages of Performing a Maneuver
55
Team Member AIAvoiding Friendly Fire
  • If player is shooting, how can buddy AI avoid
    friendly fire?
  • If player is moving around, how can buddy AI
    avoid friendly fire?

56
Team Member AIAvoiding Friendly Fire
  • Two options

57
Planning
58
Planning
  • Find series of actions for AI that changes the
    current configuration of the game world into a
    target configuration
  • Planning allows innovative solutions when the
    game world is sufficiently rich
  • Requires
  • Planning algorithm
  • World representation
  • Choosing set of actions
  • Action
  • Preconditions
  • Effects

59
Planning
60
Planning
  • Config1 Target not dead
  • Action Attack
  • Config2 Target is dead, Weapon must be loaded
  • Action Load Weapon
  • Config3 Target is dead, Weapon loaded, Weapon
    must be armed
  • Acton Draw Weapon
  • Config4 Target is dead, Weapon is loaded, Weapon
    is armed
Write a Comment
User Comments (0)
About PowerShow.com