public sealed class AiSystemJoins the entities that have an AiAgent to their memory and their blackboard, asks the governor who may think, and steps the ones it named.
As a system
- Phase
- Update
- Writes
- AiAgent
Remarks
One system for all three planners. A behaviour-tree step, a utility score and a GOAP plan's current action are three ways of arriving at one IAgentAction, so there is one join, one governor, one memory pool, one debug record and one place where an agent's delta is worked out. What the planners add is how the action index is chosen; everything around that is here.
The blackboard is a side table, not a component. An agent's board is a managed object with observer lists in it, which is not a thing that belongs in a column — and keeping it here is also what makes "one agent owns one blackboard" enforceable rather than merely stated. It is indexed by ScheduleIndex, which is the same number the governor schedules on, so an agent's data and its turn are one lookup apart.
Membership is a query, not a list. An entity that gains the component joins and one that loses it or is destroyed leaves, with nobody calling anything — NavigationSystem's arrangement, and for its reason. Departure is detected by absence, because an entity can leave a query by being destroyed, by having a component removed, or by moving to another world, and the ECS calls nobody about any of the three.
Runs in Update, before animation and before the transform pass, so that whatever an action writes this frame is resolved in the same frame.
Fields and properties (20)
public AgentActionRegistry ActionsThe actions its agents may run.
public BlackboardLayout LayoutThe shape of every agent's blackboard.
public AgentMemoryPool MemoryWhere per-agent state comes from.
public GoapDomainLibrary DomainsThe GOAP domains its agents may plan over, by index.
public GoapSettings GoapWhat bounds a GOAP search.
public int ResolvesPerStepHow many GOAP resolves may run per step, across every domain.
public GoapTargetSensors? TargetsWhere a GOAP action happens, and where the agent asking is.
public IActionCostModel? CostsWhat a GOAP action costs to reach, or null for the straight-line model.
public IReplanPolicy ReplanPolicyWhen a GOAP agent thinks again.
public UtilitySetLibrary SetsThe utility sets its agents may score, by index.
public BehaviorTreeLibrary TreesThe trees its agents may run, by index.
public IAgentGovernor GovernorWho gets to think. Replaceable, because who is worth a tick is a game's decision.
public SharedBlackboard? SharedThe board this world's agents share, if they share one.
public AgentDebugRecorder DebugThe last decisions, when it is turned on.
public AgentSchedule LastScheduleWhat the governor decided last step.
public long StepsHow many steps this system has run, which is what a record is stamped with.
public SensorSet? SensorsThe sensors its agents read the world through, when a game has any.
public AiBreakpoints? BreakpointsNode breakpoints, when a debugger has set any.
public int PopulationHow many agents have joined.
public SystemAccess Access
Methods (8)
public AiSystem(AgentActionRegistry actions, BlackboardLayout layout, AgentMemoryPool? memory = null)Creates the system.
public override JobHandle Update(in SystemContext context, JobHandle dependency)Runs the system.
public void Step(World world, GameTime time)Runs one step against a world.
public Blackboard? BlackboardOf(in AiAgent agent)An agent's own data, or null if it has not joined.
public BehaviorTreeInstance? TreeOf(in AiAgent agent)An agent's running tree, or null if it is not running one.
public GoapPlanQueue Queue(int domain)The queue for a domain, made the first time one of its agents joins.
public GoapMemory? PlanningOf(in AiAgent agent)An agent's plan, or null if it is not planning.
public UtilityMemory? ScoringOf(in AiAgent agent)What an agent chose last, or null if it is not scoring a set.
Used by (27)
- AiDebugChannelVixen.Ai
- AiDebugChannelTestsVixen.Ai.Tests
- AiDiagnosisExitCriteriaTestsVixen.Ai.Tests
- AiGameplayDebuggerVixen.Ai.Diagnostics
- AiOverlaySystemVixen.Ai.Diagnostics
- AiSchedulingTestsVixen.Ai.Tests
- AiSnapshotTestsVixen.Ai.Tests
- AiSnapshotsVixen.Ai
- AiSystemTestsVixen.Ai.Tests
- AiSystemTreeTestsVixen.Ai.Tests
- BehaviorTreeDeterminismTestsVixen.Ai.Tests
- BindingTestsVixen.Ai.Perception.Tests
- FleetVixen.Ai.Tests
- GoapAgentTestsVixen.Ai.Tests
- LevelVixen.Ai.Nodes.Tests
- OverlayFixtureVixen.Ai.Diagnostics.Tests
- PatrolChaseGiveUpTestsVixen.Ai.Nodes.Tests
- PerceptionNodeTestsVixen.Ai.Perception.Tests
- PerceptionSystemVixen.Ai.Perception
- SeamTestsVixen.Ai.Nodes.Tests
- UtilityAgentTestsVixen.Ai.Tests
- VillageVixen.Ai.Nodes.Tests
- VillageSampleTestsVixen.Ai.Nodes.Tests
- AgentDebugModelVixen.Editor.Ai
- AgentFixtureVixen.Editor.AssetEditors.Tests
- LiveAgentVixen.Editor.AssetEditors.Tests
- LiveTreeCanvasTestsVixen.Editor.AssetEditors.Tests