Skip to content

five-on-it / packages/ai/src/awareness

packages/ai/src/awareness ​

Awareness (GAME_DESIGN §8): what a watcher of stealth (a guard, a security camera) notices. Sight is a cone and a ray: within its range and its half-angle of where it faces, with nothing between its eye and the target's centre (walls, cars, people hide). A player hidden behind tall cover is not seen at all; one crouching behind low cover is seen only from near (AWARENESS.crouchSight of the range); how well a target is seen falls with the distance, which is how fast a guard's suspicion grows. Hearing is the sounds of the last step, each with the radius it carries: a shot by its weapon's noise, a blast, a light piece knocked loose, a door opened or shut, and a player running nearby; a sound is heard within its radius and the listener's hearing range.

The alert phases are ranked by how alarmed they are, the rank missions compare (ALERT_PHASES); the guard's state machine is sentry.ts, the room's book stealth.ts.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​