-
-
Notifications
You must be signed in to change notification settings - Fork 160
Behaviour Ticker #389
Copy link
Copy link
Open
Labels
🍯 featureA new addition to this addon.A new addition to this addon.🐝 new nodeA new node type.A new node type.🧪 unit-tests-requiredRelated to writing unit tests.Related to writing unit tests.
Metadata
Metadata
Assignees
Labels
🍯 featureA new addition to this addon.A new addition to this addon.🐝 new nodeA new node type.A new node type.🧪 unit-tests-requiredRelated to writing unit tests.Related to writing unit tests.
For larger scenes, there might be dozens or hundreds of behaviour trees that are ticked every single frame. However, especially for behaviours off-screen this can become a CPU performance bottle-neck. Games like Kingdom Come Deliverance 2 implement a system where NPCs are "ticked" at different rates, depending on if they are nearby or further away.
A system like this for Beehave could be possible with the introduction of a new node, something like
BeehaveSpatialTickerwhich would automatically discover all behaviour trees in the scene and manage their ticking (if ticking is set toMANUALonly). In case behaviour trees are not set toMANUALit will ignore these and exempt them. Optionally, having a new process mode for trees specifically could also be an option (e.g.IDLE_MANAGEDandPHYSICS_MANAGED), given we might want to tick them in physics or idle thread but that could also be configured on the ticker itself.From an implementation perspective, this could be solved in various ways:
tick()frequency