Presentation is loading. Please wait.

Presentation is loading. Please wait.

Navigation Set Hierarchy Tom Gianos Chapter 2.2. Mike Dickheiser Works (worked?) for Red Storm Entertainment Works (worked?) for Red Storm Entertainment.

Similar presentations


Presentation on theme: "Navigation Set Hierarchy Tom Gianos Chapter 2.2. Mike Dickheiser Works (worked?) for Red Storm Entertainment Works (worked?) for Red Storm Entertainment."— Presentation transcript:

1 Navigation Set Hierarchy Tom Gianos Chapter 2.2

2 Mike Dickheiser Works (worked?) for Red Storm Entertainment Works (worked?) for Red Storm Entertainment Part of Ubisoft Part of Ubisoft Developer of Tom Clancy Games like Ghost Recon and Rainbow Six Developer of Tom Clancy Games like Ghost Recon and Rainbow Six His work focuses on efficient AI systems for games and AI control of highly realistic vehicles His work focuses on efficient AI systems for games and AI control of highly realistic vehicles

3 Problem With Dynamic Pathfinding Dynamic pathfinding acts as CPU hog Dynamic pathfinding acts as CPU hog Blocks the development of more exciting AI features by wasting CPU cycles Blocks the development of more exciting AI features by wasting CPU cycles Solution: Solution: Precompute navigation information Precompute navigation information

4 Issues with Precomputation Levels/maps of games today are massive Levels/maps of games today are massive Could contain thousands of nodes Could contain thousands of nodes Precomputed navigation information could take up massive amounts of memory Precomputed navigation information could take up massive amounts of memory Solution: Solution: Navigation Set Hierarchy Navigation Set Hierarchy

5 What is Navigation Set Hierarchy? A multitier extension of the basic preprocessed navigation solution with comparable speed and considerably less memory overhead A multitier extension of the basic preprocessed navigation solution with comparable speed and considerably less memory overhead

6 What is the basic precomputed solution? Basic component is a lookup table (called a transition or solution table) where each entry represents the next step between a source node and a goal node Basic component is a lookup table (called a transition or solution table) where each entry represents the next step between a source node and a goal node In other words, for every pair of nodes Source and Goal, the entry [S][G] represents the node that should be visited next In other words, for every pair of nodes Source and Goal, the entry [S][G] represents the node that should be visited next

7 A Simple Example Table Size = n 2

8 Simple Code Void buildBestPath(int source, int goal, list & path) {path.push_back(source); while(source != goal) { source = _transitionTable[source][goal]; path.push_back(source);}}

9 Navigation Sets Transform the single monolithic navigation map into a hierarchy of several smaller sub-maps called navigation sets Transform the single monolithic navigation map into a hierarchy of several smaller sub-maps called navigation sets Navigation Set: Navigation Set: A self contained collection of nodes that requires no links to external nodes in order to complete a path from one internal node to another A self contained collection of nodes that requires no links to external nodes in order to complete a path from one internal node to another A complete precomputed transition table can be constructed for each navigation set A complete precomputed transition table can be constructed for each navigation set

10 Interface Nodes and the Interface Navigation Set Once the monolithic map is broken up into navigation sets a problem that arises is cross set navigation Once the monolithic map is broken up into navigation sets a problem that arises is cross set navigation To solve this, identify all nodes in the navigation sets that connect to nodes in other navigation sets (Interface Nodes) To solve this, identify all nodes in the navigation sets that connect to nodes in other navigation sets (Interface Nodes) These navigation nodes together create their own second level navigation set called an Interface Set Transition table and hence the Navigation Set Hierarchy These navigation nodes together create their own second level navigation set called an Interface Set Transition table and hence the Navigation Set Hierarchy

11 Navigation Set Hierarchy Example Monolithic Map = 441 transition table entries (21 2 ), 21 Nodes, 1 Navigation Set Hierarchical Map = 183 transition table entries (7 2 + 7 2 + 7 2 + 6 2 ) Memory overhead reduced 60%

12 Constructing the Hierarchy Key goals for deconstructing single large transition table into navigation sets: Key goals for deconstructing single large transition table into navigation sets: Determining the number of smaller tables to create Determining the number of smaller tables to create Intelligently choosing where to partition to minimize number of interface nodes Intelligently choosing where to partition to minimize number of interface nodes

13 Selecting the Number of Navigation Sets Depends on the resources of the project Depends on the resources of the project In breaking up a monolithic map into n equal-sized partitions, reduce data size to 1/n of the original size plus the interface set In breaking up a monolithic map into n equal-sized partitions, reduce data size to 1/n of the original size plus the interface set Once size of partition is chosen designers can control the number of interface nodes and thus the size of the interface set Once size of partition is chosen designers can control the number of interface nodes and thus the size of the interface set If the interface nodes are chosen wisely navigation sets can become larger and the relative cost of the interface sets will become smaller If the interface nodes are chosen wisely navigation sets can become larger and the relative cost of the interface sets will become smaller

14 Partitioning a 1000-node Map Partitions Transition Table Entries Interface Nodes Interface Table Entries Total Table Entries 1 1000 2 = 1,000,000 001,000,000 2 2*500 2 = 500,000 10100500,100 5 5*200 2 = 200,000 25625200,625 10 10*100 2 = 100,000 502500102,500 50 50*20 2 = 20,000 25062,50082,500

15 Selecting the Partition Boundaries Keeping the number of interface nodes as low as possible is the number one goal for two reasons: Keeping the number of interface nodes as low as possible is the number one goal for two reasons: Fewer interface nodes results in a smaller interface table size, saving memory Fewer interface nodes results in a smaller interface table size, saving memory Fewer interface nodes there are per set the faster the pathfinding process will be Fewer interface nodes there are per set the faster the pathfinding process will be Identify natural choke points in navigation data, a small collection of nodes that single-handedly connect to larger collection of nodes Identify natural choke points in navigation data, a small collection of nodes that single-handedly connect to larger collection of nodes If natural choke points do not present themselves then modify the map If natural choke points do not present themselves then modify the map

16 Choke Point Demo

17 The Complete Pathfinding Solution If source and goal nodes are in the same navigation set, the process is the same as before If source and goal nodes are in the same navigation set, the process is the same as before Inter-set pathfinding requires more work Inter-set pathfinding requires more work 4 step process 4 step process

18 The 4 Steps 1) Determine the best paths leading from the source node to the boundary of the source set (interface nodes) 1) Determine the best paths leading from the source node to the boundary of the source set (interface nodes) 2) Determine the best path from the source set boundary to the goal set boundary 2) Determine the best path from the source set boundary to the goal set boundary 3) Determine the best paths from the goal set boundary (interface nodes) to the goal node 3) Determine the best paths from the goal set boundary (interface nodes) to the goal node 4) create a list of complete paths assembled from the first three steps and chose path with the least cost 4) create a list of complete paths assembled from the first three steps and chose path with the least cost

19 Example going from A3 to C7

20 Transition Tables

21 Example Step 1 SourceGoalSub-pathCost A3A6 A3, A6 10 A3A7 A3, A6, A7 20 Using transition table for set A, find the best paths leading from A3 to the boundary set of A (A6 and A7).

22 Example Step 2 Using the interface node transition table, find the best paths leading from the boundary set of A (A6 and A7) to the boundary set of C (C3 and C5) In other words, the best path from each interface node in one set to each interface node in the other set SourceGoalSub-PathCost A6C3 A6, A7, C3 20 A6C5 A6, B2, C5 22 A7C3 A7, C3 10 A7C5 A7, C3, C5 20

23 Example Step 3 Best path from boundary set of C to goal node C7 Opposite of Step 1 SourceGoalSub-pathCost C3C7 C3, C5, C7 20 C5C7 C5, C7 10

24 Example Step 4 Determine all distinct paths that can be generated from source to goal by combining results of steps 1-3 and choose path with the least cost PathCost A3, A6, A7, C3, C5, C7 50 A3, A6, B2, C5, C7 42

25 Possible Performance Issues? Does 4 step process return us to expensive runtime computation we were trying to escape to begin with? Does 4 step process return us to expensive runtime computation we were trying to escape to begin with? The amount of searching is dependent only on the amount of interface nodes in source and goal sets only and not the actual number of nodes in the navigation sets themselves The amount of searching is dependent only on the amount of interface nodes in source and goal sets only and not the actual number of nodes in the navigation sets themselves The cost of the inter-set path search does not scale up with navigation set size, number or complexity The cost of the inter-set path search does not scale up with navigation set size, number or complexity

26 Conclusion Attempting to give best of both worlds: Attempting to give best of both worlds: Extremely fast pathfinding Extremely fast pathfinding Relatively low memory cost Relatively low memory cost Easy to implement since navigation sets and tables sit on top of existing underlying data structures of nodes and edges Easy to implement since navigation sets and tables sit on top of existing underlying data structures of nodes and edges Allows for more creative use of gained CPU cycles not spent on A* or other dynamic methods Allows for more creative use of gained CPU cycles not spent on A* or other dynamic methods


Download ppt "Navigation Set Hierarchy Tom Gianos Chapter 2.2. Mike Dickheiser Works (worked?) for Red Storm Entertainment Works (worked?) for Red Storm Entertainment."

Similar presentations


Ads by Google