A building keeps switching between built and abandoned every few seconds
When a value hovers right at a threshold, the state flips back and forth with every tiny change. This entry gives your AI a way to count the flips for different safety margins and pick the smallest margin that calms it down.
Why this works
Using two thresholds instead of one means a state needs a clear push to change and a clear push to change back. The gap between them has to be about as wide as the wobble of the value, so measure the wobble.
When not to use it
Skip it when the state should react instantly, such as an alarm. A flickering alarm is annoying, but a late one is worse.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 24 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 "A building keeps switching between built and abandoned every few seconds" (read_entry strategy-zone-keeps-flipping-state) 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