Path Look-up Tables & An Overview of Navigation Systems Hai Hoang 10/4/2004.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

General Pathfinding: Tables and Navigation Jeremy Christman.
AI Pathfinding Representing the Search Space
Chapter 6: Memory Management
Pathfinding AI John See 29 Nov, 13 Dec 2010.
Navigation Set Hierarchy Tom Gianos Chapter 2.2. Mike Dickheiser Works (worked?) for Red Storm Entertainment Works (worked?) for Red Storm Entertainment.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
File Systems.
Memory Management Chapter 7.
CSE 380 – Computer Game Programming Pathfinding AI
Motion Planning CS 6160, Spring 2010 By Gene Peterson 5/4/2010.
Allocating Memory.
Planning under Uncertainty
Lecture 6: Hybrid Robot Control Gal A. Kaminka Introduction to Robots and Multi-Robot Systems Agents in Physical and Virtual Environments.
Nonholonomic Multibody Mobile Robots: Controllability and Motion Planning in the Presence of Obstacles (1991) Jerome Barraquand Jean-Claude Latombe.
COMP 3221: Microprocessors and Embedded Systems Lectures 27: Virtual Memory - III Lecturer: Hui Wu Session 2, 2005 Modified.
Brent Dingle Marco A. Morales Texas A&M University, Spring 2002
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
CS 104 Introduction to Computer Science and Graphics Problems
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Nov 9, 2005 Topic: Caches (contd.)
Route Planning Vehicle navigation systems, Dijkstra’s algorithm, bidirectional search, transit-node routing.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Fuzzy control of a mobile robot Implementation using a MATLAB-based rapid prototyping system.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Computational Stochastic Optimization: Bridging communities October 25, 2012 Warren Powell CASTLE Laboratory Princeton University
Teaching Deliberative Navigation Using the LEGO RCX and Standard LEGO Components Gary R. Mayer, Dr. Jerry Weinberg, Dr. Xudong Yu
Geography and CS Philip Chan. How do I get there? Navigation Which web sites can give you turn-by-turn directions?
Robotica Lecture 3. 2 Robot Control Robot control is the mean by which the sensing and action of a robot are coordinated The infinitely many possible.
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
Department of Electrical Engineering, Southern Taiwan University Robotic Interaction Learning Lab 1 The optimization of the application of fuzzy ant colony.
IT253: Computer Organization
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.
10/18: Lecture topics Memory Hierarchy –Why it works: Locality –Levels in the hierarchy Cache access –Mapping strategies Cache performance Replacement.
Motion Planning in Games Mark Overmars Utrecht University.
2.3 – Path Look-Up Tables Owen Cummings. William van der Sterren  Company CGF-AI specializes in tactical AI for 3D virtual worlds: autonomous AI squads.
Games Development 2 Entity Update & Rendering CO3301 Week 2, Part 1.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 25 –Robotics Thursday –Robotics continued Home Work due next Tuesday –Ch. 13:
Wouter G. van Toll Atlas F. Cook IV Roland Geraerts Realistic Crowd Simulation with Density-Based Path Planning ICT.OPEN / ASCI October 22nd, 2012.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
CSCE 552 Spring 2010 AI (III) By Jijun Tang. A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Review IMGD Engine Architecture Types Broadly, what are the two architecture types discussed for game engines? What are the differences?
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
CMPT 438 Algorithms.
Chapter 5.4 Artificial Intelligence: Pathfinding
All-pairs Shortest paths Transitive Closure
Memory Management.
The Underlying Technologies
CS b659: Intelligent Robotics
File System Implementation
ECE 448 Lecture 4: Search Intro
Problem Solving by Searching
Chapter 15 QUERY EXECUTION.
CS 31006: Computer Networks – The Routers
CSCI1600: Embedded and Real Time Software
Optimizing Malloc and Free
Dynamic Programming.
CIS 488/588 Bruce R. Maxim UM-Dearborn
CIS 488/588 Bruce R. Maxim UM-Dearborn
Virtual Memory Hardware
Robot Intelligence Kevin Warwick.
Market-based Dynamic Task Allocation in Mobile Surveillance Systems
CS 416 Artificial Intelligence
Operating Systems: Internals and Design Principles, 6/E
CSCI1600: Embedded and Real Time Software
Chapter 8 & 9 Main Memory and Virtual Memory
Presentation transcript:

Path Look-up Tables & An Overview of Navigation Systems Hai Hoang 10/4/2004

Path Look-up Tables (2.3) ► Outline:  Why Use Look-up Tables?  3 types of look-up tables ► Path look-up matrix ► Indexed path look-up matrix ► Area-based look-up table  Design and Performance of each

Why Use Path-Look Up Tables? ► A* is a popular path search algorithm, but slow. ► Fastest way to find a path  NOT to search  but to look up a path from a precomputed table ► Free up the CPU for other AI decisions ► How much faster?  10 to 200 times faster, depending on implementation and terrain ► A* Explorer demo 

1 st Type of Path Look-Up Table ► Using a matrix  For N waypoints, the matrix size is N x N  Each cell stores ► The next neighboring waypoint to visit on the path ► Or the “no path available” marker  To look up path from a to b ► Retrieve next neighbor n 0 for (a, b) ► Followed by next neighbor n 1 for (n 0, b) ► Repeat until n i = b

Path Look-Up Matrix Example

Benefits ► Fast path retrieval ► Predictable path ► Low CPU consumption ► Path retrieval performance is not influenced by terrain layout  Unlike A* - as efficiently with deserted plains as with 3D mazes

Problems ► Hug memory consumption  Increases quadratically with the number of waypoints  Typically, each entry is 2 bytes ► For 1,000 waypoints – 2MB ► For 2,000 waypoints – 8MB ► Contains only static representation of terrain  Can only reflect changes via an update or patch  O(n 3 ) to update

2 nd Type of Path Look-Up Table ► Using an Indexed Path Look-up Matrix  Reduce memory consumption by factor of 4 by: ► using 1 matrix to store an index, ► another to store the outgoing waypoints ► Replace the 2 bytes “next waypoint to visit” with a 4-bit index into the waypoint list of outgoing waypoints ► Assumption:  Reduce the waypoint graph so each waypoint use a maximum of only 15 outgoing waypoints ► By trimming away outgoing waypoints best approximated by another link or via a shorter path

Example of Indexed Look-Up Table

Example of Indexed Look-Up Table(cont.)

Memory Consumption ► Memory consumed for the 4 bit index look- up matrix is:  N x N x.5 (.5 byte is 4 bits) ► For the 15 outgoing waypoints look-up matrix:  N x 15 x 2 ► For 1,000 waypoints: 542 kb ► For 2,000 waypoints: 4 MB

Benefits and Problems ► Benefits: ► 4 times a much terrain for the same amount of memory as regular path-look up matrix ► Only about 5% reduction in performance ► 2 to 5 times better than area-based matrix ► Problem: ► Hard to update for terrain changes ► Still grows very fast

3 rd Type of Path Look-Up Table ► Using Area-Based look-up matrix  Divide terrain up into areas  Move from area to area using portals  Path look-up is performed on two levels

Designing Portal Path Table

Look-Up at Top Level (pseudo-code) ► if (A==B) then both waypoints in the same area, just look in the area table ► If (A!=B) - 2 different areas  Retrieve portal for area A, call it Pa ► Stores the path from a to Pa in path[]  Retrieve portal for area B, call it Pb  Find the shortest path from Pa to Pb  From Pa to Pb, there might be portals in between ► If there is, find path from Pa to Pi ► Translate the portal path into waypoints moves and add to path[] ► until Pi == Pb  Finally, add path from Pb to b to path[] Problem: to move from a (in area A) to b (in area B)

In Area Look-Up

Benefits over Matrix & Indexed Look-up Table ► Using many smaller tables, 1 for portals paths, several for the path with in each area.  Save lots of memory, especially for larger numbers of waypoints  Since look-up tables are quadratic,  a 2 + b 2 < (a + b) 2 ► uitable for patching to reflect changes in the terrain ► More suitable for patching to reflect changes in the terrain  Can open or close portals  Patch an area

Problems? ► Memory consumption depends on the quality of the area and the size of areas interconnection ► And the reason: open areas  More memory if not partitioned well  Larger area interconnections – needs more portals  Could be harder to patch

Memory Consumption & Performance Relative to A*

Area-Based Look-Up Table???

Quake 3 Arena ► Used a technique similar to area look-up table ► Map is divided into convex hulls called areas  Minimal navigation complexity, such as walk or swim  Maps with 5000 or more areas are common.  Moving from one area to another depends on reachability  Quake uses a real-time dynamic routing algorithm  The routing data is caches for fast look-up  The idea of portals are used for teleporting between areas

Does it make you wonder? ► How graphics are rendered fast enough. ► Handle multi-players – added delay ► CPU Time left for AI for bots ► “If you're a fan of Quake like I am, you're surely aware that your computer is not able to render that entire 3D, shadowed, textured world at 30 frames a second. But for some reason, it appears to.” Alex Zavatone ► Video from: 

Fast graphics??? ► What it is doing is taking data from a prerendered world and turning that into a textured, shadowed realistic looking environment. That's possible because the information has already been calculated and is stored in some sort of look up tables. “ Alex Zavatone

An Overview of Navigation Systems (2.4)

Navigation System ► A Navigation System is a separate component responsible for synthesizing movement behaviors. ► By encapsulating navigation into a component, it’s simpler to craft behaviors and movements. ► Purpose is to provide modularity in AI programming.

3 Levels of Abstraction ► Planner:  Only the shortest path algorithm abstracted and implemented in the navigation system  The agent has to make the request and interpret the result. ► Pathfinder:  The pathfinder would deal with the execution of the plans  The agent still has direct control of the paths ► Sub-architecture:  Planning abilities and composing different movement behaviors

Navigation Interfaces ► Allows agent to send information to the navigation system ► When designing the interface the programmer must decide between a focused or flexible interface ► Existing paradigms for navigation interfaces (starting with the most focused)  Single pair: Two points are specified, the shortest path is returned.  Weighted destinations: Can have multiple destinations, each with its own reward coefficient.  Spatial desires: Specifying the movement by passing the motivation from the agent to the navigation system (e.g. get armor or get weapon)

AI Paradigms for Movement ► Reactive Behaviors ► Deliberative Planning ► Hybrid Systems

AI Paradigms for Movement ► Reactive Behaviors (reactive steering):  Takes sensory input and performs a direct mapping to determine output  Example: takes in local info about obstacles and outputs commands as to where to move  Possible behaviors include obstacles avoidance, seeking, and fleeing.  Cannot handle traps,complex layout, intricate scenarios, and human-level movement with these behaviors

AI Paradigms for Movement (cont) ► Deliberative Planning:  Reactive behaviors can’t handle traps,complex layout, intricate scenarios, and human-level movement  Planning can formulate suitable paths in the world before used to solve these problems  Plans are made according to the terrain representation

AI Paradigms for Movement (cont) ► Hybrid Systems:  Simple obstacles can be handled by reactive behaviors, no need to waste a lot of time on finding paths that could be handled straightforwardly  Planned is need to optimized between speed or quality of movement  Solution is to use both paradigms

Implementing Reactive Behavior ► Simplest technique is steering behaviors  Using mathematical equations to decide where to steer next  Problem with: ► Integration of multiple behaviors  Fixed by prioritize behaviors ► Realism  Fuzzy logic – blend the behaviors together to make it look more realistic

Implementing Deliberate Planning ► Planning doesn’t necessary mean search  Precompute everything  Use reactive approximation to build near optimal path  Use threshold to trigger replan  Use D* to research the tree from A*  Use quality of service algorithm

Conclusion ► Choose the right navigation architecture is important  Improve quality of the behaviors  Increase performance  Make it easier for Agent to integrate with your navigation system

Examples of Navigation Systems ► PathEngine  ► BioGraphic Technologies AI.implant 

D* Algorithm

D* Simplified ► S = Start state ► G = Goal state ► X = Current state ► M = Current map ► 1) Store all known, approximate, estimated, and believed information about the environment in M ► 2) Let X = S

D* Simplified (cont.) ► 3) Plan an optimal path from X to G using M -terminate with failure if no path found ► 4) Follow path found in 3 until find G or find discrepancy in M and the environment ► 5) Update M to include new sensor info, then go to 3 to replan

References ► Game AI Programming Wisdom 2, Steve Rabin, 2004 ► The Quake III Arena Bot, J. P. v. Waveren  MSc.html MSc.html MSc.html ► Map-Based Strategies for Robot Navigation in Unknown Environments, Anthony Stentz  ► A* Explorer demo  ►