cs 387/680: game ai · movement and firing • movement is typically done with a combination of...

69
CS 387/680: GAME AI AI FOR FIRST-PERSON SHOOTERS 4/28/2014 Instructor: Santiago Ontañón [email protected] TA: Alberto Uriarte office hours: Tuesday 4-6pm, Cyber Learning Center Class website: https://www.cs.drexel.edu/~santi/teaching/2014/CS387-680/intro.html

Upload: others

Post on 18-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

CS 387/680: GAME AI AI FOR FIRST-PERSON SHOOTERS

4/28/2014 Instructor: Santiago Ontañón

[email protected] TA: Alberto Uriarte

office hours: Tuesday 4-6pm, Cyber Learning Center Class website:

https://www.cs.drexel.edu/~santi/teaching/2014/CS387-680/intro.html

Page 2: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Reminders • Check BBVista site for the course regularly • Also: https://www.cs.drexel.edu/~santi/teaching/2014/CS387-680/intro.html

• Deadline for people doing Project 2 today!. •  Submission available via learn.drexel.edu •  Any questions?

• Deadline for project 3 next week. •  Any questions?

• Midterm

Page 3: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

AI Requirements in FPS • Perception • Movement and Firing • Pathfinding • Decision Making • Group Control • Camera Control • Drama Management

Page 10: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Game Engine

Game State

Physics Collision

Input

Character AI

User

Rendering

Page 13: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Game Engine

Game State

Physics Collision

Input

Character AI

User

World Interface

(perception)

Rendering

Page 14: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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 it typically a miss (to inform the player that there is an enemy

there)

Page 16: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Character AI

Game Engine

Game State

Physics Collision

Input User

World Interface

(perception)

Movement Firing

Rendering

Page 17: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Path-finding • Not all enemies are given path-finding capabilities:

•  Path-finding makes characters look smart, the ones that should not look smart do not have path-finding

• Representation of the navigation graph: •  Navigation meshes is the most popular (as I mentioned it some

weeks ago, I don’t think it’s the best choice)

• 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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Character AI

Game Engine

Game State

Physics Collision

Input User

World Interface

(perception)

Movement Firing

Rendering

Path-finding

Page 21: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Character AI

Game Engine

Game State

Physics Collision

Input User

World Interface

(perception)

Movement Firing

Rendering

Path-finding

Decision Making

Page 26: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Drama Management

Game Engine

Player

Page 35: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Drama Management

Game Engine

Drama Manager

Player

Game Adaptation

Evaluation Function

Page 36: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Drama Management

Game Engine

Drama Manager

Player

Game Adaptation

Evaluation Function Narrative

Page 41: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Graphic Adventure •  The biggest problem in graphic adventures is that players

get constantly stuck

Page 52: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Drama Management

Game Engine

Drama Manager

Player

Game Adaptation

Evaluation Function

Page 53: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Example Drama Manager • Decides how to pace hints during game play 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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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 63: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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 64: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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 65: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Outline • Student Project Presentations

•  First-Person Shooters • AI Requirements in FPS • Perception • Movement • Pathfinding • Decision Making • Group Control • Drama Management • Camera Control • What’s Next?

Page 66: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

What’s Next in FPS AI? •  As of 2011, a study by A. Champandard concluded that the

open AI problems in FPS Games were: •  Sensory Performance •  Motion Planning •  Tactical Pathfinding •  Dynamic Terrain Analysis •  Combat Reasoning •  Player Prediction •  Scripting for Conjunctive Goals •  Squad Coordination •  Experience Management

•  However, I think those are too low level. Except for two, the rest refer more efficient ways to have what we already have

Page 67: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

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

• What do you think is next?

Page 68: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Projects 2 & 3 • Questions?

Page 69: CS 387/680: GAME AI · Movement and Firing • Movement is typically done with a combination of Steering Behaviors and animation managers: • Coordinating the animation of the 3D

Next Week • Midterm

•  In class students: •  In class: regular pen and paper

•  Online students: •  Online: via learn.drexel.edu

• Everything we have covered so far