Keep the map you have seen dimmed while only what your units see right now is bright
A fogged map has three kinds of squares: never seen, seen before, and seen right now. Games get this wrong by hiding places again when the unit walks on or by showing a ragged circle. Here is the update that keeps the three apart and the circle clean.
Why this works
Seen before and seen right now are different facts, so each square needs its own level for each. Dropping everything to remembered first and only then lighting what is in sight lets the player keep the map they uncovered while the bright area follows their units.
When not to use it
Not enough when walls should block sight, because this lights everything within reach, even behind a wall. Add a line-of-sight test. It is also unneeded in games where the whole map is always visible, or where memory of old positions would be cheating.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 5 common mistakes and the fix
- 18 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 "Keep the map you have seen dimmed while only what your units see right now is bright" (read_entry fog-of-war-explored-vs-visible) 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