Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What alternatives exist of how an agent can follow the path calculated by a path-finding algorithm?

I've seen that the most easy form is go to one point and when the agent has reached this point, discard it and go to the next point.

I think that this approach has problems when the game has physics with dynamic objects that can block the travel between point A and point B, then the agent is taken from his original trayectory and sometimes go to the last destiny point is not the most natural behavior.

In the literature always I have read that the path is only a suggestion of where the agent has to go, but I don't know how this suggested path must be followed.


share|improve this question
up vote 8 down vote accepted

Path Following
image from

What you're looking for is actually a path following steering behavior. The AI moves to a future point along the path instead of from one point to another. A gray buffer around the path allows the AI to navigate within this region before the AI must steer to stay on the path.

Craig Reynold has an excellent article on how this behavior works and implemented it in the Open Source OpenSteer library

Path Following steering behavior

share|improve this answer
+1 Just to add you can also factor in the obstacle avoidance steering behaviour and combine the behaviours however you like (weighted sum, prioritized dithering, etc) – Ray Dey Mar 7 '11 at 20:39

A lot depends on how movement is handled in your game. If you want your agent to work at avoiding obstacles and such that may occur in real time separate from the original path finding, you may wish to perform a second layer of obstacle avoidance, using the next path node as the "goal".

Methods for doing this are varied, from doing a short range path search to giving the agent "sensors" and having them react to what they notice in their immediate vicinity.

Any method you use will effect it's behavior of course and the recommendations as to what kind would be largely dependent on obstacle density, distance between nodes, and desired agent behavior.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.