Finding A Pathfinder: Bjørn Reese Bryan Stout
Finding A Pathfinder: Bjørn Reese Bryan Stout
Finding A Pathfinder: Bjørn Reese Bryan Stout
69
Finding a Pathfinder
Abstract Planning
The success of a given pathfinding technique for a Not every game is suited for planned navigation. Often
computer game depends on the requirements and it is sufficient to use a set of simple behavioral or re-
the assumptions of the game and the constraints active rules, and rely on those to perform spatial move-
it imposes. This paper presents a classification ment, collision avoidance, and other navigational re-
of the factors that influences the performance of quirements.
pathfinding techniques. This includes the dyna- On the other hand, not every game can be satisfac-
mics of the game, the geometry of the players and
tory handled by such rules. Using reactive rules to na-
the environment, the (un)predictability of move-
ment, kinematic and temporal restrictions, inter- vigate through a maze most often yields exceptionally
action rules, and real-time performance. The pur- bad results. Rule-based navigation is restricted by the
pose of this classification is the help developers lack of global knowledge, which results in paths of poor
identify the complexity of the task before choos- quality, or even getting caught in traps it cannot escape
ing a certain approach. (local minima.)
Sometimes the player has an objective rather than
Introduction a geometric destination. One example is the Pursuit-
Evade game, where the objective of the evader is to
Choosing a pathfinding techniques that performs well stay away from the pursuer. Another example is to
is important to the success of artificial intelligence in maintain visibility with another player. In such cases
computer games, because pathfinding is a fundamen- planned navigation is not advantageous.
tal building-block for the field of Artificial Intelligence.
There are a wide variety of pathfinding techniques, and
one technique may excel under certain circumstances,
Dynamics
but do badly under others. The success of a given ap- Some parts of the environment may be able to change
proach depends on the requirements and assumptions during the game. It is convenient to categorize these
of the game. The purpose of this paper is not to offer according to the origin of the change.
solutions, but to raise awareness about the most com- • Static environment: Navigation is rather easy
mon factors that influences the efficiency of pathfinding because the environment is predictable. There al-
techniques. The more factors that the developer in- ready exist a huge number of solutions to this case
tends to incorporate into the game, the more complex (Latombe 1991).
the pathfinding becomes.
• Movable players and static obstacles: The pres-
Path Type ence of other movable players needs to be handled
Pathfinding is usually associated with finding the short- dynamically, because their future paths are unknown.
est path, but there are other possibilities, which may Although their instantaneous direction and speed are
have to be solved differently. These include finding any known, their future movement cannot be predicted.
path, finding a path with maximum coverage of an area Fortunately it is often possible to disregard them
(Emmanuel, Fagegaltier, and Liegéois 1994), finding a while planning a path, and handle them locally as
path with minimal exposure (Hoff, Howard, and Tseng they are encountered while traversing the path.
1995), and finding the set of paths with the maximum • Moving obstacles: If the obstacles can be relo-
capacity to get as many units as possible to the desti- cated then we cannot pre-calculate the entire path.
nation (Ahuja, Magnanti, and Orlin 1993). It is computationally expensive to re-plan each time
Proceedings of the AAAI 99 Spring Symposium on Artificial Intelligence and Computer Games. 70
a corridor that is too narrow. They have to coordi- • Sensitivity: The path only has to be re-planned if
nate their movement to prevent blocking each others the changes will result in a new path. Each part of
path. Such deadlocks can either be solved by prede- the path can have an associated sensitivity (Booth
termined traffic rules, or by negotiations between the and Westbrook 1992), which determine how big the
players. Another example is moving in a formation. change must be before re-planning.
• Urgency: There may be explicit or inherent tempo- • Relaxed Updating: If the discrepancies introduced
ral constraints in the game. Objectives can become by the changes does not lead to unacceptable results,
unimportant if they are not obtained within a certain then the workload can be spread out over time, by
deadline. For example, bridges may burn, and food updating a certain part of the data structure in each
may rot. time step. Further changes that happens during the
• Moving Target: The destination may move con- relaxed updating are delayed until the effects of the
tinuously or abruptly during the search, which may first change have been calculated. This is equivalent
require re-planning of the path. to Relaxed Balancing (Larsen 1998).
• Learning: Building a robust learning technique is a • Partial Updating: The data structure may allow
difficult task. It often takes a long time to teach a changes while we already are in the process of up-
player, so it is often done during development, and dating previous changes. This can be combined with
the learned behaviour does not change during the relaxed updating.
game. Learning in path planning is usually reduced
to building a map. Conclusion
This paper has articulated various factors that influ-
Improving Performance ences the complexity, and hence the performance, of
pathfinding. These factors have been catagorized ac-
Changes to the environment can be handled more effi-
cording to issues such as the type of the path, the
ciently if they are anticipated.
soundness for planning, the dynamics of the game,
Re-planning the geometry of the environment and the players, the
(un)certainty of information, and various other factors.
If the environment changes or new information be- The classification is not exhaustive, and there is some
comes available, it may be necessary to re-evaluate the overlap between certain of the described factors. The
planned path. There are several approaches: overlap was allowed to make a classification that would
• Path Re-calculation: We can discard all previ- map more directly unto the problem-domain, rather
ously calculated paths, and start again from scratch than an orthogonal classification which was abstracted
with the newly available information. This is robust to obscurity.
method, but it is computationally expensive.
• Path Adjustment: We can skip the part of the References
path which passes through the area where the infor- Ahuja, Ravindra K.; Magnanti, Thomas L.; and Or-
mation has been updated. Then we can try to find lin, James B. 1993. Network Flows. Theory, algo-
a new path between the parts of the original path, rithms, and applications. Englewood Cliffs, New Jer-
or the start and the destination if they are closer. sey: Prentice Hall.
This method requires less computational resources, Basch, Julian; Guibas, Leonidas J.; and Hershberger,
but optimality is no longer guaranteed. John, 1997. Data Structures for Mobile Data. In the
• Path Granularity: We can reduce the level of detail 8th Symposium on Discrete Algorithms, 747-756.
of the planned path the further away we are from http://graphics.stanford.edu/~jbasch/publica
our current position. Close to our position we make tions/kinetic/bgh-dsmd-98.ps.gz
a fine grained plan, and the granularity of the path Ben-Shahar, Ohad and Rivlin, Ehud, 1995. To Push or
decreases the further away we get. This way we do Not to Push - Part I: On the Rearrangement of Mov-
not waste too much computational resources on parts able Objects by a Mobile Robot. Technical Report,
which are far away (and more likely to change.) CIS9516, Computer Science Department, Technion,
• Path Redundancy: We can expect failures to occur Haifa, Israel.
and plan with redundancy, ie. have alternative paths http://www.cs.technion.ac.il/users/biham/cgi
in reserve. This requires more memory and more -binw/tr-get.cgi/1995/CIS/CIS9516.ps
computational resources when the path is planned. Booth, Heather and Westbrook, Jeffery, 1992. A Lin-
ear Algorithm for Analysis of Minimum Spanning and
Dynamic Data Structures Shortest Path Trees of Planar Graphs. Technical Re-
Changes to the environment can be handled more ef- port, YALE/DCS/TR-763, Department of Computer
ficiently, if the underlying data structure has been de- Science, Yale University, New Haven, Connecticut.
signed to expect such changes. Even then real-time http://www.cs.yale.edu/HTML/YALE/CS/HyPlans/
responsivity can be further improved. westbrook/sensitivity-planar.ps.Z
Proceedings of the AAAI 99 Spring Symposium on Artificial Intelligence and Computer Games. 72