Artificial Intelligence in Game Design - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Artificial Intelligence in Game Design

Description:

Artificial Intelligence in Game Design Hierarchical Finite State Machines Actions Chosen by AI AI chooses actions game engine performs Internal state Example: Which ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 15
Provided by: Amyan79
Learn more at: http://www.csis.ysu.edu
Category:

less

Transcript and Presenter's Notes

Title: Artificial Intelligence in Game Design


1
Artificial Intelligence in Game Design
  • Hierarchical Finite State Machines

2
Actions Chosen by AI
  • AI chooses actions game engine performs
  • Internal state
  • Example Which city boss NPC chooses to attack
  • Visible actions
  • Example Whether orc attacks or defends
  • Must be at level of detail that game engine
    expects

3
Scripted Actions
  • Visible actions usually limited to set of
    animations created in advance
  • Can often be sequence of actionsscripting

Self destruct sequence
Game AI
Game Engine
Poll again when script finished
4
Level of Detail in Graphics
  • Only render graphics at detail necessary for what
    player can see
  • Close up full detail
  • Facial expression
  • Detailed motion
  • Far away little detail
  • Basic body shape
  • Simple motion
  • Minimize load on graphics engine
  • Few NPCs need to be rendered in full detail
    (usually one at a time)

5
Level of Detail in AI
  • Only use full AI when necessary
  • Fast approximations in other situations
  • Often when NPCs off screen

Use full passing AI for cars visible to player
Simple rule for cars not visible to
playerFaster car has 75 chance of successful
pass
6
Guardbot Example
Chase Move towards player Energy Energy - 1
Player visible
PatrolMove back and forth in front of
door Energy at 100
Player within 2 units
Player not visible
Player visible
Escaped Move towards door Energy Energy - 1
Fire
At door
Energy below 50
ReturnMove towards door Energy Energy - 1
7
Guardbot Example
Player in front
Turning
Forward
Player visible
Player to side
Obstacle in front
Dodge
PatrolMove back and forth in front of
door Energy at 100
Player visible
Player not visible
Player within 2 units
Escaped Move towards door Energy Energy - 1
Fire
At door
Energy below 50
ReturnMove towards door Energy Energy - 1
8
Hierarchical State Machines
  • Problems with Finite State Machines
  • Too complex
  • Potentially hundreds of states
  • Design difficult
  • Debugging impossible
  • Much duplication
  • Many blocks of states similar
  • Example Return state also needs Turn, Move,
    and Dodge
  • Many transitions similar
  • Example Need low energy transition from all
    states in Chase

9
Hierarchical State Machines
  • Single high-level state contains entire low-level
    FSM
  • Need initial state that high-level passes control
    to
  • Need final states that correspond to transitions
    from high-level state

Chase
Escaped
Turning
Player not within 10 units
Player to side
Obstacle not in front
Dodge
Start
Player to side
Player in front
Obstacle in front
Forward
Fire
Player within 2 units
10
Hierarchical State Machines
  • Usually implemented as stack
  • Push low-level state on stack when enter
  • Pop and move to next state when finished

Start
Turning
Escaped
Chasing
Chasing
Chasing
Chasing
Escaped

Guarding Door
Guarding Door
Guarding Door
Guarding Door
Guarding Door
11
Exiting Low-level States
  • Interrupts may cause exit before task is
    completed
  • Example Caution flag interrupts passing
  • All states on stack may have interrupt conditions
  • Check all at each frame
  • Better than having same transition for all states

Player in front
Forward
Turning
Energy lt 50
Chasing
Return
Guarding Door
Emergency recall
Go to HQ
12
Exiting Low-level States
  • Can store current low level state and return if
    necessary once exception handled

Build Farm
Clear land
Build barn
Plant crops
Return to appropriate state when dam fixed
Dam break
Fix Dam
13
Designing Hierarchies
  • Task based
  • Major tasks NPC performs
  • Guard
  • Patrol
  • Defend
  • Steps in tasks
  • Wait
  • Chase
  • Motion
  • Turn
  • Move

High level character design team (works with
game designers)
Task subteam
Character motion team(works with animation team)
14
Designing Hierarchies
  • Strategy Level
  • What goal does character attempt to meet?
  • Build, attack, negotiate
  • Tactical Level
  • How does character meet current goal?
  • Which city to attack
  • Which resources to use
  • Motion Level
  • What action does character take this turn?
  • Move forward, left, right
  • Corresponds to animation
Write a Comment
User Comments (0)
About PowerShow.com