awareness
How a guard, sentry or stalker notices players: a sight cone whose reach depends on the light actually on the player (dark_sight in the dark ... sight in good light, less against a crouching player; walls and furniture block it), footsteps heard by gait (running, walking, crouching), noises (game.noise, lures), and a suspicion meter: half full it comes to look (suspicious), full it chases; losing the player it searches where it last knew he was, then gives up and goes back (return). Scripts read self.awareness { state, suspicion, seeing, point, ... } and walk (kits/guard.js); self.alert(position), self.stun(seconds), self.calm(), self.sleep(wake).
In scene text
awareness { fov 1 sight 1 dark_sight 1 }Add it in the Inspector (Add Component), in scene text as above, or ask your AI. Fields you leave out keep their defaults.
Fields 19
| Field | Type | Unit / range | What it does |
|---|---|---|---|
fov | number | deg, 0 … 180 | Half-angle of the sight cone. |
sight | number | m, 0 … 500 | How far it sees a player standing in good light. |
dark_sight | number | m, 0 … 500 | How far it sees a player in the dark. |
light_low | number | 0 … 1 | The player's light (0 black ... 1 bright day) at or below which he counts as in the dark. |
light_high | number | 0 … 1 | The player's light at or above which he counts as fully lit. |
eye_height | number | m, 0 … 20 | Its eyes above its feet. |
rate | number | /s, 0 … 100 | Suspicion per second when it sees the player at best (close and lit); less farther away and darker. |
decay | number | /s, 0 … 100 | Suspicion lost per second while it sees nothing (not while chasing). |
crouch | number | 0 … 1 | Its sight reach against a crouching player, as a share. |
hear_run | number | m, 0 … 500 | How far it hears running footsteps (0: not at all). |
hear_walk | number | m, 0 … 500 | How far it hears walking footsteps. |
hear_crouch | number | m, 0 … 500 | How far it hears crouched footsteps. |
hearing | number | m, 0 … 1000 | How far it hears noises (game.noise, gunshots), within the noise's own loudness. |
suspicious | number | 0 … 1 | Suspicion that makes it come and look. |
search_time | number | s, 0 … 600 | How long it looks around where it lost the player before giving up. |
chase_memory | number | s, 0 … 60 | How long it keeps after a player it just lost sight of. |
give_up | number | s, 0 … 600 | Most time it spends going to look before it searches where it is. |
arrive | number | m, 0.1 … 20 | Close enough to the spot it went to look at. |
ignores_downed | true / false | — | A knocked-down player (stats effect knockdown) isn't noticed. |