ai controllers that fail to make a plan no longer process until theyre able to plan again (#86600)

## About The Pull Request
ai controllers that fail planning no longer process until theyre able to
plan again. this makes it so /process is called less thus you'll have
less AI competing against one another for cpu. also converts idle
behaviors into singletons

## Why It's Good For The Game
AIs that dont have a plan dont do anything during processing so its
better to just make them sit out the cycle instead of draining cpu

## Changelog
🆑
/🆑
This commit is contained in:
Ben10Omintrix
2024-09-21 01:29:34 +03:00
committed by GitHub
parent 9964f3f1f8
commit 613fb4c08a
3 changed files with 32 additions and 15 deletions
@@ -1,6 +1,17 @@
PROCESSING_SUBSYSTEM_DEF(idle_ai_behaviors)
name = "idle_ai_behaviors"
flags = SS_NO_INIT | SS_BACKGROUND
name = "AI Idle Behaviors"
flags = SS_BACKGROUND
wait = 1.5 SECONDS
priority = FIRE_PRIORITY_IDLE_NPC
init_order = INIT_ORDER_AI_IDLE_CONTROLLERS //must execute only after ai behaviors are initialized
///List of all the idle ai behaviors
var/list/idle_behaviors = list()
/datum/controller/subsystem/processing/idle_ai_behaviors/Initialize()
setup_idle_behaviors()
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/idle_ai_behaviors/proc/setup_idle_behaviors()
for(var/behavior_type in subtypesof(/datum/idle_behavior))
var/datum/idle_behavior/behavior = new behavior_type
idle_behaviors[behavior_type] = behavior