Skip to content
← All posts

Blog

How we designed the AI that hunts you

Most players will never read this post. They'll just feel it — the moment the Keeper stops patrolling and starts looking, or the suspicious luck of her appearing exactly where you sprint. Good horror AI is invisible when it works and unforgettable when it doesn't. Here's how we built ours, without spoiling anything the game doesn't already tell you.

The problem with random AI

The laziest way to make a stalker scary is to teleport it randomly around the map. Players hate this, and they're right to.

Randomness produces two failure modes, sometimes in the same minute:

  1. Unfair catches. The threat materializes around a corner you had no way to check. Losing feels arbitrary, so losing feels cheap. Players quit.
  2. Hollow victories. The threat wanders into a room you left minutes ago. Escaping feels meaningless because nothing was ever actually looking for you.

The fix is a principle every good stealth game shares: the threat should always be doing something explicable. Not predictable — explicable. When you get caught in Nightfall House, you should be able to replay the last thirty seconds and point at the exact mistake: the sprint across the hallway, the door you didn't close, the hiding spot you reused. Fear plus comprehension is tension. Fear without comprehension is just noise.

Our patrol / investigate / chase / search state machine

Under the hood, the Keeper runs a four-state loop. Plain-language version:

Patrol. She walks a fixed circuit through the hallway and adjoining rooms, always at the same unhurried pace. While patrolling she can hear you — a short radius if you walk, a much larger one if you sprint — and she can see you if you enter the amber cone in front of her while visible.

Investigate. Heard something? She walks directly to the source of the noise at patrol speed. She doesn't know it was you — she knows only that something happened there. Arrive, find nothing, and she shifts into…

Search. She goes to the last position where she genuinely knew you were — or the noise origin, if that's all she has — and sweeps a randomized pattern around it for a fixed window. This is the state hiding-spot players fear, and should: routine patrols never notice occupied hiding places, but an active search may check them.

Chase. Spotted means spotted. She locks onto your current position and runs faster than her patrol but slower than your sprint. Keep breaking her line of sight for long enough and she gives up on your current position — but not on the area. She searches where she last truly saw you.

A few deliberate details:

If you want the survivor's-eye view of those rules, our survival guide translates each state into tactics.

Balancing challenge vs. frustration (playtesting notes)

Our first playable build was, by telemetry, a war crime: average survival time was under forty seconds and playtesters described the experience as "getting yelled at." Three changes moved survival time past the eight-minute mark without making the game easier:

The deepest lesson: difficulty is a budget, and fairness is the currency. We spend ours on information — the visible vision cone, the audible footsteps, the readable states — so that when the house gets you, the sentence "I knew that was a risk" is always available. Horror lands hardest when the danger is legible. Everything else is jumpscare wallpaper.

Play it now — free in your browser