Tactical Assignment Reference
Tactical Assignment configuration lives at three levels. A Plan defines batches and reevaluation cadence; a StateTree Task supplies the top-level Sources for one run; project policy and settings define capacity and location canonicalization for physical targets. Candidate flow, Allocator context, and Session tracking state are produced at runtime and are not saved Plan fields.
UGAIS_TacticalAssignmentPlan
A Plan can be a Data Asset or an Inline Plan on a StateTree Task. It stores reusable planning rules; the Task Sources provide candidate Units and targets for a run.
Field | Purpose | Adjust when | Misconfiguration risk |
|---|---|---|---|
| Tactical requests evaluated in order. Actors assigned by an earlier Batch do not enter later Batches. | You need several tactical priorities. | Placing low-priority Batches first consumes candidates too early. |
| Automatic reevaluation interval; must be greater than zero. | Balancing changing situations against runtime cost. | A short interval repeatedly runs Sources, Filters, scoring, and allocation; a long one reacts slowly. |
Plan validation requires at least one Batch, a valid IntentTag on every Batch, valid Filter instances, finite score adjustments, and a valid reevaluation interval.
Data Asset versus Inline Plan
Item | | |
|---|---|---|
Type | Standalone | An inline instance of the same type on the Task. |
Configurable fields | | The same fields. |
Runtime semantics | The Task resolves it and starts a Session. | The Task resolves it and starts a Session. |
Reuse | Multiple Tasks can reference it. | Saved only with the current Task configuration. |
Change impact | Asset changes affect every reference. | Affects only this StateTree call site. |
Sources | Supplied independently by every referencing Task. | Supplied by the current Task. |
Selection constraint | Mutually exclusive with Inline Plan. | Mutually exclusive with Plan. |
Standalone asset validation covers the Plan itself. When a Session starts, the system also validates the complete runtime configuration together with Sources supplied by the calling Task. An Inline Plan has the same fields and runtime capability; its configuration ownership is local to the Task.
FGAIS_TacticalAssignmentBatch
A Batch states which semantic request this priority makes, which candidates may participate, how scores are adjusted, and who makes the final selection. The Task supplies Sources centrally.
Field | Purpose | Adjust when | Misconfiguration risk |
|---|---|---|---|
| Identifies the Batch in the editor, logs, and diagnostics. | A Plan has multiple Batches. | Does not change behavior, but makes diagnosis harder. |
| The | Separating attack, support, guard, and similar behavior. | A mismatch with Resolver or |
| Filters candidate Actors before command validation; every Filter must pass. | Limiting roles, tags, states, or distance. | Overly strict filters can reduce the Actor pool to zero. |
| Filters targets before command | Limiting affiliation, source, Actor/location form, and similar rules. | The Command still performs its own target validation afterward. |
| Multiplies the Command base score. | A Batch needs an overall preference increase or decrease. | Extreme values hide the Command base score. |
| Adds a bias after multiplication. | Raising or lowering one Batch uniformly. | Cannot make an otherwise illegal candidate legal. |
| Optional final selector; null uses Greedy With Capacity. | The default capacity-aware greedy choice does not fit gameplay. | A custom Allocator must not rediscover Sources or rerun command validation. |
StateTree Task runtime inputs
FGAIS_STT_RunTacticalAssignmentPlan owns Session lifetime and top-level inputs while its StateTree state is active.
Input/output | Purpose | Notes |
|---|---|---|
| The only owning Controller for this run; the Task derives the Context Pawn from its current Pawn. | An invalid Controller cannot establish runtime context. |
| Reusable asset or inline rule set. | Exactly one must be set. |
| Top-level Sources that each contribute candidate Actors. | They are not Batch fields. Each Source writes independently and the final pool is their union. |
| Top-level Sources that each contribute | Targetless Commands need not consume them; other Batches may still require real targets. |
| StateTree-readable outputs for this run. | Synchronized by the Session for observation and branching. |
| Edge events when assignment availability changes. | Repeated identical state does not broadcast again; |
Sources and SourceTag
UGAIS_TacticalAssignmentAssigneeSource and UGAIS_TacticalAssignmentTargetSource Gather entry points only fill output arrays. Fixed Actor/Target Data arrays, squad members, EQS Actors or locations, and project-specific input can all be implemented as Sources.
Configuration | Purpose | Risk |
|---|---|---|
Target Source | Adds source semantics to produced targets that do not already have one. Filters, Resolvers, and diagnostics can use it. A TargetData item with its own Tag is not overwritten. | An inconsistent tag vocabulary makes SourceTag Filters exclude expected targets. |
| Validates deterministic prerequisites such as QueryTemplate, RoleTag, or an explicit SquadActor. | It must not mean “there are no targets this run”; that is normal empty output. |
Gather output | This Source's independent candidate contribution for the run. | Empty output, no query result, or invalid output contributes an empty set; other Sources continue normally. |
Built-in Assignee Sources
Editor label / type | Input and behavior | Use for | Key limitation |
|---|---|---|---|
Actor Array / | A fixed | Minimal verification or binding a few explicit Units from script. | Invalid items are dropped; not suitable for dynamic discovery. |
All Squad Units / | Expands every resolved Unit from an explicit | Treating a whole squad as one shared candidate pool. | Does not fall back to Context Pawn; without explicit configuration this run is empty. |
Squad Units By Role / | Collects an exact | A Source only needs one role. | |
EQS Actors / | Runs | Spatial searches for distance, visibility, areas, and similar criteria. | Query must return Actors. Current implementation is synchronous and immediate; a failure contributes an empty set this run. |
Built-in Target Sources
Every Target Source inherits SourceTag.
Editor label / type | Input and behavior | Use for | Key limitation |
|---|---|---|---|
Target Data Array / | Direct | Actor plus location, pure locations, or preset TargetTags/SourceTag. | Every item must resolve to a valid physical target. |
Actor Targets / | Converts | Fixed enemies, allies, or interactables. | Does not create pure location targets. |
All Squad Units / | Expands all Units from an explicit | Healing, support, escort, and other Plans targeting squad members. | |
EQS Actor Targets / | Converts EQS Actor items to targets and retains Actor-owned tags. | Dynamic enemies or interactable Actors. | |
EQS Location Targets / | Converts EQS Vector items to pure location targets. | Cover, guard, or flanking locations. | |
SourceTag writing, matching, and boundary
- TargetData with a valid
SourceTagkeeps its value. - TargetData without a Tag receives the producing Target Source's
SourceTag. TargetFilter_SourceTagchecksBlockedSourceTagsfirst and rejects a match. If Allowed is empty, other sources pass; otherwise a source must match an Allowed Tag. Matching follows GameplayTag parent-child hierarchy.- Intent Resolver receives this Tag in its context and can choose a Command by source.
- GameplayDebugger displays the Tag on Assigned and Unassigned rows.
- Candidates and reservations treat different SourceTags for one Actor as distinct logical candidates, but reservations canonicalize by Actor; pure locations canonicalize by location grid.
Built-in Assignee Filters
Type / editor label | Tests | Common use |
|---|---|---|
| All | Allow only combat-ready, unstunned, or suitably equipped Units. |
| Candidate has a valid Squad Role. | Exclude members not yet assigned a role. |
| Candidate has a Squad entry but no valid Role. | Give unassigned members a fallback task. |
| Tests Squad Role with | One Batch serves a group of roles. |
| Candidate must have a valid formation slot and MovementIntent, and be within | Make only stragglers catch up, or admit members near their slots to the next task. |
Distance To Desired Location can use predicted/smoothed DesiredLocation or raw RawDesiredLocation; DistanceMetric can be 2D or 3D; a maximum distance of 0 means no upper bound.
Built-in Target Filters
Type / editor label | Tests | Common use |
|---|---|---|
| Target must have an Actor and pass Required/Blocked/TagQuery. | Attack only lockable enemies or heal only injured allies. |
| Context Actor's attitude to the target Actor equals | Friend-or-foe filtering. |
| Filters using Allowed/Blocked source Tags. | Send one target pool to attack, guard, player-marked, or other Batches. |
| Keeps only valid Actor targets. | Actor-based Commands. |
| Keeps only targets with no Actor. | Pure-location guard, movement, or flanking. |
The boundary is simple: Sources decide where the global candidate pool comes from; each Batch's Filters decide who from that union can participate in its current tactical intent. Filtering occurs before pairing and Intent Resolver. CommandDefinition still runs CanObeyCommand and IsValidTarget afterward.
Target capacity and location canonicalization
The World Subsystem owns target capacity. It uses UGAIS_ProjectPolicy::ResolveTacticalAssignmentTargetCapacity to establish authoritative capacity for a canonical physical target. The default policy uses MaxAssigneesPerTacticalTarget: a positive value is a hard limit and 0 permits unlimited sharing. Batches and the Greedy Allocator do not have independent capacity-number fields.
UGAIS_DeveloperSettings.TacticalAssignmentLocationTargetGridSize controls the canonicalization grid for pure location targets. Actor targets use Actor identity; targetless Commands do not reserve physical targets. Do not look for removed Plan fields such as TargetLocationTolerance or MaxAssigneesPerTarget.
What a custom Allocator sees
FGAIS_TacticalAssignmentAllocatorContext is read-only Batch input: Context Actor, Batch Index, Batch copy, scored CandidateAssignments, and TargetCapacities. The capacity view already includes existing World claims; the core still validates candidate origin and capacity when it accepts results.
An Allocator selects. It must not call Sources again, redo Filters, resolve Intent again, or bypass Command validation. To change whether a Unit can execute or a target is legal, use a Command, Resolver, or Filter.
The default UGAIS_TacticalAssignmentAllocator_GreedyWithCapacity visits candidates in stable descending AdjustedScore order. One Actor produces at most one selection. A reservation-requiring candidate must also satisfy ExistingClaims + selections in this Batch <= MaxAssignees; equal scores retain original candidate order.
FGAIS_TacticalAssignmentCandidate
Every item an Allocator receives has passed Sources, Filters, Resolver, and Command validation.
Field | Meaning |
|---|---|
| Unit ready to receive the Command. |
| Tactical semantic requested by the current Batch. |
| Command Definition and variant index resolved by the Unit. |
| Original Source target, preserving source semantics and reservation identity. |
| Final command target resolved for the current Unit. |
| Physical-target bucket for an Actor or location grid. |
| Base score returned by CommandDefinition. |
| Score after Batch multiplier and bias. |
A custom Allocator writes selected original candidates to SelectedAssignments. The core looks them up in the canonical candidate set, so altered fields, fabricated candidates, or duplicate selection of an Actor are rejected.
Target capacity modes
FGAIS_TacticalAssignmentTargetCapacity has three modes.
| Behavior | Typical use |
|---|---|---|
| Uses | One-person cover, two-person coordinated attack, or limited interaction slots. |
| Any number of Sessions/assignments may share the target. | Rally areas or a public follow target. |
| Rejects new reservations for this physical target. | A temporarily closed point or facility under repair. |
FGAIS_TacticalAssignmentTargetCapacityView.ExistingClaims is the number held by other Sessions. The requesting Session's own existing claim is handled separately during replacement. Resolved capacity remains stable while a reservation bucket is non-empty so repeated reevaluations have stable results.
Customize capacity through UGAIS_ProjectPolicy::ResolveTacticalAssignmentTargetCapacity(World, CanonicalTargetData). The policy is called through its CDO and can immediately inspect the target Actor, type, tags, or project rules. The World Subsystem owns cross-frame usage, so the policy need not cache Actors or counts.
Results and diagnosis
Deferred means a World-update guard conflict or synchronous reentry and preserves tracked assignments and reservations. When a Source produces nothing this run, normal evaluation still completes, reconciling old assignments against the current candidate flow and marking them Stale when necessary.
For the end-to-end configuration workflow, see Configure a Tactical Assignment Plan; for extension ownership, see Tactical Assignment Extension Points; for failure signals, see Troubleshooting Flows.
