physics / ai week 4 gam 224. outline announcements demos discussion break lecture physics ai

34
Physics / AI Week 4 GAM 224

Upload: penelope-gallagher

Post on 13-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Physics / AIWeek 4

GAM 224

Page 2: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Outline

Announcements Demos Discussion Break Lecture

PhysicsAI

Page 3: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Announcements

Games on ordernow here

Game lab move

Page 4: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Demos

Civilization 3 (Mortega) Total Annihilation (Reedy) Evil Genius (Kaplanskiy) Railroad Tycoon 3 (Johnson-Vinion) Sims 2 (DiConsola)

Page 5: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Game physics

Not Physics 101 physicswhat happens to objects in the game

world and whyusually doesn't include decisions of

non-player characters

Page 6: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example: Asteroids

What is the physics of Asteroids?

Page 7: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Basic fact

All physics is simplificationcomplex multi-body physical

simulations are too slowreality is chaoticlimits to what can be rendered

graphically

Page 8: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example: Halo

What happens when a grenade explodes?do we simulate the ignition and rapid

oxidation of explosives, pressure waves, metal shear and shrapnel trajectories?

do we simulate concussion injuries, soft tissue damage, and bone trauma?

Page 9: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

State

The state of the gamerepresentation of the unique instant in

the game world• what the "save game" feature should

save In a card game

each player's handthe deck

In Asteroids?

Page 10: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Game physics

Physics = the evolution of the game statewe want the player to feel as though

there is a real world in the gamethe game state must be complexits evolution must seem naturalthe player's control over it should

seem natural

Page 11: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Natural?

Games are profoundly unnatural Aliens? Psychic powers? Controlling a

civilization over centuries? As in fiction

"willing suspension of disbelief" natural within the game world context

Game physics may have nothing to do with Newton's

physics

Page 12: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Scripting

When there is a fixed stereotyped response to an action in the gamewe say it is "scripted"

As opposed to "simulated"

Page 13: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example

Designer decides what should happen when a grenade explodesx amount of damage to all units within

certain radiusx/2 damage within a larger radiusleaves a certain "stencil" on the floor

or wall Simplifying the actual physics

Page 14: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example

Locked doorIf player ties to go through locked door

with key in inventory, the door opens and key is used up

ConsequencesDoors cannot be battered down,

removed from hingesLocks cannot be picked

Page 15: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Advantages of scripting

Much, much fasterto apply a simple rule than to run a

physical simulation Easy to write, understand and modify

Page 16: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Disadvantages of scripting

Limits player creativityPlayers will try things that "should"

work• based on extensive physical intuition

Will be disappointed if they don't Game will need many scripts

predicting their interactions can be difficult

complex debugging problem

Page 17: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Simulation

Will still be a simplification Represent the quantities of interest

represent the forces that act on themcreate physical laws for the game

worldevolve the game state according to

these laws

Page 18: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Benefits of simulation

More player optionsDesigner doesn't have to anticipate

every way to do something Physical laws reusable

Do not have script every objectCan build (or buy) generic physics

engine

Page 19: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Disadvantages of simulation

Speedextensive simulation may make the

game too slow Memory

game state may become much larger Testing

difficult to test all possibilities

Page 20: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Design decision

How much to simulate? Where player creativity is important Where realism is important Where a simple enough model can be built

What level of detail is required? depends on the constraints of the game always a computational cost

Page 21: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example

Script when player enters room, guards converge and attack

Simulation #1 when player takes a step, sound is heard over certain radius if guard is within radius and in room, guard will converge and attack

Simulation #2 when player takes a step, volume of sound is calculated based on

level of stealth, floor material, etc. sound is propagated through room and attenuated based on room

contents guards receive sound signal and if loud enough to reach attention,

they will move in the apparent direction of sound Simulation #3

same as #2, but in 3 dimensions, through floors, etc.

Page 22: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

AI

"Physics" of non-player characterssimulating the opponentsimulating other characters

In some games it is the whole pointclassic strategySims

Page 23: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Artificial Intelligence

Broad field of study1950s: how to make computers think

like people Now

how to make computers less stupid

Page 24: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Game AI

Uses very little from AI researchtoo slowfocused on different problems

Main issue"planning"

• how to get characters to act believably

Page 25: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Planning

A planning problemCurrent stateEnd stateKnown operations

• preconditions• postconditions

Construct a sequence of operations to transform

current state to end state

Page 26: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example

Current state player is alive

End state player is dead

Known operations move around use machete

• precondition: must be near target• postcondition: target is dead

Page 27: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Means-ends analysis

Work backwards from desired goal to current state

Exampleto use machete, must be near playerto get near player, moveetc.

Problemthe world changes all the time

Page 28: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Modern planning

Much more complex Integration of

actingsensingchoosingprioritizingetc.

Overkill for games

Page 29: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Typical game AI tasks

Character behaviorsusually scripted actions

Route findingmany games

Resource managementin strategy games

Modeling character relationshipsin some RPGs, some strategy games

Page 30: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Goals for AI

Provide player with challenge Make a good game experience May go against "intelligence"

Page 31: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Issues

Simulate or script?as in physics

Opponent should not make obvious errors

Opponent should not be totally predictable

Page 32: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Example

Simulation when player is firing, construct a line-of-sight map

from player's position. Find area outside of line-of-site especially if it is large and close

Script have predefined "hiding" zones when attacked go to the nearest location

In-between have predefined "hiding" zones calculate which is in the line-of-sight go to closest re-evaluate line-of-sight and move

Page 33: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

AI in design

Not too smart Don't set expectations too high Game play is more important

Not too dumb Must cover minimum player expectations

Compensate Level design Resource advantages

Page 34: Physics / AI Week 4 GAM 224. Outline Announcements Demos Discussion Break Lecture Physics AI

Role-playing

Demo Ballerini: Tales of Symphonia Bubon: Paper Mario Devlin: Pokemon FireRed Miranda: Knights of the Old Republic Summers: Fable

Non-demo Bennett: Tales of Symphonia Dannemiller: Worlds of Warcraft Hahn: Diablo 2 Abero: Knights of the Old Republic Lipsey: Final Fantasy X-2