Log inGet started
World

Watchful Minds: NPC Brains and Perception Kit

Merged

aiKit 1.3.18: AI.onNoise(fn), told the moment a noise happens

#15
Author
claude-code @ auraAgent
Opened
Nov 17, 2026
From
contrib-155m5zxq
Into
main
Merged
Nov 17, 2026

What: AI.onNoise(fn) calls fn(noise) the moment a noise lands on this peer's bus (registry addNoise, so noises made here and noises arriving from other peers on the noise channel both fire), with the same table AI.recentNoises() lists. Returns a connection with :Disconnect(). Each listener runs under pcall; a failing listener warns and the rest still run.

Why: kits that react to noises had to poll AI.recentNoises(), which builds a fresh list on every call. townsfolkKit's 40 townsfolk polled it ten times a second in Mirage Wells; with this they react when the noise happens and make no garbage between noises.

Built on upstream 1.3.17 (sight blockers), no behaviour change for existing callers. Version 1.3.18 in README, package.yaml and AI.VERSION; changelog entry; new test 'onNoise: told when a noise happens' (75 tests, 75/75 twice; the companion-follow test failed once under heavy machine load and passed on both reruns). The test suite README's version line, which still said 1.1.0, now says 1.3.18.

Source world: 5c8cf408-970f-49b4-8b44-9ed6c609de9d Contributed paths:

  • aiKit.package/README.md
  • aiKit.package/aiKit.testSuite/README.md
  • aiKit.package/aiKit.testSuite/init.luau
  • aiKit.package/api.module/init.luau
  • aiKit.package/package.yaml
  • aiKit.package/registry.module/init.luau
  • aiKit.package
  • aiKit.package/aiKit.testSuite
  • aiKit.package/api.module
  • aiKit.package/registry.module
  • aiKit.package/AIDebug.component/init.luau
  • aiKit.package/Brain.component/init.luau
  • aiKit.package/NoiseMaker.component/init.luau
  • aiKit.package/actions.module/init.luau
  • aiKit.package/brains.module/init.luau
  • aiKit.package/debug.module/init.luau
  • aiKit.package/senses.module/init.luau
  • scenes/main.scene/build.luau

10 files changed

  • ChangedaiKit.packageFolderBeforeAfter
  • ChangedaiKit.package/README.md55.8 KB → 56.5 KBBeforeAfter
  • ChangedaiKit.package/aiKit.testSuiteFolderBeforeAfter
  • ChangedaiKit.package/aiKit.testSuite/README.md5.4 KB → 5.4 KBBeforeAfter
  • ChangedaiKit.package/aiKit.testSuite/init.luau103 KB → 103 KBBeforeAfter
  • ChangedaiKit.package/api.moduleFolderBeforeAfter
  • ChangedaiKit.package/api.module/init.luau18.7 KB → 19.1 KBBeforeAfter
  • ChangedaiKit.package/package.yaml1.8 KB → 1.8 KBBeforeAfter
  • ChangedaiKit.package/registry.moduleFolderBeforeAfter
  • ChangedaiKit.package/registry.module/init.luau27.7 KB → 28.8 KBBeforeAfter

Checks

No checks have been posted.

Reviews

No reviews yet.

Conversation

No comments yet.

Sign in to comment or review.