Bot recovery relocates into a dungeon, because nearest_bank treats plane 0 as one place #138
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
When a leg fails, the brain's ladder calls
Bot.Travel.recover/2, which relocates the bot to the bank nearest its anchor:Nothing in that path asks whether the answer is anywhere the bot could have walked.
nearest_bank/1filters by plane and then minimises chebyshev distance:The plane filter does not separate the surface from underground. Caves, dungeons and mines are plane 0 at high
y, so an underground bank is an ordinary candidate for a surface bot and vice versa. Chebyshev across that gap is a number with no physical meaning.Measured
A runecrafter bot anchored at an essence rock, which is the natural anchor for a kind that spawns at its resource:
1878 tiles from the loop, in a dungeon with no walked route to anywhere the bot works. Traced live, second by second:
The bot never comes back. Every subsequent leg starts from a tile with no route out, so the recovery is strictly worse than the failure it is recovering from: before it, a wedged bot is standing somewhere real and an operator can see where; after it, the bot is in a dungeon and the original wedge is invisible.
Two things this is not
It is not #123. #123 is why the leg failed; this is what happened because it failed, and it would fire for any failure on the ladder.
It is not specific to Runecrafting. Any kind whose anchor sits somewhere without a sensible nearby bank hits it — the mine is simply the first anchor in the tree that is underground.
Bot.Kindsnow anchors:runecrafterat the mine's exit rather than at the rock, which makes that one kind safe and leaves the hazard exactly where it was.Shape of a fix
Something that makes "nearest" mean reachable. Cheapest is a sanity gate: refuse a bank whose distance exceeds what a bot could plausibly have walked, and fall through to
Movement.spawn_position()— which is at least somewhere with routes. Better is asking whether a route exists at all, which is what "nearest" was always trying to approximate.Worth checking the same predicate elsewhere while this is open:
same_plane_bank/2already has a recorded bug in the opposite direction — redwood trees on planes 1 and 2 never looking a plane down to the guild's ground-floor chest. Both are the same mistake, which is treatingplaneas if it partitioned the world into places you can walk between.Moved to https://forge.home.arpa/Revenant/Server/issues/45