Hey everyone! I’m building a ghost AI for my maze game and I want it to behave like this
My Ghostai stays still for some reason
- Start in Disguise Mode
Ghost begins in DISGUISE mode at the start of the game.
- Disguise Mode Mechanics
Full maze roaming: Ghost walks naturally through the entire maze at normal humanoid speed.
Corner turning: Turns corners realistically, like a human player.
No stalking points: Does not teleport to fixed stalk points in this mode.
No chasing: Ghost does not chase the player while disguised.
Off screen positioning: Any teleporting for repositioning is never visible to the player.
Follow-too-long kill: If a player follows the ghost for 10–15 seconds, the ghost reveals itself, pauses 2–3 seconds, teleports behind the player, and instantly kills them.
Predictive placement: Ghost predicts player movement so its walking appears natural, without revealing it as a ghost.
- Other Modes
STARE mode: Teleports to a stalk point and freezes if the player looks at it. If the player looks away, it may occasionally chase the player (low chance), otherwise returns to IDLE.
CHASE mode: Only triggers from rare events (like a player looking behind). Moves fast, damages the player on contact, then returns to IDLE after a set time.
IDLE mode: Can randomly teleport in front or behind the player (off-screen), or switch to DISGUISE or STARE mode based on defined probabilities.
- Teleport Rules
Teleports behind or in front without being obvious.
In DISGUISE mode, teleporting is only for off-screen repositioning, never visible.
- State Transitions
Each mode lasts a random duration within a defined range.
Ghost should naturally change modes over time, not constantly chase.
CHASE probability should be low (0.1–0.2). DISGUISE should occur occasionally, STARE sometimes.
- Movement & Appearance
In DISGUISE: human speed, natural turns, no sudden appearance.
When revealing itself for a kill, pause briefly, teleport behind, then attack.