Vixen
c7401864
csharp
public abstract class BehaviorService

Something that runs on an interval for as long as a composite's branch is active.

Read the guide page for this →

Remarks

Where perception updates, target selection and blackboard maintenance go. A service is a local sensor with a schedule — doc 37 § D13 — which is why there is one implementation of "read the world into a key" and two front ends onto it.

Shared across agents like everything else here, so per-agent state is the span.

Fields and properties (1)

  • public virtual int StateSize

    How many bytes of per-agent state it needs.

Methods (3)

  • public virtual void Enter(in BehaviorContext context, Span<byte> state)

    The branch became active.

  • public abstract void Tick(in BehaviorContext context, Span<byte> state, float delta)

    Its interval has elapsed.

  • public virtual void Leave(in BehaviorContext context, Span<byte> state)

    The branch stopped being active.

Used by (12)

  • BehaviorNodeDefinitionVixen.Ai
  • BehaviorServiceDefinitionVixen.Ai
  • BehaviorServiceSlotVixen.Ai
  • BehaviorTreeInstanceVixen.Ai
  • BehaviorTreeResolverVixen.Ai
  • BuildStateVixen.Ai
  • CompileStateVixen.Ai
  • DefaultFocusServiceVixen.Ai.Nodes
  • NearestPerceivedServiceVixen.Ai.Perception
  • NoopServiceVixen.Ai.Tests
  • RunQueryServiceVixen.Ai.Nodes
  • UpdateBlackboardServiceVixen.Ai