Vixen
c7401864
csharp
public sealed class GoapDomain

Everything one kind of agent can want and can do, with the graph between them.

Read the guide page for this →

Remarks

⚠ The graph is built once, here, and not per resolve. Which action's effect can serve which action's condition is a fact about the action set, so working it out inside the search would be the same nested loop over every partial plan — doc 37 § D10. What is per agent is the condition evaluations and the costs, and nothing else.

Immutable and shared by every agent of its kind, the way a BehaviorTreeTemplate and a UtilitySet are.

⚠ An action may be excluded per agent, and that is what "capabilities" means. A domain describes what the kind can do; an agent carries a mask of which of them it can, so a wounded guard and a healthy one share one graph and plan differently. A domain per capability set would be a domain per permutation.

Fields and properties (7)

  • public Symbol Name

    What it is called.

  • public GoapWorldKeys Keys

    The world keys it reasons about.

  • public int Count

    How many actions it holds.

  • public GoapAction this[int index]

    The action at an index.

  • public ReadOnlySpan<GoapAction> Actions

    Everything its agents can do, in order.

  • public ReadOnlySpan<GoapGoal> Goals

    Everything they might want, in order.

  • public int EdgeCount

    How many edges the graph has, which is what an editor's viewer draws.

Methods (4)

  • public GoapDomain(Symbol name, GoapWorldKeys keys, GoapAction[] actions, GoapGoal[] goals)

    Creates a domain and builds its graph.

  • public ReadOnlySpan<int> Servers(int action, int condition)

    Which actions can serve one of an action's conditions.

  • public int Servers(in GoapCondition condition, Span<int> found)

    Which actions can serve a goal's condition.

  • public int IndexOfGoal(Symbol name)

    Looks a goal up by name.

Used by (21)

  • AiSnapshotsVixen.Ai
  • AiSystemVixen.Ai
  • GoapBudgetTestsVixen.Ai.Tests
  • GoapDomainContentCompilerVixen.Ai
  • GoapDomainLibraryVixen.Ai
  • GoapDomainTestsVixen.Ai.Tests
  • GoapPearTestsVixen.Ai.Tests
  • GoapPlanQueueVixen.Ai
  • GoapPlannerVixen.Ai
  • GoapReplanTestsVixen.Ai.Tests
  • GoapSnapshotVixen.Ai
  • GoapThroughputTestsVixen.Ai.Tests
  • VillageVixen.Ai.Nodes.Tests
  • AgentDebugModelVixen.Editor.Ai
  • GoapDomainDocumentVixen.Editor.AssetEditors
  • GoapDomainImporterVixen.Editor.Assets
  • GoapDomainViewVixen.Editor.AssetEditors
  • GoapGraphProjectionVixen.Editor.Ai
  • GoapGraphProjectionTestsVixen.Editor.AssetEditors.Tests
  • LiveAgentVixen.Editor.AssetEditors.Tests
  • LiveGoapTestsVixen.Editor.AssetEditors.Tests