Stop monsters from appearing in front of the player and vanishing again
If creatures appear and disappear at the same distance, those standing at the edge blink on and off every few steps. And if they appear inside the visible area, the player sees them pop in. This entry gives the AI a check on the three distances and the rule that uses them.
Why this works
What a player notices is a change inside their sight, so things must arrive and leave outside it. Giving arriving and leaving different distances, with a gap between, means nothing is made and unmade at the same line, which is where the blinking comes from.
When not to use it
Distance alone is the wrong measure where sight is blocked or very short, such as in dark caves, dense fog or behind walls. There, base the rule on what can really be seen, or fade creatures in and out so the change is gentle.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 22 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 "Stop monsters from appearing in front of the player and vanishing again" (read_entry creatures-popping-in-and-out-of-view) 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