Top Banner
Path finding in partially explored environments John Stamford De Montfort University Centre for Computational Intelligence
21

Pathfinding in partially explored games environments

Jul 17, 2015

Download

Technology

johnstamford
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Pathfinding in partially explored games environments

Path finding in partially

explored environments

John StamfordDe Montfort University

Centre for Computational Intelligence

Page 2: Pathfinding in partially explored games environments

Introduction

• Aims and Objectives

• The Problem

• The Proposed Solution

• Occupancy Grids

• Representation of the Occupancy Grid

• Path Finding Algorithm

• Final Performance

Page 3: Pathfinding in partially explored games environments

The Problem• Path Finding in Games

• Generally know the environment

• Predefined node based systems

• Works well on tiled based games Bourg (2004 p.128)

Node Based Example - Chin (2012) Tile Based Example – Bourg (2004)

Page 4: Pathfinding in partially explored games environments

How can we emulate real

world path finding in game

AI systems?

Page 5: Pathfinding in partially explored games environments

The System• Unity 3D Games Engine

• Physics / Collision Boxes

• Simulates Sonar/LIDAR

• Builds a path based on what it knows about the environment

• Updates the path as it learns more about the environment

Page 6: Pathfinding in partially explored games environments

The System

• Does not need to know the

environment

• Can adapt in Real Time

with dynamically changing

environments

Page 7: Pathfinding in partially explored games environments

The System

• Does not need to know the

environment

• Can adapt in Real Time

with dynamically changing

environments

Page 8: Pathfinding in partially explored games environments

How is ‘knowledge’ store?

ProbablyOccupied

ProbablyEmpty

Unknown

1.00.0 0.5

Occupancy Grids- 100 x 100

- Multidimensional Array (Doubles)

Storage- 10,000

- 8 bit per double

- 9.8 KB (or 0.01 MB)

Representation- Create a dynamic Mesh

- UV Texture every update

Page 9: Pathfinding in partially explored games environments

Sensor Readings

Page 10: Pathfinding in partially explored games environments

Updating the Grids values

Zone 1Zone 2 Zone 3

Sub Section

𝑷 𝑯 𝒔𝒏 =𝑷 𝒔𝒏 𝑯 𝑷 𝑯 𝒔𝒏−𝟏

𝑷 𝒔𝒏 𝑯 𝑷 𝑯 𝒔𝒏−𝟏 + 𝑷 𝒔𝒏 ¬𝑯 𝑷 ¬𝑯 𝒔𝒏−𝟏

Grids values are updated using a Bayesian approach as discussed by Murphy (?????)𝐖𝐡𝐞𝐫𝐞 𝑷 𝑯 𝒔𝒏 𝐫𝐞𝐩𝐫𝐞𝐬𝐞𝐧𝐭𝐬 𝐭𝐡𝐞 𝐥𝐚𝐭𝐞𝐬𝐭 𝐎𝐜𝐜𝐮𝐩𝐚𝐧𝐜𝐲 𝐆𝐫𝐢𝐝 𝐯𝐚𝐥𝐮𝐥𝐞𝐬 𝐚𝐧𝐝𝑷 𝒔𝒏 𝑯 𝐫𝐞𝐩𝐫𝐞𝐬𝐞𝐧𝐭𝐬 𝐭𝐡𝐞 𝐜𝐮𝐫𝐫𝐞𝐧𝐭 𝐒𝐨𝐧𝐚𝐫 𝐕𝐚𝐥𝐮𝐞.

𝑷 𝑶𝒄𝒄𝒖𝒑𝒊𝒆𝒅 =

𝑹 − 𝒓𝑹

+𝜷 − 𝜶𝜷

𝟐×𝑴𝒂𝒙𝑶𝒄𝒄𝒖𝒑𝒂𝒏𝒄𝒚

𝑷 𝑬𝒎𝒑𝒕𝒚 = 𝟏 − 𝑷(𝑬𝒎𝒑𝒕𝒚)

𝑷 𝑬𝒎𝒑𝒕𝒚 =

𝑹 − 𝒓𝑹

+𝜷 − 𝜶𝜷

𝟐

𝑷 𝑶𝒄𝒄𝒖𝒑𝒊𝒆𝒅 = 𝟏 − 𝑷(𝑬𝒎𝒑𝒕𝒚)

𝑷 𝑶𝒄𝒄𝒖𝒑𝒊𝒆𝒅 = 𝟎. 𝟓

𝑷 𝑬𝒎𝒑𝒕𝒚 = 𝟏 − 𝑷(𝑬𝒎𝒑𝒕𝒚)

Zon

e 1

Zon

e 2

Zon

e 3

Page 11: Pathfinding in partially explored games environments

Video 1 – Occupancy Grid

https://www.youtube.com/watch?v=pwfPg2diKOY

Page 12: Pathfinding in partially explored games environments

Path Finding Methods

• Alternative methods

• A* Algorithm

• Dijlstra’s Algorithm

• Anytime D*

• Final Choice – A*• Bourg (2004 p.126) highlights that A*is the most widely used and fastest

method

• Millington (2009 p.275) discuss performance issues with path finding and

states that the A* can minimise this by the ability for it to be stopped and

started

𝒇 = 𝒈 + 𝒉

Page 13: Pathfinding in partially explored games environments

G Cost

• Movement Cost

14 10 14

10 10

14 10 14

10

10 10

10

Page 14: Pathfinding in partially explored games environments

H Cost

5 4 3 2 1 2

4 3 2 1 0 1

5 4 3 2 1 2

6 5 4 3 2 3

7 6 5 4 3 4

8 7 6 5 4 5

HeuristicManhattan

dx + dy

Pre-calculated

Experimental

dx + dy + On

Where On is a value based on the squares Occupancy Grid value

Page 15: Pathfinding in partially explored games environments

Path Finding Process144 + 10

1313 + 10

123 + 10

144 + 10

1313 + 10

123+ 10

111 + 10

165 + 10

144 + 10

1313 + 10

123 + 10

184 + 10

155 + 10

144 + 10

185 + 10

155 +10

177 + 10

Page 16: Pathfinding in partially explored games environments

Path Finding - Obstacle

Page 17: Pathfinding in partially explored games environments

Path Finding - Obstacle

Page 18: Pathfinding in partially explored games environments

Video 2 – Route Planning

The robot knows...

• The target position

• Its own position

Everything else is automated

https://www.youtube.com/watch?v=ZoWj5-bWGV0

Page 19: Pathfinding in partially explored games environments

Video 3 – More complex

The robot knows...

• The target position

• Its own position

Everything else is automated

https://www.youtube.com/watch?v=3JRBRpuOxcE

Page 20: Pathfinding in partially explored games environments

Summary• Overall Performance is good

• Uses sonar based models

• Could be omitted to reduce complexity

• Unique combination of Occupancy Grids and the A* Algorithm

• Fine tuning of tolerances and resolution can be performed for different scenarios

• Low computational costs, however could be better optimised

Page 21: Pathfinding in partially explored games environments

ReferencesBourg, DM. (2004) AI for Game Developers. 1st Edition. O'Reilly Media.

Chin, R. (2012) “Beginning iOS 3D Unreal Games Development” 1st

Edition. Apress.

Millington, I. (2009) Artificial Intelligence for Games. 2 Edition. CRC

Press.

Murphy, R. (2000) “An Introduction to AI Robotics (Intelligent Robotics

and Autonomous Agents)” 1st Edition. A Bradford Book.