Spielerando

Hallucinations switch on and off again and again around one sanity value

The player hovers right at the line between calm and uneasy, and the screen flips back and forth every few seconds. A single cut-off value is the cause. This entry gives each stage a separate way in and way out so the world stops stuttering.

Why this works

A value that wobbles around a single line crosses it over and over. Making it harder to leave a state than to enter it gives the effect some inertia, so small ups and downs no longer cause visible flicker.

When not to use it

Not needed when the value only moves in one direction or changes in big jumps, as with a counter of lost lives. And too wide a gap makes an effect feel stuck, so match it to how fast the value really recovers.

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
  • 31 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Hallucinations switch on and off again and again around one sanity value" (read_entry sanity-effects-flicker-at-threshold) 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