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

Pathfinding in partially explored games environments

Embed Size (px)

Citation preview

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.