1 / 36

Path Planning

Path Planning. Part I: Search Space Representation Part II: Table Lookup Path Finder Path III: Convincing Hunting Ref: AIWisdom 2. Taxonomy. Local path finding For dynamic environment [characters in motion, obstacles moved by characters] potential energy, steer, … Global path planning

rhulsey
Download Presentation

Path Planning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Path Planning Part I: Search Space Representation Part II: Table Lookup Path Finder Path III: Convincing Hunting Ref: AIWisdom 2

  2. Taxonomy • Local path finding • For dynamic environment [characters in motion, obstacles moved by characters] • potential energy, steer, … • Global path planning • For static environment • Graph-based search algorithm (Dijkstra, A*, BFS, …)

  3. Task Decomposition • Search Space Representations: ways to define the waypoints • Search Algorithms • Extension: mixed with local algorithm …

  4. Search Space Representations • Analogy: C++ STL: algorithms (sort, find, copy, …) work on various container classes (vector, list, …) • Path finding: • algorithms (BFS, DFS, Dijkstra, A*,…) • Search space representation: … • Choice of representation has great impact on performance and memory overhead • Assumption: 2D, or 3D hovering at fixed height • Full 3D: flying, swimming characters

  5. Introduction • All search spaces are graphs: nodes and edges • Problem definition (Path Optimality): given two points A and B, find the least expensive path from A to B • Remarks: • not always the shortest [consider swamp] • Must consider agent movement capability [size, open door, swim, climb, …]

  6. Character-dependent Paths

  7. Search Space Generation • Options: • manually created by level designer • Automatically generated by programs • “The AI is broken in your level because you put the path node in the wrong place …” jeopardize the workflow

  8. Regular grid (square, hexagonal) Corner graph Waypoint graph [circle-based] Space-filling volume Navigation Mesh [triangle or poly-based] Understand the pros and cons Smooth technique (string-pulling) Hierarchical representation (thousands of waypoints …) Types of Representation

  9. Example Scene

  10. Simplest way: grid of squares, rectangles, triangles, hexagons, … Large number of grid cell (large memory footprint) Easy for “random-access lookup” Regular Grid

  11. Quality of path 4-way access Allow diagonal Regular Grid (cont)

  12. String-Pulling • Line-of-sight test: remove Pn if Pn+1 is visible from Pn-1 • Can be very expensive • Use Catmull-Rom spline to create a smooth curved path

  13. Alternative: Chase the Point • Instead of tracking along the path, the agent chases a target point that is moving along the path • Start with the target on the path ahead of the agent • At each step: • Move the target along the path using linear interpolation • Move the agent toward the point location, keeping it a constant distance away or moving the agent at the same speed • Works best for driving or flying games

  14. Chase the Point Demo

  15. B A D C Remark • Grid, though seemingly can be implemented as arrays, should be implemented as (directed) graph: path can be directional

  16. Way points placed at convex corners of the obstacles O(n2) complexity to determine edges in the graph Create sub optimal path Character walk very close to the wall (unnatural) different sized character requires different set of waypoints … Corner Graph

  17. Similar to corner graph; but waypoints are usually placed in the middle of rooms and hallways Also suffer from the O(n2) complexity issue Works well in human architecture; tend to work poorly in large rooms and open terrain Usually require hand-tuning by level designer to perform well Waypoint Graph

  18. Circle-based Waypoints • Try to resolve the O(n2) complexity • Add to each way point a radius parameter: indicate the amount of open space around it • Generate edges between node pairs whose circles overlap • Works well in open terrain, but in angular environment circles may not fill well (shown in figure)

  19. Space-Filling Volumes • Ways of generation: drop-and-grow; merge from grid • Works better (cp. circle-based) for angular environment

  20. Cover the game world with convex polygons Handles indoor and outdoor terrain equally well Require storage of large number of polygons Convexity is required because … Triangulation, trapezoidalization NavMesh

  21. Modified String-Pulling • Besides eliminating unnecessary points on the path, path points can move along the link (shared edge) between two nodes

  22. Hierarchical Representation • Break the navigation problem into levels • [library in NYC to a diner in Seattle] • Key step: identify zones; cluster nodes in search graph • Indoor scene: use portal information

  23. Navigation Set Hierarchy

  24. Introduction • Developers are spending more resources in the attempt to deliver interesting and complex AI behavior • Basic functions like path-finding should be cheap • Precomputing navigation accomplishes this, with a price: memory

  25. Basics: The Transition Table Table requires n2 entries

  26. Hierarchy • Navigation set: a self-contained collection of nodes that requires no links to external nodes in order to complete a path from one internal nodes to another • Interface nodes: the connective boundaries between navigation sets • Interface set

  27. Example

  28. Constructing the Hierarchy • Partitioning by automated means is a complex problem ! • Objective: keep the number of interface nodes as low as possible • Identify “choke points”

  29. Complete Path Planner • Source & goal in same NavSet: trivial • Four-step solution • Source to boundary set • Tier-2 paths: interface nodes • Boundary set to Target • From combinations; select the one with least cost Performance depends on the number of interface nodes in the source and goal sets only

  30. A6 C3 C7 A3 C5 A7 Example

  31. Memory Optimization • In the transition table, instead of storing node indices (which can be large and requires more bits), store edge indices (edge that lead to the node) I doubt this will work. How to know which node a particular edge leads to?

  32. Hunting Down the Player in a Convincing Manner

  33. Introduction • Require NPCs to convincingly chase and hunt down the player • When a guard has spotted the player, he begins pursuit • Routing player’s position to a path planner generate a shortest-path may let the player feel cheated • Interesting game play: lure the NPC into regions then double back to escape

  34. Facility: • Know the positions of target player and hunting character (NPC) • Visibility test from NPC to player • Three scenarios • Player is visible (by the NPC) • Player was recently seen • Player has never been seen

  35. Scenarios Scenario One: • Change from hunting state to attack state Scenario Two: • NPC moves to the last seen player location, should be stored by game engine

  36. Create intermediate destination to approach the player Generate random direction and travel distance Successive application Scenario Three

More Related