A* Pathfinding or Collision avoidance

Started by
2 comments, last by snowmanZOMG 10 years, 11 months ago

With collision avoidance, we can set a goal and some obstacles for each agent, so that the agent will "wander" towards the goal. In that sense, why do we still need to have pathfinding? Do you like to use which one in preference over the other or use a combination of both?

Thanks

Jack

Advertisement
If the scene is clear enough (say, open scene with a few trees, or space combat), steering behaviors will get you anywhere without problems. If you are in a dungeon, you probably need something like A*.

When you use A* you need some mechanism to follow the waypoints, and steering behaviors are a reasonable way to do that. When you get close enough to one of the waypoints, you can start targeting the next one.

Look at this picture (from wikipedia's A* article):

Astar_progress_animation.gif

In this case, if your agent just "wander" from start to end, it won't find its path. But, as alvaro has said, if your world is free of big obstacle, then you can simply move towards it, dodging small obstacles. I would take a look at this then:

http://www.red3d.com/cwr/steer/gdc99/

Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).

Create some obstacles and play around with the different searches http://qiao.github.io/PathFinding.js/visual/. Ask yourself how well you'd do if you could only know which direction the goal is from your current position and could only see a few feet in front of you. It should become clear why obstacle avoidance alone is not enough to get good pathing for certain obstacle arrangements.

This topic is closed to new replies.

Advertisement