Game Development Reference
In-Depth Information
Figure 18.4
Pathing graph for Rat Race.
grid-like fashion. Place a few nodes around a turn to create a curve instead of simply
placing the corner node with two perpendicular arcs. I like to make a little Y-shaped
triangle of nodes and arcs near such corners.
The second thing you can do is allow each node to have a tolerance that describes
how close the agent has to be to the node in order to be considered to have hit it.
Using these two techniques together, you can get a much smoother path. If you really
want to go for broke, you can do a little prediction and figure out when to start turn-
ing and how sharply you need to turn. This will give your agents a very smooth
curve, though perhaps it will be too smooth in some instances. For example, when
someone is near a wall and turns a corner, there is very little curve. Another alterna-
tive would be to add that information into the node classes, but this may be a bit
much to ask of designers (who typically create and tweak these graphs). I ' ve found
that you can get pretty decent results with the first two methods.
Now you need to describe the arc that connects these nodes. You could make arcs
unidirectional, bidirectional, or both. You could give each arc a weight that gives a
rough description of the difficulty for traversing that area. You could even allow mul-
tiple arcs to connect the same nodes but have different weights on those arcs for dif-
ferent types of agents. For example, you could have one arc used by ground-based
Search WWH ::




Custom Search