public sealed class GoapSnapshotEverything one resolve needs, taken off the world in one go.
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 DomainThe domain it was taken against.
public int[] WorldThe projected world keys.
public float[] CostsWhat each action costs, worked out where the agent was standing.
public GoapTarget[] TargetsWhere each action would happen.
public int GoalWhich goal to plan for.
public GoapCapabilities CapabilitiesWhich actions this agent may use.
public Vector3 PositionWhere the agent was.
Methods (4)
public GoapSnapshot(GoapDomain domain)Creates a snapshot sized for a domain.
public bool Take(in AgentContext context, int goal = -1, IActionCostModel? costs = null, GoapTargetSensors? sensors = null, GoapCapabilities capabilities = default(GoapCapabilities), float distanceCost = 0.1)Takes everything a resolve needs off the world.
public int Wanted()The highest-priority goal that is not already true.
public int Read(GoapWorldKey key)What a world key read when the snapshot was taken.
Used by (4)
- GoapDomainTestsVixen.Ai.Tests
- GoapPlanQueueVixen.Ai
- GoapPlannerVixen.Ai
- SlotVixen.Ai