Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence in Games Week 7

Similar presentations


Presentation on theme: "Artificial Intelligence in Games Week 7"— Presentation transcript:

1 Artificial Intelligence in Games Week 7
Steve Rabin

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 In general:
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 Analysis: Real-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 Analysis: Real-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 Analysis: First-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 Analysis: First-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 Waypoints: Half-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 A’s ability to see every other node How would you store it?

12 Tactical Reasoning with Waypoints: Storing Visibility Information
Store visibility info with bit strings Can perform operations on groups and or not

13 Tactical Reasoning with Waypoints: Safe 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 Waypoints: Attack 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 Waypoints: Attack 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 Waypoints: Attack 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 Waypoints: Static 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 Waypoints: Static Waypoint Analysis
Nodes marked for visibility count Sniper nodes have high exposure next to nodes with low exposure

19 Tactical Reasoning with Waypoints: Pinch 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 Waypoints: Limitations
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 Mapping: Basic Influence Map

24 Influence Mapping: Engagement

25 Influence Mapping: Analysis of Options

26 Influence Maps: Other 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 Analysis: Many 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 Analysis: Openness Layer

31 Spatial Database for Spatial Analysis: Area Occupancy Layer

32 Spatial Database for Spatial Analysis: Line-of-Fire Layer

33 Spatial Database for Spatial Analysis: Combine Layers
Combat desirability layer Represents desirability of moving into any given area in combat Combines openness, static cover, area occupancy layers

34 Project 3: Implement 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 Tactics: Decentralized vs Centralized

37 Squad Tactics: Decentralized Squad

38 Squad Tactics: Decentralized 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 Tactics: Decentralized Squad
void SoloAI::Think() { CombatSitiation* sit = GetSituation(): sit->Observe(); 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 SoloAI::Think() { CombatSitiation* sit = GetSituation(): sit->Observe(); sit->ProcessTeamIntentions(); sit->ProcessTeamObservations(); for each available action { if(action.IsApplicable(sit)) { determine value of action in sit; if better than best action, make best action } nearbySqdMembers->AnnounceAction(); execute best action();

40 Squad Tactics: Solo 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 Tactics: Squad 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 For other threats (grenades, fires) Known/estimated position Damage radius

43 Squad Tactics: Squad Assault with Four-Man Patrol in Hostile Situation

44 Squad Tactics: Leader evaluating positions and picking one (center, top)

45 Squad Tactics: Executing 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 Tactics: Decentralized Squad (reference)

47 Squad Tactics: Relation Between Squad and Squad Member

48 Squad Tactics: Centralized 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 Tactics: Centralized 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 Tactics: Situation and Extracted Features
Force ratio 5:3, line-of-fire ratio 2:1

51 Squad Tactics: FSM for Valid Maneuvers
Avoids oscillations FSM prevents attacking before completing pullback

52 Squad Tactics: Bounding Overwatch Pullback
Tail Squad Member’s Behavior Teammates lay down suppression fire

53 Squad Tactics: Bounding Overwatch Pullback
Pullback path, Cover fire locations, and two bounding moves in progress

54 Squad Tactics: Stages of Performing a Maneuver

55 Team Member AI: Avoiding 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 AI: Avoiding 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


Download ppt "Artificial Intelligence in Games Week 7"

Similar presentations


Ads by Google