Found 4 issues. The most impactful is the scan throttle bypass that forces expensive spatial queries every tick when creatures are in POI-sparse areas (explaining Lyra’s consistent 150-180ms brain time). Second is PairUp always recruiting Lyra (6x in one window) due to no per-target cooldown, causing her to never complete tasks. Third is a creature stuck in COMMUTING_TO_FOOD for 19+ minutes because the starvation rescue only triggers at energy=0. Fourth is deltaTime capping log spam (55x) from a missing throttle.
(HIGH): Empty-cache bypass defeats scan throttle — Lyra consistently 150-180ms
Fix: Track the last scan tick instead of relying on cache emptiness. Add a field `private _lastFullScanTick = -999` and replace the cache-empty bypass with a stale-cache fallback (rescan after 12 ticks / ~4 seconds): (code change) (code change) (code change) This ensures creatures in empty areas scan at…
(HIGH): PairUp always recruits Lyra — no per-target cooldown
Fix: Add a `_lastRecruitedAt` timestamp to each brain and penalize recently-recruited creatures in the scoring: (code change) (code change) And add the field in `pet-brain.ts`:
(code change) The `-5` penalty makes recently-recruited creatures (within 90s) essentially un-selectable, forcing the algorithm…
(MEDIUM): Stuck creature in COMMUTING_TO_FOOD for 19+ minutes
Fix: Add a duration-based rescue that triggers after 90 seconds regardless of energy: (code change) This rescues any creature that’s been commuting to food for over 90 seconds, regardless of energy level. The energy<=0 check remains as a fast-path for the truly desperate. —
(LOW): deltaTime capping log spam — 55 occurrences
Fix: Only log the first occurrence and then throttle to once per 60 seconds: (code change) —