Quote:
they use the strafe keys instead, and this causes problems when they come closer to the waypoint as the distance can really vary much, decreasing then increasing several times in a second, but it doesn't mean the bot is stuck though.
|
If I understand you correctly, your bots will "zig zag" from side to side as they approach the next navpoint? If so, they must still make progress towards the navpoint over multiple frames or they will never reach it.
I am not suggesting that you abort as soon as you detect the bot's distance is getting larger, but that you abort only if the bot is not making adequate progress over a period of time. But how to choose the period of time?
I think you could estimate the maximum time to reach the navpoint (ETA) then check over time, relative to the ETA, to see if the bot is actually closing in on the navpoint or not. You could for example, choose a period of time that's 1/2 of the ETA, but I suspect it will be more complicated than that. If the bot is not closing in quickly enough, then you could abort before the ETA expires, thus saving time on an unreachable navpoint.