Let's say I already have an A* algorithm.
How can I handle the cases when the goal cannot be reached, and still attempt to get there?
For instance on the following example:
Notice the amazing GIMP skills!
The yellow unit needs to reach the green spot, but it's on island and can't actually reach it.
Yet, on a typical RTS, the unit will try to go as close as possible.
My problem is that I don't know how to tell A* that the closest tile to the goal is the square near the sea.
How can I have this partial pathfinding? Is A* still a good choice?