Chap 3 AI

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

ARTIFICIAL

INTELLIGENCE IN
GAME
Vuong Ba Thinh
Department of CS –CSE Faculty - HCMUT

1
Outline
• Real AI versus Game AI
• Path finding
• State-Based Behaviors
• Strategy and Planning

2
“Real” AI versus Game AI
• Real AI focus on ???
• Game AI focus on ???

3
Path finding
• Simple problem: A -> B Intelligently

4
Representing the Search Space

• Turn-based strategy

• Real time action

5
Representing the Search Space
• Grid of squares

• Path nodes

6
Representing the Search Space
• Navigation Mesh
• Advantages:
• ???
• ???
• ….

7
Admissible Heuristics
• h(x): Manhattan distance or Euclidean distance

8
Greedy Best First Search

9
Greedy Best First Search

10
A* Algorithm
• f(x) = h(x) + g(x)

11
Dijkstra’s Algorithm
• f(x) = ???

12
State-Based Behaviors
• State Machines for AI
• Implementation
• State Design Pattern (Reading exercise)

13
State Machines for AI
• Example: Stealth game

14
State Machines for AI
• PACMAN:
http://gameinternals.com/post/2072558330/understanding-
pac-man-ghost-behavior

15
Implementation

16
Implementation

17
BEHAVIOR TREE

18
BEHAVIOR TREE

19
BEHAVIOR TREE

20
Decision Tree -> BT

21
Strategy and Planning
• Strategy ???

• Planning ???

22
More References
• Page 202 in [1]

23

You might also like