Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

50
Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies By Jeremiah J. Shepherd Committee: Jijun Tang Roger Dougal Jason O’Kane

description

Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies. By Jeremiah J. Shepherd Committee: Jijun Tang Roger Dougal Jason O’Kane. Introduction. Most video games have some form of path-finding Methods for finding paths are primitive - PowerPoint PPT Presentation

Transcript of Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Page 1: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Path-Finding with Motion Constraints Amongst Obstacles

in Real Time StrategiesBy Jeremiah J. Shepherd

Committee:Jijun Tang

Roger DougalJason O’Kane

Page 2: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• Most video games have some form of path-finding

• Methods for finding paths are primitive– Motion Constraints not easily implemented– Agent movement is not realistic

• Some games fabricate path realism

Page 3: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• Real Time Strategies (RTS) are notorious for simple path-finding

• “In an RTS, as in other wargames, the participants position and maneuver units (agents) and structures under their control to secure areas of the map and/or destroy their opponents' assets.” (Gervk)

Page 4: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• Path-finding in RTS’s generally involves these steps:– A unit and destination for the unit is selected– An obstacle free path is the calculated by

using an algorithm like A*– The path is followed by a “move-rotate-move”

method

Page 5: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• These paths can be created in this fashion because of the structure of the environment

• The environment is generally a grid– The size an number of cells are known– Obstacles exist in the environment and are

known– Each grid cell has an occupancy flag

Page 6: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

Page 7: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Old Game Path-finding Example

• Command and Conquer

Page 8: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New game path-finding example

• Halo Wars

Page 9: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• A problem emerges when adding motion constraints to these paths– Paths found may not reach the destination– Paths are no longer guaranteed to be

obstacle free

Page 10: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

Page 11: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Introduction

• The method I propose uses an algorithm found in motion planning and path-finding for robotics

• Combines plans and paths found with the algorithm with carefully crafted data structures

• Paths with motion constraints could be calculated in real-time

Page 12: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Rapidly Exploring Random Trees (RRT) is an algorithm that can find a path and a motion plan that adheres to motion constraints

Page 13: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Goal biased RRT’s work by:1. Choose the point nearest to the goal state in the

tree and attempt to connect the two2. If it succeeds in connecting then a path and a plan

is found3. Else choose a random point in the configuration

space 1. Find the point in the tree nearest to the random point2. Choose actions that will incrementally move toward the

new point, creating new points in the tree

4. Repeat until goal is reached or it is determined that the goal is unreachable

Page 14: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 15: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Why not use RRT’s?– They are inconsistent in regards to speed– In previous tests, the range of time it took to

find a path and motion plan was from six seconds to two minutes

Page 16: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Previous Attempts (Trail of Tears)– Tube Guided RRT– Preprocessing with Motion Planning Matrix

and Environment Matrix (MPM&EM)

Page 17: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Tube Guided RRT– Use a tube to constrict sampling– The less samples the faster it will find a path

• Algorithm– Draw a Probablistic Road Map (PRM)– Find the shortest path on the PRM– Construct a tube with the width the size of the

turning radius around the path– Run the RRT, only sampling points in the tube

Page 18: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 19: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Tube Guided RRT Problems– It ran on par with a regular RRT– Some cases it took much longer than a

regular RRT– More inconsistent than a regular RRT

Page 20: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• MPM&EM– The broad idea is to piece together small

paths and motion plans to create a large motion plan and path

– There are two stages to this algorithm• Offline Stage• Online Stage

Page 21: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• The Smallest Turning Radius Square (STRS) is important to both stages

• Contains a full turn to the left and right

Page 22: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Offline Stage– Create the environment matrix (EM)– Create an initial motion plan matrix (MPM)– Add references in the environment matrix (EM) and

the calculate the final (MPM)

• Online Stage– Traverse the EM from the starting state to the goal

state– Follow the motion plans stored in the MPM as

referenced by the information in the EM cells

Page 23: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 24: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 25: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Create an initial motion plan matrix (MPM)– 3D data structure based on the x, y and in

the configuration space– Contains potential motion plans that can be

used when the STRS is obstacle free – A special environment is used for this step

• All paths are contained inside of the STRS

Page 26: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 27: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 28: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

The Algorithm – Offline Stage

Page 29: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Create the EM continued– For all the points in the EM and for all the

points in the STRS at that EM find and store a motion plan and path

– If a motion plan is collision free in the MPM then a reference to that plan is stored in the EM

– Else calculate a new motion plan store that in the MPM and store a reference to that in the EM

Page 30: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 31: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 32: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• From the starting point calculate a path using A*– The points that lay on the outer edge of

the STRS are given higher priority

• Traverse the EM using the path

• Create a full motion plan with the references in the EM to the MPM

Page 33: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 34: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 35: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

• Problems with MPM&EM– Uses too much memory

– Paths can look very unnatural

Page 36: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• Principles– Similar idea of piecing together smaller

paths

– FORGET RRT’s!

– Use Dubin’s curves to find paths

Page 37: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• Dubins Car– It finds the shortest path for a

nonholonomic model in an obstacle free environment

– The car that only moves forward

– The car can only steer all the way right, all the way left, or not at all

– Paths and plans are very small

Page 38: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• Dubins Car’s 6 motion primitives

Page 39: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• Algorithm Overview– Create an album of motion-plans and

paths (AMAP)

– Create a collision set (CS) containing colliding edges

Page 40: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• AMAP Construction– Create paths for all cells to the right of

the center STRS using Dubin’s Curves

– We can do this because the left side will mirror the right

– Cuts the memory consumption in half

Page 41: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 42: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Related Work

Page 43: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• CS Construction– For every cell in the environment check

to see if an edge collides

– If so add it to the CS

Page 44: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

• Online Portion– Use a slightly modified version of A* to

traverse AMAP

– Includes a short circuit

Page 45: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

Page 46: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

New Algorithm

Page 47: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Results

0

20

40

60

80

100

120

0 20 40 60 80 100 120

Series1

Series2

Series3

Series4

Series5

Series6

Series7

Page 48: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Results

0

20

40

60

80

100

120

0 20 40 60 80 100 120

Series1

Series2

Series3

Series4

Series5

Series6

Series7

Series8

Series9

Series10

Series11

Series12

Page 49: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Conclusion

• It is consistently gooder

Page 50: Path-Finding with Motion Constraints Amongst Obstacles in Real Time Strategies

Questions?