Artificial Intelligence in Game Design - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Artificial Intelligence in Game Design

Description:

Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees Decision Making Based on internal and external information Defines a current ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0
Slides: 12
Provided by: Amyan55
Category:

less

Transcript and Presenter's Notes

Title: Artificial Intelligence in Game Design


1
Artificial Intelligence in Game Design
  • Intelligent Decision Making and Decision Trees

2
Decision Making
  • Based on internal and external information
  • Defines a current action (eat food)
  • Changes world and internal state

I am hungry
There is food nearby
I am not hungry
Food nearby is gone
3
Intelligent Agent Approach
  • Reflex agentNo memory, just if-then rules
  • Memory-based agentAlso based on current state
  • Goal-based agentChooses actions that best help
    meet current goal
  • Utility-based agentBalances multiple weighted
    goals, choosing actions that give best overall
    state

action
input
rules
action
input
rules
memory
Goal-based planning
Sims
4
Reflex Agents
  • Example orc reflex agentif hitPoints lt 5
    then run away from playerif distance to player lt
    2 units then attack playerif player visible
    the run towards playerelse move in random
    direction

5
Reflex Agents
  • Example orc reflex agentif hitPoints lt 5
    then run away from playerif distance to player lt
    2 units then attack playerif player visible
    then run towards playerelse move in random
    direction

Internal state
External state
6
Reflex Agents
  • Actions often hierarchicalif hitPoints lt 5
    then run away from playerif distance to player lt
    2 units then attack playerif player visible
    then run towards playerelse move in random
    direction

These will call complex navigation subroutines to
implement the action
7
Reflex Agents
  • Must consider cost of gathering inputsif
    hitPoints lt 5 then run away from playerif
    distance to player lt 2 units then attack
    playerif player visibleif player in same room
    or distance to player lt 5 units then run
    towards playerelse move in random direction

This requires complex computations
8
Reflex Agents
  • Possible problem
  • Multiple rules may fire
  • Indicated actions may be contradictory
  • Action may depend on order of rules
  • Problem if rules added by multiple
    developers(side effects)
  • if hitPoints lt 5 then run away from
    playerif distance to player lt 2 units then
    attack player

What if next to player and have low hit points?
9
Decision Trees
  • Simple decision tool
  • Easy for non-programmers to understand
  • No ambiguity
  • Very efficient
  • Simple tree traversal
  • Node question
  • Branch to follow answer
  • Leaf final action to take

Hit points lt 5?
no
yes
Obstacle between myself and player?
Within one unit of player?
yes
yes
no
no
Path to playerclear?
hide
run
attack
yes
no
run towardsplayer
runsideways
10
Randomness in Decision Trees
  • Make decisions at some nodes based on random
    number

Math.random() lt 0.5
yes
no
defend
Math.random() lt 0.2
yes
no
Swing swordfrom left
Swing swordfrom right
11
Randomness in Decision Trees
  • Problem Generating different random action may
    not be plausible
  • Will both stand still and patrol for a few frames
    at a time
  • Better if it decided to do one and keep doing it
    for a while
  • Need states to implement this idea

Math.random() lt 0.4
yes
no
Stand still
Patrol
Write a Comment
User Comments (0)
About PowerShow.com