Behaviour · interface

BehaviorTree

The tree, flattened. Built once; a character per agent shares it.

Explained in Agents and behaviour.

interface BehaviorTree
import type { BehaviorTree } from '@driftengine/core';

Properties

NameTypeDescription
kindreadonlyUint8Array
childStartreadonlyUint32ArrayFor a composite: where its children start in child. Length nodeCount + 1.
childreadonlyUint32Array
slotreadonlyInt32ArrayFor an action, condition or guard: which function in the table.
namesreadonlyreadonly string[]
nodeCountreadonlynumber
actionsreadonlyreadonly ((context: never) => BehaviorStatus)[]The functions, in the order slot indexes them.
conditionsreadonlyreadonly ((context: never) => boolean)[]