Mob Aliveness Stack

What an NPC does on a round when it is not in combat

Mob Aliveness Stack What an NPC does on a round when it is not in combat Per-round sweep · internal/hooks MobIdle event listener Authored YAML Idle mob sweep · hooks.IdleMobs · once per round · Per-round sweep · internal/hooks · one pass over every live mob instance Idle mob sweep hooks.IdleMobs · once per round one pass over every live mob instance Combat gate · IsInCombat() → skip this mob · Per-round sweep · internal/hooks · a mob in combat skips all four executors Combat gate IsInCombat() → skip this mob a mob in combat skips all four executors Schedule executor · 1st in the sweep · 24-hour segments · Per-round sweep · internal/hooks · swaps idle pool · steers · gates crafting Schedule executor 1st in the sweep · 24-hour segments swaps idle pool · steers · gates crafting Patrol executor · 2nd · strict, yo-yo, oneshot loops · Per-round sweep · internal/hooks · patrol_id runs all day, on its own Patrol executor 2nd · strict, yo-yo, oneshot loops patrol_id runs all day, on its own Conversation engine · 3rd · one spoken line per round · Per-round sweep · internal/hooks · both NPCs must be fully idle Conversation engine 3rd · one spoken line per round both NPCs must be fully idle Behavior tree engine · 4th · fired by the MobIdle event · MobIdle event listener · runs in a separate MobIdle listener Behavior tree engine 4th · fired by the MobIdle event runs in a separate MobIdle listener pathto walker · one room per round · Per-round sweep · internal/hooks · shared by schedules and patrols pathto walker one room per round shared by schedules and patrols Idle command pool · last resort · GetIdleCommand · MobIdle event listener · a schedule segment swaps this pool Idle command pool last resort · GetIdleCommand a schedule segment swaps this pool Schedule files · schedules/<zone>/<id>.yaml · Authored YAML · must cover all 24 hours or boot panics Schedule files schedules/<zone>/<id>.yaml must cover all 24 hours or boot panics Patrol routes · patrols/<zone>/<id>.yaml · Authored YAML · waypoints with per-stop dwell rounds Patrol routes patrols/<zone>/<id>.yaml waypoints with per-stop dwell rounds Conversation library · types/ pools + pairs/ overrides · Authored YAML · role-agnostic A/B scripts Conversation library types/ pools + pairs/ overrides role-agnostic A/B scripts Relationship graph · edges authored on mob YAML · Authored YAML · declare one side, the reverse is automatic Relationship graph edges authored on mob YAML declare one side, the reverse is automatic every mob, every round activity: patrol pathto waypoint if nothing else acted related pairs only Legend Backend Database Security

The sweep

  • • IdleMobs runs once per round over every live mob instance
  • • A mob in combat skips the entire idle body: no schedule, patrol or chat
  • • A sleeping mob still reaches the MobIdle listener, and stops there

Routines

  • • A schedule must cover all 24 hours, and swaps the idle-emote pool per segment
  • • Patrols loop strict, yo-yo or oneshot, with per-waypoint dwell rounds
  • • Both move the mob through the same pathto walker, one room per round

Conversations

  • • Only NPC pairs with an authored relationship edge ever talk
  • • Both must be fully idle: no combat, sleep, mid-walk, chat or cooldown
  • • The engine randomises which NPC plays role A, so scripts stay role-agnostic