Vixen
caa30e12
csharp
public sealed class GoapGraphProjection

The GOAP graph, derived from the tables and drawn read-only.

Read the guide page for this →

Remarks

⚠ Derived, and this is the point at which "the node editor is mandatory" has to be answered honestly. crashkonijn ships a GraphViewer, not a graph editor, and that is correct: the edges of a GOAP graph are not authored, they are computed from which effects satisfy which conditions. Drawing them by hand would be authoring the same fact twice, and the two copies would disagree the first time somebody edited a condition.

So this projects a compiled GoapDomain onto NodeCanvas and there is no command stack over it — which NodeGraphView already supports, since "no stack means read-only". Every edit goes through the tables.

The layout is by depth from a goal: goals on the left, then the actions that serve them, then the actions that serve those. That is the shape the search walks, so a domain whose plan is four steps deep looks four steps deep.

Fields and properties (4)

  • public NodeGraph Graph

    What the canvas shows.

  • public IReadOnlyDictionary<int, int> Depths

    How deep each action sits, in steps from the nearest goal.

  • public IReadOnlyList<int> World

    The world the last Project tested conditions against, or empty.

  • public IReadOnlyList<GoapConsidered> Rejected

    What the last search considered and rejected, most recent first.

Methods (2)

  • public NodeGraph Project(GoapDomain domain, GoapPlan? plan = null, ReadOnlySpan<int> live = default(ReadOnlySpan<int>), IReadOnlyList<GoapConsidered>? considered = null)

    Rebuilds the picture from a domain.

  • public GraphNode? BoxOf(int action)

    The box showing an action, if it is in the picture.

Used by (3)

  • GoapDomainViewVixen.Editor.AssetEditors
  • GoapGraphProjectionTestsVixen.Editor.AssetEditors.Tests
  • LiveGoapTestsVixen.Editor.AssetEditors.Tests