five-on-it / packages/ai/src/perception
packages/ai/src/perception
What an NPC perceives: sight (a cone around its facing, within its range, with a ray through the physics world so walls and cars hide people, the same way a shot is traced), hearing (the shots and blasts of the last tick within its range), and being hit (a hit event on the NPC or its car names the shooter). A target is a living character that is not hidden behind cover; a seated one is seen through its car.