Abstract
Pathfinding has been one of the major research areas in video games for many years. It is a key problem that most video games are confronted with. Search algorithms such as Dijkstra's algorithm and A* algorithm represent only half of the picture; the underlying map representations, such as regular grids, visibility graphs, and navigation meshes, also have a significant impact on performance. This paper reviews current widely used solutions for pathfinding and proposes a new method, Direction Oriented Pathfinding (DOP), which is expected to generate a higher quality path using less time and memory than existing solutions. The deployment of methodology and techniques is described in detail, and the significance of the proposed method for future video games is addressed.
Introduction: The Pathfinding Dilemma
Pathfinding is a cornerstone of game AI, but it faces a constant tug-of-war between solution quality and computational cost. Traditional methods like A* on regular grids are easy to implement but scale poorly in large, complex 3D worlds. As environments grow, the number of nodes to be expanded increases significantly, leading to high CPU and memory overhead.
While visibility graphs offer shorter paths, they suffer from $O(n^2)$ generation complexity and can become cluttered in open areas. Navigation Meshes (NavMeshes) have emerged as a superior alternative, representing walkable surfaces as convex polygons. However, most efficient path-smoothing algorithms—like the Funnel Algorithm—are strictly limited to triangle-based meshes. While n-sided polygon meshes are easier to generate and require less memory, finding the mathematically shortest path across them is non-trivial. Current solutions often rely on "string-pulling" post-processing, which is computationally expensive and doesn't always yield the global optimum.
Methodology: Direction Oriented Pathfinding (DOP)
This paper proposes Direction Oriented Pathfinding (DOP), a novel approach designed to find the shortest path on NavMeshes composed of n-sided convex polygons. By integrating path smoothing directly into the search process rather than treating it as a post-processing step, DOP aims to reduce overhead while improving path quality.
The DOP framework breaks the problem into three distinct phases:
- Mesh Generation: Creating an n-sided-poly-based NavMesh. This is more memory-efficient than a triangle-only mesh because it uses fewer polygons to represent the same area, reducing the total number of nodes in the navigation graph.
- Channel Finding: Using the A* algorithm to identify the "shortest channel"—a sequence of adjacent polygons that the character must traverse to reach the goal. In this stage, each polygon is treated as a node in a weighted graph.
- Path Refinement (The DOP Core): Instead of using standard string-pulling, DOP utilizes a variant of the funnel algorithm adapted for n-sided polygons. This allows the algorithm to calculate the shortest path inside the identified channel in linear time, effectively merging the search and smoothing phases.
Experimental Setup and Evaluation
The paper utilizes Unity3D as an experimental testbed. The authors leverage the "A* Pathfinding Project" (a common Unity plugin) to provide a baseline for comparison. The proposed evaluation plan includes testing across three types of generated environments: indoor environments, expansive outdoor environments, and randomly generated environments.
A major insight of this research is that representation is half the battle. By moving beyond triangles to n-sided convex polygons, DOP treats path smoothness as a primary objective of the search, not an afterthought. This is expected to consistently find the shortest path within a channel, avoiding the "abrupt twists and turns" common in center-point or edge-point navigation.
Limitations and Future Work
Like the original funnel algorithm, DOP relies on the polygons remaining convex. If a NavMesh generation tool produces concave polygons, the logic fails. Furthermore, the paper primarily addresses static pathfinding. Adapting DOP for highly dynamic environments where the NavMesh must be updated in real-time remains a challenge. Future work will focus on formalizing edge-case handling for complex polygon intersections and testing the algorithm as a "Mod" for commercial games like Civilization V or SimCity 4 to provide more realistic traffic and unit movement.
Conclusion
Direction Oriented Pathfinding represents a significant step toward more efficient and realistic AI movement in video games. By optimizing the underlying map representation and merging the search and smoothing phases, DOP offers a promising alternative to traditional grid and triangle-mesh based systems, potentially setting a new standard for high-performance pathfinding in complex 3D environments.
Summary updated