Tweaking AStar to find closest location to unreachable destination

Posted by Shivan Dragon on Game Development See other posts from Game Development or by Shivan Dragon
Published on 2012-08-30T13:07:23Z Indexed on 2012/08/30 15:50 UTC
Read the original article Hit count: 297

Filed under:

I've implemented AStar in Java and it works ok for an area with obstacles where the chosen destination is reachable.

However, when the destination is unreachable, the calculated "path" is in no way to the closest location (to the unreachable location) but is instead some random path.

Is there a feasible way to tweak AStar into finding the path to the closest location to an unreachable destination?

© Game Development or respective owner

Related posts about path-finding