Spielerando

Move a hero who loads inside a wall to the nearest place they can walk from

After a map change, an old save can put the hero in solid rock or outside the map. Moving them to the closest free square sounds easy, but the closest one may be a closed-off pocket they can never leave. This entry shows how to pick a spot that is truly usable.

Why this works

Closest is not the same as usable. A free square can be sealed off by walls, and putting the hero there traps them quietly. Only squares the player can really walk to from a known good start count, so the rescue never makes things worse than the problem it fixes.

When not to use it

Skip it when the hero can fly, dig or pass through walls, since a wall is no trap then. Also skip it when saves only ever happen at fixed rest points: load the player at that point instead of searching for a nearby square.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 36 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Move a hero who loads inside a wall to the nearest place they can walk from" (read_entry hero-loads-inside-a-wall) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP