I've often wondered whether it might be advantageous to switch from BehaviorManager from "Every frame" to "Manual".
I imagine there's probably some pivot where more than a certain number of AIs and/or number of nodes that get evaluated each frame makes it beneficial to switch.
Obviously there's also the question of how to schedule manual ticks. I'm picturing an "event driven" approach and recognise it might entail reworking the trees and perhaps more.
I have a bunch of "senses" classes that deal with inputs which currently fire BT events but could just as easily fire some custom event (via my own event system) that triggers a Tick to evaluate the results. My movement is done using A*Pathfinding project (and I've recently integrated the "Easy Character Movement" for that). I could modify my movement BD nodes to dispatch an event/custom event on arrival. Other things that are currently BD nodes checking every frame could do the same. I suspect all this might save quite a lot of cycles I'm currently burning on each AI.
Is this a mad concept? As I said, I've pondered it quite often and suspect I read something similar in the old forum but I can't access to refresh my memory.
All thoughts/examples/etc welcome
I imagine there's probably some pivot where more than a certain number of AIs and/or number of nodes that get evaluated each frame makes it beneficial to switch.
Obviously there's also the question of how to schedule manual ticks. I'm picturing an "event driven" approach and recognise it might entail reworking the trees and perhaps more.
I have a bunch of "senses" classes that deal with inputs which currently fire BT events but could just as easily fire some custom event (via my own event system) that triggers a Tick to evaluate the results. My movement is done using A*Pathfinding project (and I've recently integrated the "Easy Character Movement" for that). I could modify my movement BD nodes to dispatch an event/custom event on arrival. Other things that are currently BD nodes checking every frame could do the same. I suspect all this might save quite a lot of cycles I'm currently burning on each AI.
Is this a mad concept? As I said, I've pondered it quite often and suspect I read something similar in the old forum but I can't access to refresh my memory.
All thoughts/examples/etc welcome