I would like the system to give me a path, that would be “at most XXX long” from the start, and is as close to the target point as possible.
In practice, I think that means using “XPath.calculatePartial”, while utilizing some “early exit” condition for when the path is too long already, above some given constant.
How could I make that work? Seems like a reasonably intuitive request imo, the A* should just exit early when it searches in given max length, but I don’t see something that could help me achieve this.
Yes I understand the difference and the possible “unoptimality”, but in my case I would really just want (1), = get as close to the destination as possible in a given max range.
Sorry for the late response.
In that case I think you might be able to do this by
setting path.calculatePartial = true;
Using an XPath path instance and create a custom path ending condition that says that any point is a valid target if it either has a G score (cost from the start node) above a certain threshold, or it is the actual target. See PathEndingCondition - A* Pathfinding Project for more details.