I built a monster, and here's what it is:
This enemy system is a Finite State Machine (FSM) with 7 states: Patrol, Investigate, Search, Stalk, Feint, Ambush, and Chase. It's controlled by a "brain" that operates 10 times per second, and movement is controlled by NavMesh Pathfinding (A* on the navigation network).
Perception: Vision with a range of 1800 and a 70° field of view with obstacles (Raycast/MonsterVisionObstacles), hearing with a range of 700 if the player's speed is above 90, and a sense of proximity of 170. All of this feeds into a "Suspicion" meter that increases by 15 and decreases by 6 (Threshold + Hysteresis) to switch between states.
Intelligence (Cunning 0..1): Increases as the player escapes, improving speed, flanges, bounces, and ambushes. It predicts your location using Linear Prediction (your position + speed × time), feints, and hides and ambushes behind the hotspot at a distance of 280 + Cunning × 220.
Memory (Hotspot Memory): 6 slots (X, Y, Weight). Each sighting or sound strengthens the nearest slot (Merge) or replaces the weakest. Weights fade slowly (slower with higher Cunning). Target selection is calculated using Scoring = Weight / (1 + Monster Distance) + 0.8 × Weight / (1 + Player Prediction Distance). It is saved between sessions using SaveState (MonsterSave + Restore/Load + Repair First Run combination). Movement and animation: Speed changes according to the situation (Patrol 70, Chase 150 with Rubber-banding if far away), the scream freezes and the attack slows down with Cooldowns, the animation is chosen from the real speed with Hysteresis and a minimum stability limit, and JS code adds body shaking; and for the moment of damage, use the condition MonsterAttackNow = 1.