Spielerando

Let bushes and trees hide the player a little at a time instead of all or nothing

A single tree should not make a hunter blind, but a thick forest between two creatures should. Here is how to add up the cover along the line of sight, why the cell where the target stands counts too, and a mistake that skips cells on steep lines.

Why this works

Sight is rarely all or nothing: each obstacle takes a bit of what you can make out. Adding up how much stands in the way, and letting the spot where the target stands count too, gives gradual hiding from one simple rule, with no special cases for each plant.

When not to use it

Do not use it when hiding must be certain and easy to read, as in a puzzle where a wall either blocks the guard or does not. Then give each cell a plain yes or no, so the player can predict the outcome.

In the full entry

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

Say this to your AI

Use the Spielerando entry "Let bushes and trees hide the player a little at a time instead of all or nothing" (read_entry survival-forest-hides-the-player) 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