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

Slides:



Advertisements
Similar presentations
Dynamic Programming 25-Mar-17.
Advertisements

General Pathfinding: Tables and Navigation Jeremy Christman.
AI Pathfinding Representing the Search Space
Part IV: Memory Management
Pathfinding AI John See 29 Nov, 13 Dec 2010.
Types of Algorithms.
The Assembly Language Level
Quick Review of Apr 10 material B+-Tree File Organization –similar to B+-tree index –leaf nodes store records, not pointers to records stored in an original.
Memory Management Chapter 7.
CSE 380 – Computer Game Programming Pathfinding AI
Technical Advisor : Mr. Roni Stern Academic Advisor : Dr. Meir Kalech Team members :  Amit Ofer  Liron Katav Project Homepage :
CS 153 Design of Operating Systems Spring 2015
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
1 Chapter 9 Maps and Dictionaries. 2 A basic problem We have to store some records and perform the following: add new record add new record delete record.
Scaling Personalized Web Search Glen Jeh, Jennfier Widom Stanford University Presented by Li-Tal Mashiach Search Engine Technology course (236620) Technion.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Route Planning Vehicle navigation systems, Dijkstra’s algorithm, bidirectional search, transit-node routing.
Data Structures Using C++ 2E Chapter 9 Searching and Hashing Algorithms.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
Chapter 5.4 Artificial Intelligence: Pathfinding.
CSE 326: Data Structures Binomial Queues Ben Lerner Summer 2007.
Data Structures & Algorithms Union-Find Example Richard Newman.
VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter 5: Global Routing © KLMH Lienig 1 FLUTE: Fast Lookup Table Based RSMT Algorithm.
Real-Time Concepts for Embedded Systems Author: Qing Li with Caroline Yao ISBN: CMPBooks.
Chapter 3 Memory Management: Virtual Memory
Chapter 5.4 Artificial Intelligence: Pathfinding.
Data Structures and Algorithms Graphs Minimum Spanning Tree PLSD210.
Memory Management Chapter 7.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Othello Artificial Intelligence With Machine Learning
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Path Planning Part I: Search Space Representation Part II: Table Lookup Path Finder Path III: Convincing Hunting Ref: AIWisdom 2.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
March 16 & 21, Csci 2111: Data and File Structures Week 9, Lectures 1 & 2 Indexed Sequential File Access and Prefix B+ Trees.
Clustering Spatial Data Using Random Walk David Harel and Yehuda Koren KDD 2001.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Efficient Route Computation on Road Networks Based on Hierarchical Communities Qing Song, Xiaofan Wang Department of Automation, Shanghai Jiao Tong University,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Union-find Algorithm Presented by Michael Cassarino.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
JETT 2005 Session 5: Algorithms, Efficiency, Hashing and Hashtables.
An Efficient Linear Time Triple Patterning Solver Haitong Tian Hongbo Zhang Zigang Xiao Martin D.F. Wong ASP-DAC’15.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 19 & 20 Instruction Formats PDP-8,PDP-10,PDP-11 & VAX Course Instructor: Engr. Aisha Danish.
Tetris Agent Optimization Using Harmony Search Algorithm
Data Structures and Algorithms in Parallel Computing Lecture 2.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
IS 2610: Data Structures Recursion, Divide and conquer Dynamic programming, Feb 2, 2004.
EXCURSIONS IN MODERN MATHEMATICS SIXTH EDITION Peter Tannenbaum 1.
CPSC 252 Hashing Page 1 Hashing We have already seen that we can search for a key item in an array using either linear or binary search. It would be better.
CS 147 Virtual Memory Prof. Sin Min Lee Anthony Palladino.
Optimization Problems In which a set of choices must be made in order to arrive at an optimal (min/max) solution, subject to some constraints. (There may.
Computer Sciences Department1.  Property 1: each node can have up to two successor nodes (children)  The predecessor node of a node is called its.
NETW3005 Memory Management. Reading For this lecture, you should have read Chapter 8 (Sections 1-6). NETW3005 (Operating Systems) Lecture 07 – Memory.
Revision Mid 2, Cache Prof. Sin-Min Lee Department of Computer Science.
What is it and why do we need it? Chris Ward CS147 10/16/2008.
CSCE 552 Fall 2012 AI By Jijun Tang. Homework 3 List of AI techniques in games you have played; Select one game and discuss how AI enhances its game play.
Maitrayee Mukerji. Factorial For any positive integer n, its factorial is n! is: n! = 1 * 2 * 3 * 4* ….* (n-1) * n 0! = 1 1 ! = 1 2! = 1 * 2 = 2 5! =
All-pairs Shortest paths Transitive Closure
CSE 120 Principles of Operating
File System Implementation
Disjoint Sets Chapter 8.
Unit-2 Divide and Conquer
Data Structures & Algorithms Union-Find Example
Data Structures & Algorithms Union-Find Example
COMP108 Algorithmic Foundations Dynamic Programming
Presentation transcript:

Navigation Set Hierarchy Tom Gianos Chapter 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

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

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

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

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

A Simple Example Table Size = n 2

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);}}

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

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

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

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

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

Partitioning a 1000-node Map Partitions Transition Table Entries Interface Nodes Interface Table Entries Total Table Entries = 1,000, ,000, *500 2 = 500, , *200 2 = 200, , *100 2 = 100, , *20 2 = 20, ,50082,500

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

Choke Point Demo

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

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

Example going from A3 to C7

Transition Tables

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).

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

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

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

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

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