Vixen
c7401864
csharp
public sealed class GoapSnapshot

Everything one resolve needs, taken off the world in one go.

Read the guide page for this →

Remarks

⚠ The search reads this and never the world, and that is what makes a resolve a job. doc 37 § D16 puts GOAP resolves on jobs because they are expensive and unbounded — and a search that reached into a World or a Blackboard from a worker thread would be a data race the scheduler cannot see. So the world keys are projected, the targets are sensed and the costs are computed at submit, on the thread that owns the agent, and what crosses to the job is a few arrays of numbers.

It is also what doc 37 § D10 means by the graph being built once: what is per agent is the condition evaluations and the costs, and both of them are here.

⚠ A snapshot is a moment, and a plan made from it can be stale by the time it lands. That is the trade a queue makes and it is why § D11 commits only the head: the head's conditions are re-checked against the live world before it starts.

Fields and properties (7)

  • public GoapDomain Domain

    The domain it was taken against.

  • public int[] World

    The projected world keys.

  • public float[] Costs

    What each action costs, worked out where the agent was standing.

  • public GoapTarget[] Targets

    Where each action would happen.

  • public int Goal

    Which goal to plan for.

  • public GoapCapabilities Capabilities

    Which actions this agent may use.

  • public Vector3 Position

    Where the agent was.

Methods (4)

Used by (4)

  • GoapDomainTestsVixen.Ai.Tests
  • GoapPlanQueueVixen.Ai
  • GoapPlannerVixen.Ai
  • SlotVixen.Ai