Vixen
caa30e12
csharp
public sealed class GoapPlanner

The A* over a domain's action graph, bounded and reported.

Read the guide page for this →

Remarks

Backwards, from goal to satisfied, which is doc 37 § D10. A node is one action chosen to serve a condition; its children are the actions that can serve its unmet conditions. The search finishes at the first node whose own conditions all hold in the projected world — that action can be run now, and the chain back up to the goal is the plan.

⚠ A plan is a chain, so an action with two unmet conditions is served one at a time — and that is correct rather than a simplification. Only the head is committed (§ D11): the head is by construction runnable now, running it changes the world, and the next resolve plans from what the world then is. A search that instead tried to satisfy every branch of a conjunction at once would be a hyper-graph search whose plans go stale before their second step.

⚠ An action may not appear twice in one chain. Without that, a domain where two actions serve each other's conditions is an infinite descent — and the budget would report exhaustion for a domain with a perfectly good two-step plan in it.

It searches a GoapSnapshot and never the world, which is what makes a resolve a job. See GoapPlanQueue.

Fields and properties (4)

  • public GoapDomain Domain

    The domain being searched.

  • public GoapSettings Settings

    What bounds a search.

  • public int LastExpanded

    How many nodes the last search expanded.

  • public List<GoapConsidered>? Traced

    Where the search writes down what it considered and rejected, when a tool asked for it.

Methods (3)

Used by (8)

  • GoapBudgetTestsVixen.Ai.Tests
  • GoapCostTestsVixen.Ai.Tests
  • GoapPearTestsVixen.Ai.Tests
  • GoapPlanQueueVixen.Ai
  • GoapReplanTestsVixen.Ai.Tests
  • GoapDomainViewVixen.Editor.AssetEditors
  • GoapGraphProjectionTestsVixen.Editor.AssetEditors.Tests
  • LiveGoapTestsVixen.Editor.AssetEditors.Tests