been brainstorming the ai system for a horror game where a hunter chases you with a bow and arrow. the core idea is that the hunter spawns far away and slowly closes in, but the player doesn't know where it is or what it's doing. the whole thing runs on a cycle: observe, position, decide, act, re-evaluate. that loop never stops, even when you can't see it. the tension comes from not knowing where it is in that cycle.
the state machine needs two layers. overt states are the ones you know about — chase, aim, shoot, reposition. covert states are the scary ones — stalking, ambush, closing. the hunter doesn't just react to you, it has its own agenda. distance acts like a budget with engagement zones: beyond awareness range it's just navigating toward your last known position, in the mid range it commits to an approach vector that might circle to your blind side, at optimal range it picks between ambush or chase depending on whether it has a good position. line of sight isn't a boolean you check every frame, it's acquisition events. when it loses sight of you it doesn't immediately switch to stalking, it moves toward where you were for a beat first, then transitions. that makes it feel like it actually saw you rather than just losing a target.
the bow itself creates interesting constraints. the hunter has to stop moving to draw, which creates a rhythm — chase, find sightline, stop, draw, release. between the stop and the release is the player's survival window. aim duration varies with distance, teaching the player that being far away means more reaction time. arrow aiming has four types: direct shot when there's clear line of sight, leading shot when you're moving across its view, lobbed shot when there are obstacles between you, and zoned shot when it can't get a clean bead so it aims at a chokepoint like a doorway. it picks whichever option has the highest perceived hit chance given current distance, angle, and your velocity. if nothing's good enough it repositions instead of wasting an arrow.
the spawn system is where the horror pacing really lives. the principle is that it should appear where it creates maximum dread, not maximum danger. behind you when you're focused forward, at the edge of peripheral vision, at the far end of a hallway you need to walk down, on elevated ground where it has angular advantage. the spawn should be location-aware, picking from candidates based on whether it can get line of sight, whether it has cover to approach from, whether it's in your likely direction of movement. and underneath all of this there should be a pacing director — after a tense encounter it eases off for thirty to sixty seconds, if you're doing well it escalates with shorter aim times and more aggressive repositioning, if you're struggling it backs off slightly. the goal is sustained tension, not punishment.