Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

AI for Animation and Combat: Creating Intelligent Characters in Animation and Gaming, Study notes of Electrical and Electronics Engineering

The use of artificial intelligence (ai) in animation and combat for creating intelligent characters in video games. The authors discuss various components of ai for animation, including npc models, bones, articulated joints, and animation sequences. They also cover motion capture and motion primitives. For combat, the document covers spatial reasoning, successful attack probability, and finding a safe attack position. The document also touches upon emergent behavior and squad ai.

Typology: Study notes

Pre 2010

Uploaded on 09/02/2009

koofers-user-xn9
koofers-user-xn9 🇺🇸

10 documents

1 / 100

Toggle sidebar

Related documents


Partial preview of the text

Download AI for Animation and Combat: Creating Intelligent Characters in Animation and Gaming and more Study notes Electrical and Electronics Engineering in PDF only on Docsity! AI for Animation and Combat Based in part on material developed by John McCloskey Jeffrey Miller Amish Prasad Lars Linden Van der Sterren, W. Reed, C. and Geisler, B. and Orkin, J. (AI Game Programming Wisdom vols. 1 & 2) AI Components: Animation • NPC models built by artists • Use tools such as “3D Studio Max” or “Maya” • Models are are constructed from bones • Bones are connected by articulated joints • The skeletal system is covered by a mesh of textured polygons AI Components: Animation Animation sequences for a model are either: • Hand generated by a computer animator • Recorded from real human (or animal) movements and applied to a skeletal system (“motion capture”) 4 AI Components: Animation e Motion Capture: Tom Molet (EGCAS ’96) AI Components: Animation • First step in A.I. is to select which animation sequence or sequences should be applied to a model • Many influences: • Desired behavior chosen by decision system • What animation is currently playing • The current velocity and direction of the NPC • The terrain the NPC is standing on AI Components: Animation • Second step is to parameterize animations • Speed up or slow down animation • Slow walk, fast walk • Accelerate / decelerate stop and start of run • Slow run as approach sharp turn • Blend between animations • walk-to-run • 70% normal walk + 30% limp • Layer animations • Mix hand_wave on top of walk animation AI Components: Animation • Next might add selected Joint Control • Take control of particular joints • Either:  Ignore joint motion in pre-generated animation  Blend with pre-generated joint motion • Used for: • Head Turning  Looking at a particular object or location • Arm aiming  Point gun at a location Combat: Spatial Reasoning • 3D map geometry is difficult to parse • Solution: Custom databases • Place hints throughout the world • Can be error-prone and inefficient • Do not handle dynamic obstacles Perceptual Modeling • Visual subsystem: seeing target • Distance to visual stimulus • Angle of stimulus relative to field of view • Line of sight calculations • Auditory subsystem • Ensure that the AI can hear objects in the world • AI must interpret and prioritize sounds • Tactile subsystem • Handles anything the AI can feel • Damage notifications and collision notifications Weapon Combat • Successful Attack Probability • Calculate value to represent the chance to hit, generate random number • If number is above to-hit value, try to miss target • Factors: • AI skill, Range, Size, Relative Target Velocity, Visibility and Coverage • Shoot and Miss • Pick a target coordinate outside the body • Place shot inside target’s field of view Waypoint Analysis • Limited CPU time • Decisions must be made quickly (as few CPU cycles as possible) • Data must stored efficiently • Store visibility data in a “bit-string” class = visibility from node “a”a V Node 123 45 6 100100 01101 (0 011000 100121421 Waypoint Analysis © ® = Enemy © 0101121 0002111 ~ nN V: V3 Vi; V: (@ V, () V. om + w . Waypoint Analysis • Danger Nodes • Determined by “OR”ing the visibility of all enemy’s (k) nearest nodes • Safe Nodes • Is its inverse U kj j jVV = = = 0 V = Finding a Safe Attack Position • To find such locations, first find all nodes which have LOS to the selected enemy • Call selected enemy “a” a V Finding a Safe Attack Position Nodes are visible to selected enemy Finding a Safe Attack Position • Next determine the set of nodes that are visible to all other enemies aj,VV kj 0j ja != = = U = = ≠ Finding a Safe Attack Position Safe nodes to shoot from Ambush Points • Unless cheating is employed, NPCs don’t have full knowledge of the world • May not know where all their enemies are located So: • Find a good location to wait in, for attack • Not all positions are created equal Static Waypoint Evaluation • To find a good set up position: • Establish the exposure of all waypoints in a map • Process can be done off line, before game is even started 4 Static Waypoint Evaluation Pinch Points • Observation of human players reveals that experienced players anticipate the actions of their opponents • For example, if an enemy enters a room with only a single exit an experienced player will wait just outside the exit setting up an ambush • Such “pinch points” can be pre-calculated by analyzing the node graph Pinch Points To find pinch points: For each node, N in the node graph with only two neighbors: • Temporarily eliminate node, N, from the graph, call its neighbors as A & B • If both A & B are connected to large regions, N is not a pinch point, try another N • Else attempt to find a path between A& B • If path exists, N is not a pinch point, try another N • Else call the node connected to the larger region, O (for outside) • And the node connected to the smaller region, I (for inside) Let’s do that again step-by-step: Pinch Points • If both A & B are connected to large regions, N is not a pinch point, try another N Pinch Points • Else attempt to find a path between A& B, if exists try another N Pinch Points • El;se call the node connected to the larger region, O (for outside) • And the node connected to the smaller region, I (for inside Pinch Points I = Inside Node N = Pinch Point 0 = Outside Node 4 Pinch Points Another Example: Pinch Points Result: Pinch Points • Move N to O, Move O to other neighbor of old O • Repeat till O has more than one neighbors Pinch Points • Move N to O, move O to other neighbor of old O • Repeat till O has only one neighbors Pinch Points • Calculate good ambush locations: I NOP VVV = Pinch Points • For each node, N in the node graph with only two neighbors Pinch Points • Attempt to find a path between A& B • If path exists, N is not a pinch point, try another N Pinch Points If NPCs organize into squads regions with multiple pinch points can be employed: For each node, N1 in the node graph with only two neighbors: • Temporarily eliminate node, N1, from the graph, call its neighbors as A & B • If A & B are connected to large regions, N1 is not a pinch point, try another N • Attempt to find a path between A&B • While generating the path if a node with only two neighbors is found, • Temporarily eliminate it and call it N2. • Attempt to find a path between A&B • If path exists, not a pinch point, try another N1 • Call the nodes connected to the smaller regions, I1 and I2 (for inside) • Call the nodes connected to the larger regions, O1 and O2 (for outside) Pinch Points • Call the nodes connected to the smaller regions, I1 and I2 (for inside) • Call the nodes connected to the larger regions, O1 and O2 (for outside) Pinch Points • Calculate good ambush locations: II 2111 NNOP VVVV = II 2122 NNOP VVVV = Pinch Points I = Inside Node N = Pinch Point 0 = Outside Node Constraining NPC Behavior Added constraints: • ownership: an NPC owns a set of objects. NPCs do not try to acquire and interact with objects own by others. • dependency between objects: cannon must be loaded before they can be fired. • responsibility: objects tagged with class of NPC, NPCs tethered to regions • prioritization: aggressive behavior over investigative behavior, over relaxed behavior; specific over general behavior. Embedded Info, Animation, Sound Embedded info can be used in path finding: • Node graph is an example embedded environment information • embed in path how to jump over crevices or how to open door (Soldiers of Fortune 2) • illusion of coordination by “reserving” a path Embedded Info, Animation, Sound Team AI behavior can be used with animation and sound to add realism: • request for cover or order split up • choose a different posture or animation from team members • jumping, vaulting, rapelling based on embedded info Squad/Team AI Centralized: • leader receives info, issues order • complex maneuvers can be planned and coordinated • cannot easily accommodate the strengths and needs of individual members Distributed: • squad maneuvers as emergent behavior • simple extensions to individual AI • robust against members being “taken out” • weak at maneuvers requiring tight coordination • examples: Half-Life, No One Lives Forever 2 Distributed Squad AI Each member publishes: • state: conscious, unconscious • intention: “I'm moving to position (x, y, z)” • observation: “hostile at (x, y, z)” Action selection by: • situation of team mates • threats to team • own states Fire&Move: Solo vs. Squad arrived at new position MoveUp move to new position Getected new nostile before reaching new position arrived at new positionannounce: in position x Squad Assault Individualizing behavior: • riflemen move quick and often, to close in on the hostile • machine gunners are slowed by load, deliver support fire from a rather static position and need cover • snipers engage enemy from a distance, need clear line- of-fire and good cover • wounded or reloading members need cover Problems with Emergent Behavior Conflicts in path and position selections, members bumping into each other Solution: prioritize member based on • time to destination (shorter first) • urgency (need for cover) • strength of weapon (blast away) No good position within range of search Solution: randomly increase range of search, added benefits: flanking behavior, more varied behavior Problems with Emergent Behavior It's not always obvious what local behavior is needed to achieve certain global behavior, e.g., how to design squad ambush or covering pull-back? Corollary: there could be some unfavorable, unintended behavior Quake III Arena • Released in 1999 by id Software • Designed to be a multiplayer only game • The player battles computer-controlled opponents, or bots • Bots developed by Jan Paul van Waveren Quake III Bot AI • FSM based – Uses a stack for short-term goals • Use Fuzzy Logic for some decision making • Collecting weapons and armor • Choosing a weapon for combat • Fuzzy Relations were selected using Genetic Algorithms • Each bot has a data file containing weapon preferences and behavior-controlling variables Bot Network Ls ‘ Seek Long Term Seek Short Term Seek Activate > Goal <> Goal Entity F Stand Respawn Battle Fight Battle Chase Battle Retreat Battle Short Term Goal jt 4 Figure 15.1: Al network. # 4s Bot Input • Bots simulate human input • 90 degree FOV • fog and the invisibility powerup impact vision • Bots use sound to detect enemies Half-Life • Released by Valve Software in 1998 • Built using the Quake/Quake 2 engines • AI uses a “schedule driven state machine” Story-Based Game • Half-Life is a plot-driven game, so the AI must further the story • NPC’s aid player throughout game, but are rarely essential • Scripted sequences immerse the player in the story and create sense of importance “Dark Engine” • Lightly scripted game • Specifically single-player • Multi-state sense system • Decision state machines • Centers around the system's output • Published - Ubi Soft Entertainment • Greg Stelmack, lead engineer • Development - Red Storm Entertainment • Realistic combat battlefield game • Released November 13th, 2001 Ghost Recon AI Technique • A lot of scripting for individual missions • Enemy and team units use FSM’s • Modifiable hierarchical commands • Local navigation and pathfinding (causes some hang-ups small environmental details) Unreal • Epic Games – Unreal Engine • Steve Polge, lead programmer at epic • Digital Extremes – Gameplay depth and design • Very fast multiplayer FPS • Large emphasis on team play Unreal Scripting • UnrealScript much like Java/C++ • Scripting used to control specific Bot actions • Every respawned Bot checks script flag Unreal Pathfinding • Based upon the common pathnode technique for navigation • Uses a pre-computed data structure for guiding movement • Complex algorithm-controlled assemblage of linked lists, Navigation Points, and Binary Space Partitioning (BSP) collision data
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved