Top Banner
Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko First Person Shooters
51

Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Dec 26, 2015

Download

Documents

Colleen Carter
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko

First Person Shooters

Page 2: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

What is a First Person Shooter?

Game Genre that involves projectile weapons

Played “though the eyes” of game character First Person point of view Creates a game play, AI, and game

design Issues Popular FPS Titles

Quake, Doom, Wolfenstein 3D, Goldeneye 007, Half Life, Halo, Call of Duty, Counter Strike, Unreal Tournament…

Page 3: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Condensed History First known FPS: Maze War (1974) FPS Stepping Stone: Wolfenstein 3D (1992) Intro of Deathmatch: Doom (1993) 3D Polygons: Quake (1996) Major Console FPS: Goldeneye 007 (1997) Entirely Script Based FPS: Half-Life (1998) Exceptional Plot and Story: Half-Life (1998) Team play focused FPS: Unreal Tournament

(1999) New Millennium FPS: Halo (2001) MMOFPS: Planetside (2003) FPS as Story Medium: Bioshock (2007) Graphics Killer: Crysis (2007) $1 Billion Dollar FPS: Call of Duty – Modern

Warfare 2 (2009)

Page 4: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Why are FPS Important?

Arguably the most valuable to the gaming industry

Envelope Pushing sector Graphics, Game Play, AI, Audio

Genre Bending Has created spinoff genres FPS medium allows developers to

incorporate elements from other genres

Page 5: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Game Layers Movement Layer

Does not determine where to move to, only how to do so. Avoid obstacles, follow characters, and path finding through

complex environments Animation layer

Selecting, parameterizing, and playing character animation sequences

Generating specific animations that are situational, and not pre-rendered/coded

Combat Layer Assessing characters current tactical situation Selecting tactics in combat Performance is key, as this is the fundamental aspect of FPS

Behavior Layer Determines character’s current goal, and attempts to reach

its goal

Page 6: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement

Pathfinding Dynamic Obstacles Spatial Reasoning

Page 7: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Algorithms and methods to find most efficient movement from point A to Z

Most FPS levels tend to be static, so AI use a pre-generated Database

Allows for A* search algorithms

A

Z

Page 8: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Page 9: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Situation changes significantly with the addition of dynamic level elements Player can move objects in front of AI

paths Level Destruction can block paths If the AI does not adapt, will walk into a

wall and get stuck.

Page 10: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Page 11: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Handling of dynamic objects Some games ignore

them (pseudo random movement)

Introduction of Local Pathfinding Uses Global Pathfinding

to establish a general path from A to Z

Create lots of “waypoints” in-between A-Z

A

Z

BC

DE

F

Page 12: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Pathfinding

Local Pathfinding determines if subpath A-B are clear If they are, continues to waypoint B,

where it evaluates B-C If not, it computes an alternate path to

waypoint B Local Pathfinding also uses A* search

Page 13: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Autodesk Kynapse

AI Data generation tool 3D Pathfinding Part of the Unreal 3 Engine Management of perceptions (sight,

smell, and sound)

Page 14: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.
Page 15: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.
Page 16: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Movement – Movement Controller

Subsystem that performs tasks assigned by higher level systems

Performs discrete movement commands▪ Move to (X,Y,Z)

Only be executing one movement command at a time.

Movement controller is an object that owns the current movement command

Can be use to handle different kinds of movement, like walking or swimming

Page 17: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller

When AI enters Combat, almost all control is given to combat controller

Attempts to assess tactical situation Number of enemies, direction, health,

ammo More Advanced: cover locations,

camping locations Issues commands to other systems

Movement, aiming, shooting

Page 18: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller – Spatial Reasoning

Most difficult task for AI combat controller

Spatial Reasoning requires understanding of level (Spatial Configuration) Needs to know where things are, and

how objects are going be use 3-Dimensonal Levels increase

complexity significantly

Page 19: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller – Spatial Reasoning

Pathfinding solution can be used Pre-generate database of objects and their

significance Works poorly with dynamic levels

Level Designers can embed ‘hints’ Makes Level design cumbersome Error prone

Customized tools analyze geometry Can be run dynamically to populate database

Physical properties of objects?

Page 20: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.
Page 21: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Left 4 Dead – Spatial Reasoning

We will use Valve’s Left 4 Dead to discuss and examine spatial reasoning.

Things to think about: Navigating In 3D Optimal Paths CPU Calculations

Example comes from apresentation created by Michael Booth.

Page 22: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Navigating Horizontally

Path finding algorithms help AI’s navigate optimally through environments.

How do you define an environment?By using a Navigation Mesh!!• Used instead of waypoints• AI can move anywhere in between the grids.

However note the Jagged Path.

Page 23: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Navigating Horizontally

We could hardcode a “smooth” path…

Or we could use what Valve calls “Reactive Path Following”… Look ahead in the path and

calculate Use local obstacle avoidance

Page 24: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Navigating Vertically

Oh, it’s a crate!? We would press

spacebar, and bunny hop over it, should be easy for computers right? Wrong

Page 25: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Spatial Reasoning Conclusion

AI has to deal with the environment as we do: Quickly Efficiently Humanly

Combining the two strategies we examined allows for an AI that deals with the presented necessities

Page 26: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller – Tactics

An Example of a Tactical Situation Current Location▪ In cover, or out in the Open?

Ammo (unless they cheat) Enemy▪ How Many?▪ From where?

Current Objective(s) Behavioral Situation

Page 27: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller – Tactics

Tactic Selection Problem Nature of Tactic under Consideration Relative Tactical situation of all

combatants Current Tactical Situation

Use of Tactical Library is common FSMs Databases Databases with Q-Learning

Page 28: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller - Tactics Basic Tactics

Camp▪ AI hides in a location, and waits for an opponent to appear▪ Effective, but behavior can seem very scripted

Joust▪ AI rushes opponent, while firing▪ Runs past opponent with the hopes of being able to turn around

and rush from behind Circle of Death▪ AI circles opponent while firing▪ Keeps a variable radius away from target

Ambush▪ AI ducks behind cover, periodically pops out of cover and shoots

at enemy.▪ Similar to camp, but AI must know where enemy is coming from

Flee and Ambush▪ AI runs away from enemy, and then takes cover and gets ready

to ambush

Page 29: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Dynamic Procedural Combat Tactics

As games evolve, game designers strive to give players more freedoms: Dynamic level designs Interactive objects Large, multi-approachable

situations We will study how AI has

kept up through Killzone©’simplementation.

Page 30: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Why use D.P.C.T.

Old AI would use “hints” and series of “if-then” scripts. Hints remain static, rely on game designers Enormous amount of effort for responsive

AI’s to react to situations and terrain The AI must take into account:

Multiple approach points Dynamic environments Dynamic positioning

End Result: Responsive AI

Page 31: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

What Is D.P.C.T.

AI analyzes the situation Inputs are dynamic

Using gathered information, the AI acts: Goal setting/discarding On-fly-algorithms allow for on-the-fly

decision making Tactics are procedures, not scriptsSummary: tactics are _______ based

on the ___________ and the _________.

Page 32: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Killzone AI: Situation To Decision Killzone AI Summary

Accomplish goals, or change based on desirability/feasability

Move To Position, Do Action Killzone’s describes situations:

Cover from threats Lines-of-fire Danger zones Area of operation

Decisions made using: Position evaluation Line-of-sight and Line-of-Fire

Page 33: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Position Evaluation

The assignment of values to the waypoints of Killzone

Some factors that give higher values Distance to primary target Amount of cover Not in the way of friendly-fire Wall hugging Outside of danger-zone (grenades, tank shells)

Position Evaluation Helps Movement Tactical Positioning Tactical Movement

Page 34: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Tactical Positioning

Position evaluation functions assign values to the waypoints of Killzone

Page 35: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Tactical Movement

Tactical Movement is smarter movement Movement usually done by “lowest weight” Notice we can use some of the existing position

evaluation algorithm to make “dumb” paths cost more▪ Line of fire▪ Close proximity to danger zones▪ Running at the target

Page 36: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Advanced Possible Dynamic Tactics

Position evaluation algorithms, can also be used for attacking Indirect Fire▪ Different determiners can be used to predict where

to throw grenades Suppression Fire▪ Other determiner can be used to figure

out at which cover to lay suppressive fire onto

Page 37: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Advantages and Disadvantages Advantages

Parameterization – change values, not code Easily adapted for other uses, such as multiplayer Procedural tactics are easier to adjust, and work

with – compared to scripts/hints Removes extra ray-casts

Disadvantages Difficult to debug, the AI is “on its own” –

compared to scripts/hints Also, difficult to get it to do your bidding – if you

want to actually script something

Page 38: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Controller – Targeting

Opponent Selection How to Target?▪ Most FPSs pit all AI against an enemy▪ Kung-Fu tactics?

Need for Targeting Heuristic▪ Tactical Situation Awareness▪ Worry about defending itself first▪ Most vulnerable, nearest target▪ Ranking function can simplify

Need to be able to change targets based on changes in Tactical situation

Page 39: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Tactics - Aiming

To-Hit Roll Less than perfect aiming for believability Calculating factors ([0.0,1.0] range)▪ AI skill▪ Range▪ Size▪ Relative target velocity▪ Visibility▪ Target state▪ AI state

Probability to hit = skill*range*size*…*state

Page 40: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Tactics - Aiming

Aiming Cheat Angle▪ Maximum that a projectile can differ from gun

barrel while still being believable▪ Doesn’t need to match line of sight

Location▪ Point with high probability of being hit▪ Model target as overlapping boxes and pick

center of volume

Page 41: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Tactics - Aiming

Shooting and Missing Pick point close to target ▪ Low probability of hitting

Should be visible to player Missing when close and hitting from a far

distance seems unreal

Page 42: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Tactics - Aiming

Ray Testing Test projectiles trajectory before firing Avoid obstacles and friendly fire

Dead Reckoning Estimation of enemy position at given time Shoot where the enemy will be when bullet

arrives Weapon Trajectories

Difficult to predict slow moving projectiles (arrows)

Use physics in ray testing to test trajectory

Page 43: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Combat Tactics - Aiming

Collision Notifications Projectiles store pointers to object that

fired it▪ On hit or miss object is notified

Helps firing object adjust targeting Radius Testing

Helpful for area effect weapons Treats everyone as cylinders or spheres Tests area damage on everyone to avoid

friendly fire and maximize enemy damage

Page 44: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Behavioral Controller

Responsible for controlling current state and high level goals

Most FPS use a Finite State Machines Idle – Standing Guard Patrolling – AI following a designed patrol path Combat – AI is engaged in combat and most

control is given to combat controller Searching – AI is looking for an opponent to

fight or searching for an opponent who fled Summoning Help – AI is searching for help

Page 45: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

patrol

search

fight

sound, patrol -> ɛ

see, patrol -> ɛ

see, search -> ɛ

kill, ɛ -> searchkill, ɛ -> patrol

quiet, ɛ -> patrol

Behavioral Controller- FSM

Page 46: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Behavioral Controller

Page 47: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Scripting Controller

Scripting and Trigger Systems Need scripting and triggering events to

tell the AI to do something Triggered events set AI parameters Send commands to various subsystems▪ Changes state from Idle to Searching, or

Searching to Combat Disadvantages?

Page 48: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Perceptual Modeling

Adds fairness to the game Even though the game knows where a

player is, the AI needs to “see” or “hear” a player approaching

Realism A sleeping enemy has to be startled to

enter combat mode Sneaking element is possible and

quantized

Page 49: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

Perceptual Modeling

Visual Use ray casting to look for players Distance, angle, and visibility factor into vision

Auditory AI needs to receive sound notifications Everyone in earshot should hear the sound Priority of sounds (e.g. bird chirping and

gunshot) Audio Occlusion▪ Interference of sounds to create noise

Tactile(touch) Alert when run into or wounded

Page 50: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

AI Difficulty

AI is initially designed to be very smart (usually) Based on designers, the AI is given flaws

to dumb it down Also changed by difficulty settings▪ Affects parameters for targeting, etc

Player Modeling▪ On the fly difficulty adjustment

Page 51: Zubair Chaudary, Kenny Rentschler, Constantin Savtchenko.

AI as Teammates

Aiming very similar Movement may change

How to move so the AI does not block a teammate’s vision?

Behavior How to choose objectives?