Skip to content

Behaviour Ticker #389

Open
Open

Description

@bitbrain

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 BeehaveSpatialTicker which would automatically discover all behaviour trees in the scene and manage their ticking (if ticking is set to MANUAL only). In case behaviour trees are not set to MANUAL it will ignore these and exempt them. Optionally, having a new process mode for trees specifically could also be an option (e.g. IDLE_MANAGED and PHYSICS_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:

  • viewport checks
  • quadtree usage to have gradual tick() frequency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions