fix(bot): stop a gatherer walking past the site it is standing on #125
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/site-choice"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #124.
Bot.Goals.FishandBot.Goals.GatherAndBankboth chose where to work bysorting sites by distance, taking the nearest three and rolling between them.
The roll is right — a fleet that all took the nearest would pile onto one site
— but it weighed a site underfoot the same as one across the world, and gather
sites are sparse enough that the runners-up are routinely hundreds of tiles
off. A fisher spawned on a perfectly good ground walked away from it two times
in three.
Bot.Sites.choose/2is now the one home for that rule, and it drops from theroll any candidate more than 32 tiles further away than the nearest.
Comparable sites still share it. What that removes is the journey chosen for
no reason, which matters beyond the walking: it is exactly the long leg that
straight-line travel is worst at, so the two together turned working bots into
wedged ones.
The site type is deliberately open, because a closed map of one key is not
what any site in that module is.