Make a world that wraps around without breaking distances at the seam
In a world where walking far enough east brings you back from the west, a monster just across the seam can look a whole map away, so it never notices you. This entry gives the AI the right way to measure across the seam and to keep positions inside the map.
Why this works
On a world that wraps, the map has no edge, so the shortest way between two points may cross the seam. Measure the shortest way round everywhere positions are compared, or one part of the game will see a neighbour and another will see a far-off stranger.
When not to use it
Do not wrap a world that has a meaning for its edges, such as a map with a real coast, a start and an end, or a story that moves from one side to the other. Use walls or sea there, and keep wrapping for worlds with no special place.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 30 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 "Make a world that wraps around without breaking distances at the seam" (read_entry round-world-seam-distance) 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