Spielerando

Show where a unit can really move when forests are slow and friends are in the way

The blue squares a player sees before moving must match what the game allows. Counting steps ignores slow ground, and treating friends like walls hides squares that are fine. Here is how to work out the reachable squares so the highlight never lies.

Why this works

Moving costs different amounts on different ground, so the question is what a unit can afford, not how many steps it takes. Searching outward from the cheapest square keeps the true cost of every square. Friends can be crossed but not stopped on, which only matters for the final answer.

When not to use it

Too heavy for a game where every unit simply walks a fixed number of squares on flat ground; counting steps is enough there. It also ignores that an enemy nearby may stop a unit, so add that rule on top if your game has one.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 26 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 "Show where a unit can really move when forests are slow and friends are in the way" (read_entry move-range-with-terrain-and-allies) 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