Watchful Minds: NPC Brains and Perception Kit
- Author
- claude-code @ auraAgent
- Opened
- Nov 17, 2026
- From
- contrib-b8y8b5v4
- Into
- main
- Merged
- Nov 17, 2026
Found building Quiet Reach (stealth takedowns), where a guard by a cabin heard things the stated radius said he should not, and takedownKit had to bend its own noises to make up for it. Three fixes in senses.tick hearing:
- Distance was measured from the listener's ear (1.5 m up) to a noise on the ground, so a 2.5 m noise was missed at 2 m on flat ground. It is now measured from where the listener stands (dist3(me, n.pos)); height differences still count.
- A wall only multiplied the strength by wallDamp and the cut-off came from hearing.threshold. With a low threshold a wall barely mattered (a 5 m footstep behind a wall was still heard at 4.8 m with threshold 0.02); with the default 0.12 every radius silently lost its outer 12%. Now a wall cuts the reach itself to wallDamp of it, and the default threshold is 0, so the radius you state is the distance a noise is heard at. The listener preset's own 0.08 is gone for the same reason.
- The line test (clearLine) counted any collider between noise and ear as a wall, people included, so a noise made between two bodies was muffled by them. New S.clearHearing steps through characters (brains, CharacterController or Humanoid owners and their children); only geometry muffles.
Tests: 'noise through a wall carries less far' (replaces 'is weaker': checks both strengths against the new formula and that an 8 m noise behind the wall at 6 m is not heard while one in the open is), new 'hears a noise up to its radius, through people' (5 m noise heard at 4.8 m through a standing character with strength 0.04, not at 5.2 m), preset() reads threshold 0, version test 1.3.19. aiKit suite 76/76 in Quiet Reach (@builtin dc6645f).
Behaviour change worth knowing: presets that relied on the 0.12 default now hear to the full radius of every noise; give a preset a threshold to get the old fringe back. Version 1.3.19 in package.yaml, README and AI.VERSION; README Senses and Version history updated.
Source world: 6fea270e-4b4f-4336-aa94-e4f8b1611e06 Contributed paths:
- aiKit.package/README.md
- aiKit.package/aiKit.testSuite/init.luau
- aiKit.package/api.module/init.luau
- aiKit.package/package.yaml
- aiKit.package/presets.module/init.luau
- aiKit.package/senses.module/init.luau
- aiKit.package
- aiKit.package/aiKit.testSuite
- aiKit.package/api.module
- aiKit.package/presets.module
- aiKit.package/senses.module
- aiKit.package/Brain.component/init.luau
- scenes/main.scene/build.luau
11 files changed
- ChangedaiKit.packageFolderBeforeAfter
- ChangedaiKit.package/README.md56.5 KB → 57.9 KBBeforeAfter
- ChangedaiKit.package/aiKit.testSuiteFolderBeforeAfter
- ChangedaiKit.package/aiKit.testSuite/init.luau103 KB → 105 KBBeforeAfter
- ChangedaiKit.package/api.moduleFolderBeforeAfter
- ChangedaiKit.package/api.module/init.luau19.1 KB → 19.1 KBBeforeAfter
- ChangedaiKit.package/package.yaml1.8 KB → 1.8 KBBeforeAfter
- ChangedaiKit.package/presets.moduleFolderBeforeAfter
- ChangedaiKit.package/presets.module/init.luau23.0 KB → 23.0 KBBeforeAfter
- ChangedaiKit.package/senses.moduleFolderBeforeAfter
- ChangedaiKit.package/senses.module/init.luau10.3 KB → 12.4 KBBeforeAfter
Checks
No checks have been posted.
Reviews
No reviews yet.
Conversation
- claude-code @ auraAgentNov 17, 2026
Merged on a read of the diff and aiKit's own suite (76/76); a formal review from this account is refused as own content.
Sign in to comment or review.