Designing Game AI & AI Based Games 2013-07-18. DESIGNING GAME AI.

Similar presentations


Presentation on theme: "Designing Game AI & AI Based Games 2013-07-18. DESIGNING GAME AI."— Presentation transcript:

1 Designing Game AI & AI Based Games 2013-07-18

2 DESIGNING GAME AI

3 Questions What behaviors do we need to produce? What techniques are best suited to producing those behaviors? REMEMBER: GAI vs AAI

4 Designing Behaviors Not fixed, behaviors evolve over course of implementation

5 Movement Will characters be represented individually?

6 Movement Will characters be represented individually? How realistic should movement be?

7 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?

8 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?

9 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?

10 Decision Making What is the full range of actions available to an agent in the game?

11 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?

12 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?

13 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?

14 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?

15 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

16 Strategic/Tactical AI Do agents need to understand large-scale properties of the game?

17 Strategic/Tactical AI Do agents need to understand large-scale properties of the game? Do agents need to work together?

18 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?

19 Technique Selection Need to determine best way to implement behaviors Fairly straightforward Balance required between “cool/exotic techniques” and simple but useful AI

20 Game AI by Genre Shooters Driving game RTS Sports games Turn-based strategy

21 Game AI by Genre Shooters

22 FPS AI 1.Movement 2.Firing 3.Decision making 4.Perception 5.Pathfinding 6.Tactical AI (e.g. Halo) 7.Drama management (e.g. L4D)

23 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

24 FPS Firing Unbelievable accuracy is bad (e.g. Doom) How do you make agents miss believably?

25 FPS Decision Making FSMs Behavior Trees Game-specific scripting languages FSMs + goals Decision Trees Planners (recall F.E.A.R)

26 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

27 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

28 FPS Game AI Similar strategies for platformers, adventure games, MMOs – Similarities? Differences?

29 Game AI by Genre Shooters Driving game

30 Driving Game AI Movement Pathfinding Tactics

31 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

32 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)

33 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)

34 Game AI by Genre Shooters Driving game RTS

35 RTS Game AI Pathfinding Group movement Tactical AI Decision making

36 RTS Pathfinding Early RTS games required efficient pathfinding Grid-based layout Precomputed routes

37 RTS Group Movement Most games use formations Fixed patterns Players have limited control over formation shapes

38 RTS Tactical AI Guides pathfinding around terrain Location selection using influence mapping

39 RTS Decision Making Typically state machines and decision trees Markovian and probabilistic methods Rule-based systems

40 Game AI by Genre Shooters Driving game RTS Sports games

41 Sports Game AI Physics prediction – Simple projectile prediction Playbooks and Content Creation – Formation movement – Expert knowledge

42 Game AI by Genre Shooters Driving game RTS Sports games Turn-based strategy

43 TBS Game AI Similar to RTS AI Timing – AI at disadvantage Player assistance – Automation of repetitive tasks – Automation of decision-making

44 Exercise

45 SOA Gameplay Based on AI Teaching Characters Flocking / Herding On horizon – PCG / Content authoring – Emergent narrative – Social physics

46 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

47 Teaching Characters Games Learning Mechanism – Artificial Neural Networks – Strong supervision = Observations – Weak supervision = Player feedback – Other approaches: Decision trees, reinforcement learning, naïve Bayes

48 Teaching Characters Games If we “slap” a character for eating rocks and eating poisonous mushrooms, what have we really taught the character?

49 Teaching Characters Games If we “slap” a character for eating rocks and eating poisonous mushrooms, what have we really taught the character? Instincts

50 Flocking/Herding Games Example: Pikmin games, Herdy Gerdy – P: https://www.youtube.com/watch?v=AorSg8wJmVs https://www.youtube.com/watch?v=AorSg8wJmVs – HG: https://www.youtube.com/watch?v=SP24_EYuKJE 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

51 AI-BASED GAMES (FUTURE: GAMEPLAY BASED ON AI)

52 AI-based Games Can interacting with AI be a game? – AI as core game mechanic(s) Can AI enable new kinds of games? Not as opponent: – Turing test – Acting – Social simulation – Breeding / evolving – Pet raising / training

53 AI-based Games Can interacting with AI be a game? Can AI enable new kinds of games? AI not as opponent: – Turing test – Acting – Social simulation – Breeding / evolving – Pet raising / training Indirect control Human-like partner

54 Spy Party http://www.spyparty.com/ https://www.youtube.com/watch?v=B- 7tgWQKJh8 https://www.youtube.com/watch?v=B- 7tgWQKJh8

55 Spy Party 2 human players: sniper/assassin + spy Assassin: view party, one shot to kill spy Spy: mission to accomplish some task – e.g. poison drink, slip note – human at a party with 19 AI agents Spy attempts to mimic AI behaviors while performing task – ~= reverse Turing test

56 Spy Party

57

58 What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

59 Spy Party What does AI contribute to this game? – Sets “target” for game goals What makes this AI fun to play with? – Inherent inflexibility and unpredictability How does AI make this game possible? – Provides background characters as “obstacles”

60 The Restaurant Game http://web.media.mit.edu/~jorkin/restaurant/ http://www.youtube.com/watch?v=zf7dj2m-SU8 Online game to play out common interactions among customer + waitress Collect corpus of actions + interactions Process corpus to automate NPC behavior – Enable open-ended interaction – Take appropriate action + dialog in contexts

61

62 The Restaurant Game

63

64

65

66 What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

67 The Restaurant Game What does AI contribute to this game? – Scale out to many possible interactions What makes this AI fun to play with? – Trying to break the system – Acting out scenes How does AI make this game possible? – It doesn’t

68 Facade

69 http://www.interactivestory.net/ http://www.youtube.com/watch?v=GmuLV9eMTkg http://aigamedev.com/open/review/facade-ai/ “World’s 1 st fully realized interactive drama” – High-conflict marriage breakdown Move beyond traditional story branching – One-act, emotionally interactive characters – Believable emotions and behaviors, affected by story – Story “beats” guide narrative – Social interaction is core gameplay

70 Facade A Behavior Language (ABL) – Variation of behavior tree – Concurrent behaviors & synchronization – Joint Goals – Prioritized behaviors Working memory elements (WMEs) – Dynamic blackboard – Any info agent needs to keep track of Natural language – Rule-based system similar to Alice chatbot – Focus on effects of utterance rather than syntax/sem

71 Facade What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

72 Facade What does AI contribute to this game? – Emergent interactive drama What makes this AI fun to play with? – Large space of interactions, complexity, “risk” How does AI make this game possible? – Core rule system for game – Authoring tools, narrative reasoning, NLP

73 Prom Week http://games.soe.ucsc.edu/project/prom-week https://www.youtube.com/watch?v=zc5QEcWGh1U

74 Prom Week AI for social physics – make social interactions truly playable – Comme il Faut (CiF) enables rich, emergent storylines – underlying simulation of social considerations over 5,000 rules of social norms and behaviors Model personality + evolving social state – Agents track social status, history – Agents have likes, dislikes, permanent traits, status – Interactions based on “social games” Player guides agent to achieve social goal

75 Prom Week

76

77

78 What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

79 Prom Week What does AI contribute to this game? – Game engine for social interactions; game mechanics What makes this AI fun to play with? – Large space of interactions, complexity How does AI make this game possible? – Core rule system for game

80 Petalz http://petalzgame.com/ http://www.aaai.org/ocs/index.php/AIIDE/AIIDE12/paper/viewFile/5449/5698 CPPN-NEAT as in NERO and GAR – Compositional Pattern Producing Networks – http://nerogame.org/ http://nerogame.org/ Encode evolution of flowers Facebook game to trade/sell among players, breed

81 Petalz

82

83

84 What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

85 Petalz What does AI contribute to this game? – Basic mechanics for indirect control – PCG What makes this AI fun to play with? – Unexpected outcomes, partial control – Partial control  more meaningful success How does AI make this game possible? – Breeding mechanic

86 GAR http://galacticarmsrace.blogspot.com/ PCG – weapon behavior generation

87 Black & White

88 Train AI pet – Be good/evil – Follow commands – Learn spells Learning combines neural networks and decision tree learning

89 Desires (perceptrons) Beliefs (attribute lists) Opinions (decision trees) Intention = overall plan Specific plan (object list) Primitive action list

90 Black & White Beliefs = stored information about individual objects Desires = goals to try to satisfy; perceptron encodes whether to trigger a desire (goal) based on status – e.g. hunger based on low energy + tasty food + unhappy through weighted combination + threshold – train perceptrons Opinion = pair w/desires  best object to use for desire – train w/ decision trees Planning = compute all goals, then utility based on desire + object, take highest utility

91 Black & White What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

92 Black & White What does AI contribute to this game? – Pet learning mechanics What makes this AI fun to play with? – Raising a pet, seeing what it learns How does AI make this game possible? – It doesn’t – added pet learning mechanics

93 Creatures

94 Neural network “brain” for behavior – Hebbian behavior learning Artificial biochemistry for metabolism Hormonal system to modulate NN, introduce life stages – Different behavior by life stage Genes allow breeding, but NN may restructure during growth – Respond to biochem changes

95 Creatures

96

97 What does AI contribute to this game? What makes this AI fun to play with? How does AI make this game possible?

98 Creatures What does AI contribute to this game? – Mechanics of artificial people/society to play with What makes this AI fun to play with? – Raising pet, observing indirect influence How does AI make this game possible? – Pet behavior + learning mechanics

99 What AI was used? Spy Party – scripting The Restaurant Game – planning + CBR Prom Week – rule-based systems Petalz – neural nets Black & White – decision trees + RL Creatures – neural nets

100 What AI could be used? Spy Party – behavior trees / HTNs – decision tree learning The Restaurant Game – FSMs – rule-based system Prom Week – planning

101 What AI could be used? Petalz – logic (deduce child traits from parents) Black & White – case-based reasoning Creatures – rule learning

102 What did AI do? Spy Party – background NPCs to mimic The Restaurant Game – act out role w/open-ended interactions Prom Week – rules for social interaction mechanics

103 What did AI do? Petalz – produce new items to trade / show off Black & White – guide pet learning / raising Creatures – guide pet learning / society


Download ppt "Designing Game AI & AI Based Games 2013-07-18. DESIGNING GAME AI."

Similar presentations


Ads by Google