[MIRROR] Fixes AI lag by re-adding idle mode to all AI that was lost with the simple mob to basic mob conversion. #2854
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Nova: NovaSector/NovaSector#1949
Original PR: tgstation/tgstation#82539
About The Pull Request
Fixes AI lag by re-adding idle mode to all AI that was lost with the simple mob to basic mob conversion.
AI controllers with no clients around for 14 tiles will move into idle mode and stop planning or acting.
AI controllers will now record how much time was spent on planning or un-idling AI controllers.
Mooks and Bots do not currently idle as we want them to be working off-screen for game design purposes.
Why It's Good For The Game
This is an important anti-lag feature that was implemented for simple animals back in the day that never made it to basic mobs or the AI system. We have roughly 250-300+ AI controllers roundstart, with the bulk majority on Lavaland. There is no point in processing things that nobody can see.
Once LemonInTheDark finishes their more advanced system for this, we can utilize that for dynamically waking/sleeping AI based on contextual interest, but for now we might as well implement what we had originally to resolve this issue.
Changelog
🆑 Iamgoofball
fix: Fixes AI lag by re-adding idle mode to all AI that was lost with the simple mob to basic mob conversion.
fix: AI controllers with no clients around for 14 tiles will move into idle mode and stop planning or acting.
fix: AI controllers will now record how much time was spent on planning or un-idling AI controllers.
/:cl: