recap cse 348 ai game programming

14
RECAP CSE 348 AI Game Programming Héctor Muñoz-Avila

Upload: alima

Post on 23-Feb-2016

38 views

Category:

Documents


1 download

DESCRIPTION

RECAP CSE 348 AI Game Programming. Héctor Muñoz-Avila. C. A. B. C. A. B. C. B. A. B. A. C. AI research. “AI” as game practitioners implemented it. B. A. C. B. A. B. C. C. B. A. B. A. C. A. C. A. A. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: RECAP CSE 348 AI Game Programming

RECAPCSE 348 AI Game Programming

Héctor Muñoz-Avila

Page 2: RECAP CSE 348 AI Game Programming

Course Goal

Our goal was 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

CABC

“AI”as game practitioners implemented it

projects

(me)

(you)keywords

Page 3: RECAP CSE 348 AI Game Programming

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

Robocode

Plan

ning

Ope

rato

rs

• Patrol Preconditions:

No Monster Effects:

patrolled• Fight

Preconditions: Monster in sight

Effects: No Monster

Patrol Fight

Monster In Sight

No Monster

FSM:

A resulting plan:

Patrolpatrolled

Fight

No MonsterMonster in sight

Goal-based

• Scripting

Page 4: RECAP CSE 348 AI Game Programming

Controlling the AI Opponent: Hierarchical Planning

UT task: Domination

Strategy: secure most locations

UT action: move Bot1 to location B

Hierarchical planning

StartTurn Right

Go-throughDoor

Pick-upPowerup

Wander Attack

Chase

Spawn

~E

E ~S

S

D

~E

Hierarchical FSM

Page 5: RECAP CSE 348 AI Game Programming

Depth(Breadth First)

Nodes Time Memory

2 1100 1 sec 1MiB4 111,100 11 sec 106 MiB6 107 19

minutes10 GiB

8 109 31 hours 1 TiB10 1011 129 days 101 TiB12 1013 35 years 10 PiB 14 1015 3,523

years1 EiB

Path-FindingNavigationNavigation set hierarchy

• Interface tables• Reduction memory• Increase performance

A*: heuristic search PACMAN

Page 6: RECAP CSE 348 AI Game Programming

Controlling AI Opponent: Learning• Induction of Decision Trees

• Dynamic Scripting

• Evolutionary computation

Reinforcement Learning

6

Training script 1

Training script 2

….

Training script n

Counter Strategy 1

Counter Strategy 2

….Counter Strategy n

Evolutionary Algorithm

Evolve Domain Knowledge

Knowledge Base Revision

Manually Extract Tactics from Evolved Counter Strategies

Combat

team controlled by human player team controlled by computer

A

B

Page 7: RECAP CSE 348 AI Game Programming

Game Genres: FPSIndividual Behavior

• Divided into four major components: animation, movement, combat, and behavior

• Spatial Analysis: line of fire• Tactical positioning: cover

(Jon Hardy, Michael Caffrey, Shamus Field)

Squad Tactics

• Heuristics for LOS issues

• Supporting player• decentralized vs centralized• Influence maps• Genetic programming for

adapting to opponents

(Matt Mitchell, David Pennenga,John Formica)

Page 8: RECAP CSE 348 AI Game Programming

Game GenresRTS

• ManagersCivilizationBuildUnitResourceResearchCombat

• Difficulty levels• Goals and priority lists• Terrain analysis

Wargus

(Alex Dulmovits, Luis Villegas)

Sport Games

• Event-driven (using FSMs)

• Issues: cheating, Rubber band AI• Difficulty level: +stats for NPCs• Racing games:

Splines Obstacle avoidance – simple

math Using ML for driving control Sport commentary

(Daniel Phillips, Dan Ruthrauff)

Page 9: RECAP CSE 348 AI Game Programming

Game GenresRole Playing Games

• Rich history but prevalent elements: exploration, combat (stat based), leveling

• Scripting vs Goal based• Level of detail• Reputation system: area

based

• Side quests• Story line

(Josh Westbrook, Ethan Harman)

Page 10: RECAP CSE 348 AI Game Programming

Other Crucial TopicsNPC Behavior•Requirements: believable•Scripted vs, autonomous• Human traits: Dependency•Path reservation

• Reputation system•Ideal NPC: act, moves, responds “naturally”

(Daniel Phang & Sui Ying Teoh)

Page 11: RECAP CSE 348 AI Game Programming

Other Game AI TopicsGame Trees

Used to determine game difficulty

With appropriate evaluation functions avoid needing to construct the whole tree

EF(state) = w1f1(state) + w2f2(state) + … + wnfn(state)

Programming Projects

• Finite State Machines

• RTS

• Space simulation

• Pathfinding

• Simulate some of the real game-developing conditions:

Working with someone else’s code

tight deadlines need lots of trial and error to

tune the AI

Page 12: RECAP CSE 348 AI Game Programming

2012 Hall of FameProject # 1. Robocode.

Tournament winner and Innovation winner: Phang, Daniel W., Teoh, Sui Ying).

Project # 2. Pathfinding. Tournament winner: Mitchell, Matthew M., Pennenga, David J., Formica, John M.

Project # 3. Space Simmulation Tournament winner: Mitchell, Matthew M., Pennenga, David J., Formica, John M.

Project # 4: Wargus Tournament winners:

• Mitchell, Matthew M., Pennenga, David J., Formica, John M. Use farms to create choke points Advance resource collectionSet patrols as resource gathering units move forwardGriphons and Mages

Page 13: RECAP CSE 348 AI Game Programming

Acknowledgements

• All of you:– Presentations were very good– Projects worked well (despite difficulties)– James Ahlum: Pathfinding– Jon Schiavo: Space simulation– Yisheng Tang: Robocode and Wargus

Page 14: RECAP CSE 348 AI Game Programming

Final Summary

AI research

AC

B A B C A CB

CBA

BA

C

BAC

B CA

CAB

ACB

BCA

A BC

AB

CABC

“AI”as game practitioners implemented it

• A*• AI Planning

HTN Planning• Heuristic evaluation • Machine learning

Decision TreesReinforcement learning

Dynamic scripting Evolutionary comp.

• Game trees

Programming• Finite State Machines• RTS• Space simulation• Pathfinding

Genres• First-person shooter• Real-time strategy• Racing games• Team sports• Role-playing games

Path finding• Look-up tables• Waypoints

Other crucial topics• NPC behavior

• Individual• Team