Abstract
Finding the Euclidean Shortest Path (ESP) in 2D environments typically involves a trade-off between preprocessing time and search efficiency. This paper introduces RAYSCAN, a preprocessing-free algorithm that computes exact shortest paths by combining A* search with on-the-fly ray shooting and obstacle perimeter scanning. By avoiding the setup costs associated with visibility graphs or navigation meshes, RAYSCAN provides a robust solution for dynamic environments where obstacles may change frequently.
Introduction
The Euclidean Shortest Path (ESP) problem—finding the shortest route between two points in a plane containing polygonal obstacles—is a cornerstone of robotics and video game pathfinding. Existing approaches generally fall into three categories: any-angle grid techniques (fast but approximate), Visibility Graphs (exact but computationally expensive to pre-calculate), and mesh-based planners like Polyanya (state-of-the-art speed but requiring complex preprocessing and repairs). RAYSCAN addresses the gap for an algorithm that is both optimal and requires zero setup, making it ideal for maps where obstacles are dynamic or queries are infrequent.
The RAYSCAN Algorithm
RAYSCAN operates by driving an A* search through a series of geometric operations designed to build necessary portions of a visibility graph on-the-fly.
Core Operations
- Ray Shooting: From the current node, the algorithm "fires" a ray toward the target. If the ray is unblocked, the shortest path is found. If it strikes an obstacle, that obstacle is flagged for perimeter scanning. The authors utilize a modified Bresenham’s algorithm for this task.
- Perimeter Scanning: Upon hitting an obstacle, RAYSCAN scans its perimeter to identify "turning points"—convex vertices that serve as potential intermediate nodes for the shortest path.
- Projection Fields: To maintain optimality and efficiency, the search is restricted to specific "angled sectors" or projection fields. These fields ensure the algorithm only considers vertices that could realistically contribute to a shortest path, effectively pruning the search space.
Experimental Evaluation
The authors evaluated RAYSCAN using the Moving AI 2D pathfinding benchmarks, which include game maps (e.g., Dragon Age: Origins, StarCraft), synthetic mazes, and real-world city street maps. These diverse environments test the algorithm's performance across varying obstacle densities and corridor complexities.
Key Results and Discussion
The primary comparison was made against Polyanya, a leading mesh-based ESP planner.
- Setup Time: RAYSCAN's initialization is significantly faster. On complex random maps, Polyanya required 6.9 milliseconds for mesh construction, whereas RAYSCAN initialized in just 25 microseconds.
- Search Efficiency: While Polyanya's search is typically 2-3x faster due to its pre-built mesh, RAYSCAN's lack of preprocessing makes it more efficient overall for a limited number of queries.
- The Break-Even Point: The concept of the "break-even point" ($c_{50}$) defines how many searches must be performed on a static map before the preprocessing cost of a mesh-based planner is justified. On standard game maps, this point can range from 78 to over 1,300 searches.
Conclusion
RAYSCAN offers a compelling alternative for ESP computation in dynamic or low-query environments. By performing "lazy" visibility checks and only exploring relevant obstacle perimeters, it achieves optimality without the overhead of traditional preprocessing. Future work will focus on leveraging hardware-accelerated ray tracing to further enhance search speeds and testing the algorithm in truly real-time dynamic scenarios.
Summary updated