Vixen
c7401864
csharp
public sealed class DoesPathExistDecorator

Whether the agent could actually get to what a key names.

Read the guide page for this →

Remarks

doc 37 § Part 3's DoesPathExist, and the reason it is a decorator rather than a task is that "can I get there" gates a branch: the whole point is to fall through to the next one without the agent taking a step first.

⚠ It observes the key, so it re-tests when the key changes and not when the world does. A door closing does not write a blackboard key, so a branch already running under this decorator keeps running until its MoveTo reports that the crowd failed. That is the right division: the decorator answers "is it worth starting", and the task answers "did it work".

⚠ NavMeshQuery holds one node pool and runs one search at a time. The decorator object is shared by every agent running the tree, so the query is too, and it is safe only because a tree step is single-threaded. A project that parallelises agent steps hands each thread its own query.

Fields and properties (2)

  • public override ObserverAborts Aborts

    What this may interrupt when the keys it reads change.

  • public override ReadOnlySpan<BlackboardKey> ObservedKeys

    The blackboard keys it reads.

Methods (2)

  • public DoesPathExistDecorator(NavMeshQuery query, BlackboardKey key, PathTest test = Budgeted, int budget = 256, ObserverAborts aborts = None)

    Whether the agent could actually get to what a key names.

  • public override bool Evaluate(in BehaviorContext context, ReadOnlySpan<byte> state)

    Whether the node may be entered, or may keep running.

Used by (2)

  • DoesPathExistTestsVixen.Ai.Nodes.Tests
  • WorldNodesVixen.Ai.Nodes