qualitative spatial analysis chris mansley. qualitative quantitative items are known, definable...

27
Qualitative Spatial Analysis Chris Mansley

Upload: lorin-jackson

Post on 04-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Qualitative Spatial Analysis

Chris Mansley

Page 2: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Qualitative Quantitative items are known, definable

quantities (x,y) coordinates Remaining health Location of units

Qualitative items are much more intangible but intimately related to qualitative items

By decoupling the two, more general code/ideas can be used about the AI

Page 3: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

An example Trafficablity

Given a map and an echelon Restricted (Impassible) Restricted (Passable) Unrestricted

Mobility Corridors Avenues of Approach

Page 4: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Example (cont.)

Page 5: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location
Page 6: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Motivations

Game worlds are increasingly more complex

NPC must be able to reason about them in an intelligent fashion

Dynamic environments Makes scripting less of an option Leads to more problems

Page 7: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Two Implementations Spatial Database

Driven by the dynamic environments associated with FPS

Terrain Analysis Needed a realistic way to analyze

strategic value in RTS

Page 8: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Conventional Methods Conventional Spatial Ideas

NPCs are guided by “hints” placed in the level by designers

Offline analysis of level to build a data structure the NPCs can use to interact with the environment

Page 9: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

AI Nodes

Page 10: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Conventional Methods (cont.) Flaws

Only works for static environments! May be difficult with random maps

Page 11: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Spatial Databases 2-D Grid overlaid on the game

world Each cell can have many layers of

data Can be thought of as several grids

laid on top of one another

Page 12: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Spatial Databases

Search layer

Occupancy layer

Openness layer

Page 13: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Data Layers Openness Layer (Static) Cover Layer (Static) Area Search Layer (Dynamic) Area Occupancy Layer (Dynamic) Line-of-Fire Layer (Dynamic) Light Level Layer (Dynamic)

Page 14: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Using Layers Layers can be combine to form

desirability layers for different scenarios

Combat Desirability Openness Occupancy Cover

Page 15: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Using Layers (cont.) Benefits

Implicitly coordinate multiple AI units Generate multiple movements for

different actions

Page 16: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Using Layers (cont.) Drawbacks

Does not handle 3-D environments easily

Simple Solution – break 3-D environment into smaller grids

Potentially processor intensive Streamline resolution of grid to get best

possible results

Page 17: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Calculating Desirability

Cover layer

Occupancy layer

Openness layer

1

0.6

0

Desirability layer

0

1

0.8

10.8

0.8

0.8

0.6 0.6 0.6

0.6

0.6

0.6 0.6

0 0

1

0.6

0.6

0 0

00

0 0=

Page 18: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Openness Layer A cell containing a wall or blocking

object contains a zero All other cells contain a one The zero is propagated to

neighboring cells to be able to determine proximity to the wall

Page 19: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Openness Layer (cont.)

Solid Wall

Page 20: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Area Occupancy Layer Similar to fog-of-war feature from

RTS Nonzero values are placed where

the unit is located That value is propagated to the

neighboring cells

Page 21: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Area Occupancy Layer (cont.)

Page 22: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Line-of-Fire Layer Useful with ranged weapons Helps AI avoid shooting each other Has a nonzero value in each cell in

the direction of fire

Page 23: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Line-of-Fire (cont.)

Page 24: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Light Level Dynamic lighting is an important

part of modern games Visibility/area lighting can be taken

into account by NPCs The layer has the light intensity at

any cell

Page 25: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Area Search Layer In many “sneaker” games, the NPCs

spend time searching for the player Once searched, the area layer

contains true or some nonzero value Over time that layer can decay, so

the NPC will research it if necessary

Page 26: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

Thief: Deadly Shadows

Page 27: Qualitative Spatial Analysis Chris Mansley. Qualitative Quantitative items are known, definable quantities (x,y) coordinates Remaining health Location

References AI Game Programming Wisdom 2 Forbus, K., “How Qualitative Spatial Reasoning Can

Improve Strategy Game AIs”, IEEE Intelligent Systems, July/August 2002

Thief: Deadly Shadows, Ion Storm/Eidos Interactive 2004