1.06k likes | 1.25k Views
Designing Game AI & AI Based Games. 2013-07-18. Designing Game AI. Questions. What behaviors do we need to produce? What techniques are best suited to producing those behaviors ? REMEMBER: GAI vs AAI. Designing Behaviors. Not fixed, behaviors evolve over course of implementation.
E N D
Designing Game AI &AI Based Games 2013-07-18
Questions • What behaviors do we need to produce? • What techniques are best suited to producing those behaviors? REMEMBER: GAI vs AAI
Designing Behaviors • Not fixed, behaviors evolve over course of implementation
Movement • Will characters be represented individually?
Movement • Will characters be represented individually? • How realistic should movement be?
Movement • Will characters be represented individually? • How realistic should movement be? • Does motion need to be physically simulated? How realistic does the physics need to be?
Movement • Will characters be represented individually? • How realistic should movement be? • Does motion need to be physically simulated? How realistic does the physics need to be? • How much pathfinding do we need?
Movement • Will characters be represented individually? • How realistic should movement be? • Does motion need to be physically simulated? How realistic does the physics need to be? • How much pathfinding do we need? • Will character motion be affected by other characters?
Decision Making • What is the full range of actions available to an agent in the game?
Decision Making • What is the full range of actions available to an agent in the game? • How are those actions grouped together to fulfill character goals?
Decision Making • What is the full range of actions available to an agent in the game? • How are those actions grouped together to fulfill character goals? • When will agents change behavior? Why?
Decision Making • What is the full range of actions available to an agent in the game? • How are those actions grouped together to fulfill character goals? • When will agents change behavior? Why? • Do agents need to lookahead to make the best decision?
Decision Making • What is the full range of actions available to an agent in the game? • How are those actions grouped together to fulfill character goals? • When will agents change behavior? Why? • Do agents need to lookahead to make the best decision? • Are agent decisions dependent on player actions?
Decision Making • This is where things go off the rails for AI designers • Trying ambitious AI techniques is alluring • In real-world game development, this can potentially lead to failure
Strategic/Tactical AI • Do agents need to understand large-scale properties of the game?
Strategic/Tactical AI • Do agents need to understand large-scale properties of the game? • Do agents need to work together?
Strategic/Tactical AI • Do agents need to understand large-scale properties of the game? • Do agents need to work together? • Can agents think independently and still show group behaviors?
Technique Selection • Need to determine best way to implement behaviors • Fairly straightforward • Balance required between “cool/exotic techniques” and simple but useful AI
Game AI by Genre • Shooters • Driving game • RTS • Sports games • Turn-based strategy
Game AI by Genre • Shooters
FPS AI • Movement • Firing • Decision making • Perception • Pathfinding • Tactical AI (e.g. Halo) • Drama management (e.g. L4D)
FPS Movement • Most visible part of FPS AI • Genre has most complex animations • Running, firing vs. cartwheels, leaping, etc. • AI has two tasks • Work out the route • Break up motions into animations • Need to dynamically adjust to level and other agents
FPS Firing • Unbelievable accuracy is bad (e.g. Doom) • How do you make agents miss believably?
FPS Decision Making • FSMs • Behavior Trees • Game-specific scripting languages • FSMs + goals • Decision Trees • Planners (recall F.E.A.R)
FPS Perception • Agents “come to life” when player nears • Improvements began with Goldeneye • Messaging • Sense Management for cover, camouflage • Cone of sight, simple sound model
FPS Pathfinding and Tactics • NavMeshes are ubiquitous • Additional info used for tactical analysis • Half-Life uses waypoints • Pathfinding graphs tagged with the action required to traverse an edge
FPS Game AI • Similar strategies for platformers, adventure games, MMOs • Similarities? Differences?
Game AI by Genre • Shooters • Driving game
Driving Game AI • Movement • Pathfinding • Tactics
Movement in Driving Games • Early games used “racing lines” • Rails based on splines • AI could look up position/speed and render it • Still used for “background” cars • Modern approach: AI applies controls to physics simulation • Assistance from racing lines
Movement in Driving Games • Overtaking other cars • Realistic approaches • Alternate racing lines • Chase the rabbit • Other approaches • Fuzzy decision making (Manic Karts) • Supervised ANNs (Forza Motorsport)
Pathfinding and Tactics in Driving Games • Pathfinding needed when there is no fixed track • Basic pathfinding is usable in such cases • Simple tactical AI can be used for police cars to block player routes (e.g. Grand Theft Auto)
Game AI by Genre • Shooters • Driving game • RTS
RTS Game AI • Pathfinding • Group movement • Tactical AI • Decision making
RTS Pathfinding • Early RTS games required efficient pathfinding • Grid-based layout • Precomputed routes
RTS Group Movement • Most games use formations • Fixed patterns • Players have limited control over formation shapes
RTS Tactical AI • Guides pathfinding around terrain • Location selection using influence mapping
RTS Decision Making • Typically state machines and decision trees • Markovian and probabilistic methods • Rule-based systems
Game AI by Genre • Shooters • Driving game • RTS • Sports games
Sports Game AI • Physics prediction • Simple projectile prediction • Playbooks and Content Creation • Formation movement • Expert knowledge
Game AI by Genre • Shooters • Driving game • RTS • Sports games • Turn-based strategy
TBS Game AI • Similar to RTS AI • Timing • AI at disadvantage • Player assistance • Automation of repetitive tasks • Automation of decision-making
SOA Gameplay Based on AI • Teaching Characters • Flocking / Herding • On horizon • PCG / Content authoring • Emergent narrative • Social physics
Teaching Characters Games • Primary Example: Black and White • Characters learn under supervision of player • Need representations of actions, world • (fight enemy sword) or (throw rock) or (throw enemy rock) • Characters need to associate actions with context
Teaching Characters Games • Learning Mechanism • Artificial Neural Networks • Strong supervision = Observations • Weak supervision = Player feedback • Other approaches: Decision trees, reinforcement learning, naïve Bayes
Teaching Characters Games • If we “slap” a character for eating rocks and eating poisonous mushrooms, what have we really taught the character?
Teaching Characters Games • If we “slap” a character for eating rocks and eating poisonous mushrooms, what have we really taught the character? • Instincts
Flocking/Herding Games • Example: Pikmingames, HerdyGerdy • P: https://www.youtube.com/watch?v=AorSg8wJmVs • HG: https://www.youtube.com/watch?v=SP24_EYuKJE • FSMs or Decision trees • Simple steering behaviors • Typically multiple species • Ecosystem / food chain • Higher up == simpler behavior; lower == group