Spread pollution or happiness across the map without it growing or leaning
A factory should darken the air around it, fading with distance, and a park should do the opposite. Written the obvious way, the effect leans towards the side that is updated first, creeps out of the map edge or multiplies. Here is a spreading rule that stays even and keeps its total.
Why this works
If every square reads from the picture of the previous moment and writes into a fresh one, the order of visiting stops mattering, and the cloud spreads evenly in all directions. Handing out only whole shares, and keeping what cannot leave, means the total stays exactly the same.
When not to use it
Wrong for effects that should travel in a direction or stop at walls, such as wind, smoke in a corridor or noise behind a door; they need their own rules. It is also needlessly slow on a very large map, where only a circle around each source is enough.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 21 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 "Spread pollution or happiness across the map without it growing or leaning" (read_entry grid-influence-spread-conserving) 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