RECAP CSE 497 Topics on AI And Computer Game Programming Héctor Muñoz-Avila.

19
RECAP CSE 497 Topics on AI And Computer Game Programming Héctor Muñoz-Avila

Transcript of RECAP CSE 497 Topics on AI And Computer Game Programming Héctor Muñoz-Avila.

RECAPCSE 497 Topics on AI And

Computer Game Programming

Héctor Muñoz-Avila

Course Goal

Our goal is to understand the connections and the misconceptions from both sides

AI research

AC

B A B C A CB

CBA

BA

C

BAC

B CA

CAB

ACB

BCA

A BC

AB

C

ABC

“AI”as game practitioners implemented it

projectsprojects

Controlling the AI Opponent: FSMs•FSM: States, Events and Actions

•Stack Based FSM’s•Polymorphic FSM

•Multi-tier FSM

SpawnD

Wander~E,~S,~D

~E

D

AttackE,~D

~E

E

E

D

~S

ChaseS,~E,~D

E

S

S

D

Soldier

Rifleman Officer

British Soviet

AmericanGerman

Machine Gunner

British Soviet

AmericanGerman

British Soviet

AmericanGerman

RobocodeRobocode

Pla

nn

ing

Op

erat

ors

•PatrolPreconditions: No MonsterEffects: patrolled

•FightPreconditions: Monster in sightEffects: No Monster

Patrol Fight

Monster In Sight

No Monster

FSM:

A resulting plan:

Patrolpatrolled

Fight

No MonsterMonster in sight

Controlling the AI Opponent: HFSMs

StartTurn Right

Go-throughDoor

Pick-upPowerup

Wander Attack

Chase

Spawn

~E

E ~S

S

D

~E

UT task: Domination

Strategy: secure most locations

UT action: move Bot1 to location B

Controlling AI Opponent: Scripting

(Nick Haynes)(Nick Haynes)WargusWargus

Autonomous agents calculate their action based on…

Desires

Sensory Input

Proximity to items of interest

(Jon Martin)(Jon Martin)

1

1

1

1

1

Sp

ace

rese

rvat

ion

: q

uas

i-co

ord

inat

ion

Controlling AI Opponent: Team

•Multi-layered approach•Line of sight (player, npcs)•GOAP:

•Agent can dynamically find alternate solutions to problems

(Eric Lease)(Eric Lease)

Dead Reckoning•Predicting future state•For games: Newton physics•Estimate future trajectory: Kinematics

(Dayne MickelsonDayne Mickelson)Team sports•Identify high-level decisions

Unreal tournamentUnreal tournament

Learning: Adaptive Behavior(Megan Vasta)(Megan Vasta)

Neural networks• Dynamic scripting: Reinforcement learning

•But sometimes the problem resides in the scripts not the ordering•Use evolutionary computation to improve scripts

Combat

team controlled by human player

team controlled by computer

A

B

Evolve a population (each member is a candidate solution)

Learning: Adaptive Behavior (2)

•User model•Flexibility beyond predefined difficulty levels•When/what to update

(Brigette Swan)

Allegiance

Defense

Friendly Enemy

0.4 -0.3

-1.0

Weak Strong

0.1

Medium

•Induced from a collection of data•Based on information gain formulas•Assume discrete values

(Jeff Storey)

Learning: Adaptive Behavior (3)Pattern recognition

1. Symbols2. Optimization: balancing units in an

RTS game2. Curse of dimensionalit

Analysis of Machine learning Usage

1. Cheap to recognize what to learn from?

2. Cheap to store the knowledge?3. Cheap to use the knowledge?4. Does game benefit from learning?

(Chris Kramer)

Spatial Analysis

Terrain analysis:•Concepts: borders, corridors•Selection of new colonies

Spatial Analysis:

(Jay Shipper )

Random map generator:•Location of players•Map is generated step-wise by adding clumps

Transport units in RTS games:

(Russell Kuchar)

Spatial Analysis (2)

Wall generation•Graph representation: (tiles, connections)•Greedy algorithm

Hie

rarc

hy in

RT

S g

ames

(Rami KhouriRami Khouri)

Path-Finding (1)A*: minimize f(n) = g(n) + h(n)

(Dan BaderDan Bader)Rep. simplicity versus optimality

•Grid•Graphs•Meshes

String pulling

- Can be used to compute AI

(Tom Gianos)(Tom Gianos)Navigation set hierarchyNavigation set hierarchy

•Interface tables•Reduction memory•Increase performance

Path-Finding (2)(Owen Cummings)(Owen Cummings)

Path Look-Up tablesPath Look-Up tables•Several times faster than A*Several times faster than A*•But memory consumption is highBut memory consumption is high

Solution: Solution: Area-based Look-up tablesArea-based Look-up tables•Notion of portalsNotion of portals•Very fastVery fast

(Tom Schaible)

Flying Edge

Flying Edge

Door EdgeVault Edge

Jump Edge

Rappelling Edge

Throwing a grenade is not so simple!•Add information to nodes

•Add behavior info in edges

Hunting players in a convincing manner

Path-Finding (3)

a

Obstacle

R

a

D

a

V

a

Sidestep Repulsion

(Don DeLorenzo)

Avoiding obstacles•Should be smooth•Crucial in dynamic worlds

Intelligent Steering•Use error correction:•current error + history error + rate error

(Adam Balgach)

Racing vehicle control•Multi-layer system•Each layer defines behavior

Optimal racing line•Use of Newton physics

Game theory

Spectimax kind of search Declarative Knowledge

AC

B CBA

Initial state

Goals

•HTN approach for declarer play–Use HTN planning to generate a game tree in which each move corresponds to a different strategy, not a different card

•Reduces average game-tree size to about 26,000 leaf nodes

•Compute expectimax and expectimin•Evaluation functions•Pruning search space pokerpoker

Game Design(Peter Shankar)(Peter Shankar)

““Meaningful play”Meaningful play”•Outcome is discernable and integratedOutcome is discernable and integrated

Elements for meaningful play:Elements for meaningful play:•SemioticsSemiotics•SystemsSystems•InteractivityInteractivity•ChoiceChoice

Cultural System

Experiential System

Formal System

Sid Mier says:•“personal touch” is needed

Hall of Fame•Winners Project 1: Tournament: Adam Balgach, Tom Gianos. Bot: Yankees Innovation: Tom Shaible, Don Delorenzo. For: "meta-level" FSM design of code. •Winners Project 2: Tournament: Adam Balgach, Tom Gianos. Team: Yankees (continuing champions!) Innovation: Swan, Brigette L, Vasta, Megan E., and Khouri, Rami H. For: a number of interesting ideas: predicting next place for firing, distributing battlefield, training examples. •Winners Project 3: Project # 3 was no tournament. •Winners Project 4: Tournament: Adam Balgach, Tom Gianos. Team: Yankees (unbeatable!) •Winners Project 5: Tournament: Tom Schaible, Don Delorenzo. Team: DDTS (new champions!) •Winners Project 6: Tournament:. Owen Cummings, Dayne Mickelson Team: Tony Wonder (new champions!) Innovation: Tom Shaible, Don Delorenzo. For: decision trees and reinforcement learning

Acknowledgements

• Jon Martin and Eric Lease

• All of you:– Presentations were very good– Projects were worked well (despite difficulties)– Changes:

• 4 projects: robocode, UT, MadRTS, poker

• UT: 2 bots only

• Poker: use downloadable version

The End…