Obstacle Avoidance Algorithm

Attempt at implementing obstacle avoidance using raycasting in a 3 steps process;

  1. Bezier algorithm guided curve movement using pure timer along pre-calculated path, regardless of obstacles.
  2. Every so often, raycasts are used to determine actual terrain obstacle in front of the unit. If an obstacle is detected, a preferred path is calculated regardless of the Bezier curve result.
  3. Using both algorithms, the unit will attempt to move along Bezier curve position, while raycasting algorithm will try force it back to a straight-line movement. With a careful alternating between both, an actual movement path is formed.

Obviously…the algorithm work fine only when there is no influent from other units in the same area. Perhaps flocking algorithm could help in that regards.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s