Vixen
caa30e12
csharp
public sealed class RunUtilitySetTask

Runs a utility set as a behaviour-tree task, until something interrupts it.

Read the guide page for this →

Remarks

doc 37 § D2 is what makes this possible, and it is the payoff for that decision: a tree handles the parts of a character that are a procedure — patrol, then investigate, then return — and a utility set handles the part that is a judgement, which is everything the character does once a fight starts. Neither technique is asked to be the other, and both choose from the same action registry.

⚠ It never finishes on its own. A set is a standing judgement rather than a procedure with an end, so this stays Running and is meant to be aborted by a decorator above it — which is the same shape as a Patrol under a perception decorator. It fails only when the set has nothing to say at all, so a branch whose whole set is vetoed gives way rather than standing there.

⚠ Everything lives in the span, including the sub-action's own state. The layout is the header, then a cooldown stamp per action, then the widest action's block — which is why RequiredState is an instance property. An action never owns its state, and an action that runs other actions owns theirs even less.

Fields and properties (1)

  • public int RequiredState

    How many bytes this task needs, for the set it was given.

Methods (4)

  • public RunUtilitySetTask(UtilitySet set, AgentActionRegistry actions)

    Runs a utility set as a behaviour-tree task, until something interrupts it.

  • public void Start(in AgentContext context, Span<byte> state)

    Begins. Called once before the first Tick, on a zeroed span.

  • public ActionStatus Tick(in AgentContext context, Span<byte> state, float delta)

    Advances it.

  • public void Abort(in AgentContext context, Span<byte> state)

Used by (2)

  • BuildStateVixen.Ai
  • UtilityAgentTestsVixen.Ai.Tests