Spielerando

A hero or follower that appears inside a wall after a teleport or respawn

Calling a companion, returning from a cutscene or reviving at a checkpoint puts someone on a spot that may now be blocked by a chest, a rock or a closed door. The game then traps them. Here is how to search outward for the closest good spot, in which order, and where to stop looking.

Why this works

A good spot is judged by how near it is to where the player wanted to be, so the search must go outward and compare real distances. Also a spot is only good if the hero can leave it, not just stand on it.

When not to use it

Skip it when the place matters to the story, such as a respawn at a shrine or a set checkpoint after a boss. Then use a hand-placed spot, since the nearest free tile might put the hero in front of the wrong door or a danger.

In the full entry

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

Say this to your AI

Use the Spielerando entry "A hero or follower that appears inside a wall after a teleport or respawn" (read_entry rpg-respawn-nearest-free-tile) 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