cs 387: game aisanti/teaching/2016/cs387/cs387-w5-fps.pdfthe dm needs a function to assess interest...
TRANSCRIPT
![Page 1: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/1.jpg)
CS 387: GAME AI AI FOR FIRST-PERSON SHOOTERS
4/26/2016 Instructor: Santiago Ontañón
[email protected] Class website: https://www.cs.drexel.edu/~santi/teaching/2016/CS387/intro.html
![Page 2: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/2.jpg)
Reminders • Check BBVista site for the course regularly • Also: https://www.cs.drexel.edu/~santi/teaching/2016/CS387/intro.html
• Deadline for people doing Project 2 Thursday!. • Submission available via learn.drexel.edu • Any questions? • Project presentations on Thursday
• Any questions for project 3?
• Midterm next week
![Page 3: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/3.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 4: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/4.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 5: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/5.jpg)
First-Person Shooters • We all know what a FPS is. But do you know which one
was the first?
• http://www.youtube.com/watch?v=7chDIySXK2Q • http://www.youtube.com/watch?v=PoEpgfTtUYg • http://www.youtube.com/watch?v=C00n4rDUMNo • http://www.youtube.com/watch?v=yr-lQZzevwA • http://www.youtube.com/watch?v=d_kfZSsArCM
![Page 6: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/6.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 7: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/7.jpg)
AI Requirements in FPS • The two basic needs in all FPS are:
• Movement • Firing
• With those two you can already have a basic FPS running like: • Wolfenstein 3D (for which you most likely only need movement,
since there are no projectiles, and thus firing is just line-of-sight testing)
• Doom
• But you need way more than that for a modern FPS!
![Page 8: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/8.jpg)
AI Requirements in FPS • In Modern FPS you don’t expect:
• Enemies to get stuck behind a wall (enemies in old games like Wolfenstein do)
• To stand still while you kill their comrades (they do in Wolfenstein and Doom!)
• To be trapped just because you closed a door! • To move independently of each other • etc.
![Page 9: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/9.jpg)
AI Requirements in FPS • Perception • Movement and Firing • Pathfinding • Decision Making • Group Control • Camera Control • Drama Management
![Page 10: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/10.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 11: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/11.jpg)
Perception • The base of all Game AI is a good perception module
• If perception is properly designed, the cost of building the rest of the AI can be significantly reduced
• In FPS games perception needs to handle mainly: • Line-of-sight checks • Proximity checks • Easy access to “distance to point” and “path to point” calculations
for tactical AI
• Recall week 1 on perception (games like “Metal Gear”, or “Commandos”)
![Page 12: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/12.jpg)
Game Engine
Game State
Physics Collision
Input
Character AI
User
Rendering
![Page 13: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/13.jpg)
Game Engine
Game State
Physics Collision
Input
Character AI
User
World Interface
(perception)
Rendering
![Page 14: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/14.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 15: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/15.jpg)
Movement and Firing • Movement is typically done with a combination of Steering
Behaviors and animation managers: • Coordinating the animation of the 3D model of a character with its
movement is sometimes complex: • Blend predefined animations (e.g. from Maya) with dynamic ones (aim)
• Firing is important in modern games: • “Doom” doesn’t have any firing management: enemies have
PERFECT aim. They solve it by making the bullets very slow • Modern games have aim models:
• Enemies miss • They miss in a place where the player can see the bullet (show off your
AI!) • First shot is typically a miss (to inform the player that there is an enemy
there)
![Page 16: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/16.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
![Page 17: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/17.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
At this point we already have the AI for “Wolfenstein 3D”
(It had no
pathfinding)
![Page 18: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/18.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 19: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/19.jpg)
Path-finding • Not all enemies are given path-finding capabilities:
• Path-finding makes characters look smart, the ones that should not look smart should not have path-finding
• Representation of the navigation graph: • Navigation meshes is the most popular
• Embedded navigation: • Annotate links in the navigation graph with the action require to
traverse it (walk, crawl, climb, open door, etc.) • Characters look smart knowing they have to perform those actions,
but it’s all hand annotated or precomputed
![Page 20: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/20.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
![Page 21: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/21.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
At this point we already have the AI
for “Doom”!
![Page 22: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/22.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 23: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/23.jpg)
Decision Making • Decision Making in FPS controls what characters do at a
high level: do they attack? Do they retreat? Do they execute other actions?
• Classic games: Finite-state machines • Modern games: Behavior Trees
• Some exceptions: • F.E.A.R.: Goal-oriented behavior
• Characters have a set of goals, and each goal associated with an FSM, the most relevant goal takes control and its FSM is executed.
![Page 24: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/24.jpg)
Waypoints • (we will cover them in a couple of weeks)
• Special markers in the map that indicate special locations: • Good places for cover, attack, ambush, etc.
• They are hand annotated, and when close to one the AI knows what to do.
• Characters look smart without requiring complex AI (e.g. NPCs seeking cover in Half-Life 2).
• ALL modern FPS games use waypoints.
![Page 25: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/25.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
Decision Making
![Page 26: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/26.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 27: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/27.jpg)
Group Control • Coupled with better decision-making, this is the largest
difference between classic and modern FPS AI.
• In old games (Doom, etc.) enemies always rush!
• Modern games use group tactics: • Simplest is “kung-fu style” (one enemy at a time) • Complex attack tactics where some characters attack, while others
cover
![Page 28: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/28.jpg)
Group Control • Can be defined also using behavior trees
• Most common approach: • Each tactic defines a set of “roles” • A role is filled by one character • Each tactic has a behavior tree that executes it
• For example: • A “flank” tactic can have 3 roles for “left attack”, “front attack”, and
“right attack” • Only 3 enemies will execute it at once (if there are more, they will
wait, kung-fu style) • Enemies look smart, but do not crazily over-power the player
![Page 29: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/29.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
Decision Making
Tactics (Group Behavior)
![Page 30: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/30.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
Decision Making
Tactics (Group Behavior)
At this point we already have the AI
for “Half-Life”!
![Page 31: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/31.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input User
World Interface
(perception)
Movement Firing
Rendering
Path-finding
Decision Making
Tactics (Group Behavior)
At this point we already have the AI
for “Half-Life”!
But there is more…
![Page 32: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/32.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 33: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/33.jpg)
Drama Management / Directing • Premise:
• Different players have different preferences • Each player enjoys a different subset of the elements of a game
• Problem: • How can a game automatically adapt to match the current player?
• Maintain the dramatic arc expected by the game designer • Prevent the players from dealing with parts of the game not appealing to
them • Adjust difficulty level, etc.
• Solution: • Drama Management / Experience Management / AI Director
![Page 34: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/34.jpg)
Drama Management
Game Engine
Player
![Page 35: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/35.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
![Page 36: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/36.jpg)
Drama Management
Game Engine
Drama Manager
Player
The Drama Manager
modifies the game by executing
DM Actions
Game Adaptation
Evaluation Function The Drama Manager
observes the interaction between player and game: Player Actions
![Page 37: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/37.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
The DM needs a function to assess interest / difficulty / boredom / dramatic
effect / etc. Player model
The DM needs an adaptation strategy that decides how to change the game to
maximize the evaluation function
![Page 38: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/38.jpg)
Drama Management Examples • Façade:
• http://www.youtube.com/watch?v=GmuLV9eMTkg
• Left 4 Dead: • http://www.youtube.com/watch?v=VVIdHPG0wYI • AI Director controls: spawning enemies and items, music, map (can
block or open paths) • Not random spawns: AI Director has a set of predefined patterns
with parameter ranges, and selects the appropriate pattern with the appropriate parameters.
![Page 39: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/39.jpg)
Purposes of Drama Management • Maximize interest/enjoyment of the game:
• Guide players to arcs of the game more interesting for them • Prevent players from getting bored
• Ensure dramatic intent is achieved: • Game author wanted the game to be played in a certain way to achieve certain
dramatic effects (surprise/fear/calm/etc.) • Achieving those effects might require different strategies for different players
• Training: • In Training simulations, ensure the intended situations are experienced by the
player, and the expected lessons are learned.
• Adjust difficulty: • Automatically detect the level of the player and adjust the game difficulty to the
adequate level
![Page 40: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/40.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function Narrative
![Page 41: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/41.jpg)
Narrative Representation Frameworks • Game narratives are instances of “multi-plot” narratives:
• Multiple branching points, alternative endings, etc.
• How do we represent game narratives, so the AI can reason about them?
• Two main approaches to represent interactive narrative in games: • Focus on time relationships of events: plot point graphs • Focus on content: beats
![Page 42: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/42.jpg)
Plot Point Graph • Graph where each node is a plot point, and each link is an
order constraint:
Leave_house
Get_flask
Give_bum_flask
Find_magical_shop
Get_amulet
Give_bum_amulet
Discover_book_in_sewer
Get_card
Read_library_book
Subset of the plot points in Anchorhead
![Page 43: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/43.jpg)
Plot Point Graph • Represents the complete Game Narrative. • The subset of visited plot points defines the “narrative
state” Leave_house
Get_flask
Give_bum_flask
Find_magical_shop
Get_amulet
Give_bum_amulet
Discover_book_in_sewer
Get_card
Read_library_book
![Page 44: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/44.jpg)
Plot Point Graph People arriving
Discussion in kitchen
Cocktail party
Manuel arrives Amanda arrives Paul arrives
Mary & Max arrive
Paul & Mary talk About the missing guests
Max is surprised to See Amanda
Mary & Max discuss about Announcing the engagement:
Amanda Flirts with Max in Living room
Mary sees the flirting In the living room
Mary wants, Max doesn’t Max wants, Mary doesn’t
Paul tells Max that Amanda is the family lawyer
Mary learns Amanda Is ex-girlfriend of Max
Paul restrains Mary so That Amanda can flirt
With Max
Mary gets angry With Max
Jeeves reminds that there aren’t enough rooms for all guests,
Jeeves sets up the Bar so guests have may mingle while he Prepares their rooms
For the night
Paul removes painting Of Jeeves’ old master’s
grandfather
Jeeves comes to check Up on everyone, notices
Painting has been removed
Mary spills wine on the Rug in the foyer
Jeeves asks her about It, and she brushes it off
Jeeves is already very Angry With the
Andersens
Manuel flirts with Mary
Max gets angry with Manuel
Paul says to Mary – “Look at How disrespectful Max is. Why
Do you love him?”
Jeeves asks about Special food preferences
To the guests
Mary & Max offer To sleep together
Amanda offers to Sleep with Mary
Manuel offers To sleep with Max
Paul opposes
Commitment of Mary & Max to sleep
together
Commitment of Mary & Amanda to sleep
together
Commitment of Manuel & Max to sleep
together
Paul offers every one To stay in the house
Amanda offers to Sleep with Max
Mary gets Incredibly angry
Commitment of Amanda & Max to
Sleep together
Max wants, Mary wants Max doesn’t, Mary doesn’t
Decision to announce Decision not to announce They break up
Jeeves announces dinner is ready
Complex plot point graphs Hierarchical plot points Complex ordering conditions (NOT, OR, AND, etc.) (Example plot point graph from the intro scene of a murder mystery game)
![Page 45: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/45.jpg)
Beat
Beat • A Beat is a unit of story content that makes sense by
itself, e.g.: in Façade, “the characters talk about what to have for a drink”, or “Trip greets you at the door”
Beat Goal 1
Beat Goal 2
Beat Goal 3
Preconditions Postconditions
Context
![Page 46: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/46.jpg)
Beat
Beat • A Beat is a unit of story content that makes sense by
itself, e.g.: in Façade, “the characters talk about what to have for a drink”, or “Trip greets you at the door”
Beat Goal 1
Beat Goal 2
Beat Goal 3
Preconditions Postconditions
Context
Preconditions: What needs to be true in order to this beat to
be executable
Things that will be true after this beat ends
![Page 47: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/47.jpg)
Beat
Beat • A Beat is a unit of story content that makes sense by
itself, e.g.: in Façade, “the characters talk about what to have for a drink”, or “Trip greets you at the door”
Beat Goal 1
Beat Goal 2
Beat Goal 3
Preconditions Postconditions
Context
Context defines any beat-specific responses that
characters need to have in response to player actions
Beat Goals define the sequence of events
that need to happen in a beat.
Each beat goal might have a repertoire of events that will be
triggered once the goal becomes active.
![Page 48: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/48.jpg)
Beat Example • In the context of a “murder mystery” game • Beat: “Police ask player about alibi” after discovered a
person beaten to death.
Beat
Goal 1: Police asks
Goal 2: Player justifies
Goal 3: Police
moves on Preconditions:
Murder discovered
Police sees player
with a bat
Player has no alibi
Postconditions:
Player has alibi Context:
If player moves away, police will block him
![Page 49: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/49.jpg)
Left 4 Dead • The AI Director in L4D uses a system related to beats • Each “beat” is a “wave” (of zombies), with 4 beat goals:
Goal 1: Build Up
Goal 2: Sustain Peak
Goal 3: Peak Fade
Goal 4: Relax
Director spawns enemies and threats until desired peak is reached
Keeps spawning to maintain the peak for some seconds
Waits for player to completely resolve the situation
Waits for some fixed a mount of time, or until player advanced a certain distance
![Page 50: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/50.jpg)
Plot points vs Beats • Plot points focus on time ordering between events:
• Good to monitor progress of the player • Clearly represent what is already accomplished, and what still
needs to be accomplished to complete the game • The player has full freedom (agency) to decide what to do next
• Beats focus on specifying content without being restrictive
about the order: • Good for allowing the Drama Manager decide what will happen
next • Only one Beat active at a time • The Drama Manager restricts the agency of the player, by
sequencing beats to maintain the desired story arch
![Page 51: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/51.jpg)
Graphic Adventure • The biggest problem in graphic adventures is that players
get constantly stuck
![Page 52: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/52.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
![Page 53: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/53.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
Is the player stuck? For how long?
1) Find what is the next step in the game
2) Provide some sort of hint
![Page 54: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/54.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
Action 1
Action 2
Action 3
Action 4
Action 5
Action 6
Action n
…
Time Stuck
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint m
…
Player Actions
Hints
Time
![Page 55: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/55.jpg)
Drama Management
Game Engine
Drama Manager
Player
Game Adaptation
Evaluation Function
Action 1
Action 2
Action 3
Action 4
Action 5
Action 6
Action n
…
Time Stuck
Hint 1
Hint 2
Hint 3
Hint 4
Hint 5
Hint m
…
Player Actions
Hints
Time
DM also keeps track of which hints have already
been given, for not repeating
![Page 56: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/56.jpg)
Example Drama Manager • Decides how to pace hints during gameplay to prevent the
player form getting stuck
• The example was very simple, but it can be enhanced easily: • Maximum number of hints per unit of time (to prevent too many
hints) • Better “player stuck” detection:
• Even if the player is not executing “relevant actions”, he might be following a systematic approach and eventually advance
• Take into account if players repeat actions of not (repeated actions are sign of frustration)
• Detecting novice from experienced players: • Experienced players tend to use systematic approaches (easy to detect)
![Page 57: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/57.jpg)
Game Narrative • In the previous example, the Drama Manager needed a
way to infer what was the next action to be executed in the game to advance (list of “relevant actions”)
• Most Drama Managers need to reason about the plot of the game (Game Narrative): • To provide hints (previous example) • To reason about which future subplot will the player like better • To ensure the story is unfolding as the author intended • etc.
• A lot can be learned about drama management focusing on simple story-based games (interactive narrative/fiction)
![Page 58: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/58.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input
Rendering
User
World Interface
(perception) Path-finding
Movement Firing
Decision Making
Tactics (Group Behavior)
Drama Management
![Page 59: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/59.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input
Rendering
User
World Interface
(perception) Path-finding
Movement Firing
Decision Making
Tactics (Group Behavior)
Drama Management
At this point, we have the AI of “Left 4 Dead 2”
![Page 60: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/60.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 61: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/61.jpg)
Intelligent Camera Control • Recent games have an emphasis on story telling
• Camera control is an essential component in story telling, since it provides focus
• A lot of recent work on automatic camera control: • Example:
http://www.youtube.com/watch?v=8G0xfyDGLsk&feature=related
![Page 62: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/62.jpg)
NPCs and Camera Control • What if you put a lot of work in NPC AI, but player never
“looks” to NPCs?
![Page 63: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/63.jpg)
NPCs and Camera Control • What if you put a lot of work in NPC AI, but player never
“looks” to NPCs? • Example: Elizabeth in Bioshock Infinite
![Page 64: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/64.jpg)
NPCs and Camera Control • What if you put a lot of work in NPC AI, but player never
“looks” to NPCs? • Example: Elizabeth in Bioshock Infinite
• The Game predicts the path the player needs to take to get to the next “goal”.
• Then, makes Elizabeth be in that path in order to make sure she is on the camera.
• Otherwise, if she was just following, she would always be behind, and the player would need to “turn around” to see the NPC.
![Page 65: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/65.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input
Rendering
User
World Interface
(perception) Path-finding
Movement Firing
Decision Making
Tactics (Group Behavior)
Camera Control
Drama Management
![Page 66: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/66.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input
Rendering
User
World Interface
(perception) Path-finding
Movement Firing
Decision Making
Tactics (Group Behavior)
Camera Control
Drama Management
This is a complete state of the art AI architecture
for a modern FPS (or RPG) game
![Page 67: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/67.jpg)
Character AI
Game Engine
Game State
Physics Collision
Input
Rendering
User
World Interface
(perception) Path-finding
Movement Firing
Decision Making
Tactics (Group Behavior)
Camera Control
Drama Management
Some specific platforms (e.g. Wii, Kinect) have specific AI needs, like gesture recognition.
![Page 68: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/68.jpg)
Outline • First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?
![Page 69: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/69.jpg)
What’s Next in FPS AI? • Why is multiplayer so much more interesting than single
player in FPS games? • Because the AI sucks • (and because you want to beat your friends)
• The next big things in FPS (or RPG/MMORPG) AI are: • Believable characters:
• Intelligent interactive characters to which the player can relate to • Interaction with NPCs/enemies/friendlies in games is very bad
nowadays • Procedural content generation (No Man’s Sky anyone?)
• What do you think is next?
![Page 70: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/70.jpg)
Projects 2 & 3 • Questions?
![Page 71: CS 387: GAME AIsanti/teaching/2016/CS387/CS387-W5-FPS.pdfThe DM needs a function to assess interest / difficulty / boredom / dramatic effect / etc. Player model The DM needs an adaptation](https://reader034.vdocuments.mx/reader034/viewer/2022051919/600b88a1bdb12a55752e45e6/html5/thumbnails/71.jpg)
Next Week • Midterm
• In class: regular pen and paper
• Everything we have covered so far