Squad, Role, and AI Extension Points
This page defines what Squad, Role, Unit, Command Intent resolution, and AI extension points may change. See Squad System, Formation System, Tactical Assignment System, and Squads, Roles, and Units for the surrounding model.
UGAIS_SquadDefinition
Extension point | Changes |
|---|---|
| Whether a Unit may join this squad type. |
| Whether a Unit may hold a RoleTag. |
| Whether the squad should dissolve. |
| Definition-side hook after Active; change runtime state only on authority. |
| Resolves final StateTree for role AI. |
| Verifies that host Actor satisfies Pawn/Character, SquadComponent, CommandSystem, AIController/Stack, and related contracts. |
UGAIS_SquadComponent
C++ subclasses can extend default Unit spawning, runtime-contract validation, Formation-ready convergence, member synchronization, role assignment, StateTree baseline application, slot assignment, and Movement Intent refresh. Do not bypass UnitsContainer and maintain a second squad truth on Units.
Authority and Server RPC boundary
ServerDismiss, ServerChangeSquadTeamId, ServerAdd/RemoveUnit(s), ServerAssign/RevokeRole..., ServerIssueSquadCommand, and ServerLeaveSquad provide the request path for an owning client. Extensions can add player permission, resource cost, affiliation limits, and cooldown checks around authoritative calls; they must not modify UnitsContainer, RoleContainer, or owning-squad mirrors on the client.
These RPCs are not general access to any squad. When the squad host is not owned by the calling client, use a project PlayerController as network entry and turn it into a GAIS authority call on the server.
UGAIS_UnitComponent and Command Intent resolution
UGAIS_UnitComponent implements IGAIS_CommandIntentResolver by default and maps GAIS.CommandIntent.* to FGAIS_CommandReference using CommandIntentMappings. This suits fixed Unit types: infantry can map Engage to attack, and a healer can map Support to heal.
For dynamic resolution, implement IGAIS_CommandIntentResolver on a UnitComponent subclass, candidate Actor, or another Actor component and return a Command reference based on Unit state, weapon, role, target source, target tags, or project rules.
Extension point | Changes | Boundary |
|---|---|---|
| Data-driven IntentTag-to-Command mapping. | Fixed mapping only; no complex runtime selection. |
| Dynamically selects a concrete Command. | Returns a reference only; does not issue a Command or replace Source/Filter/Allocator. |
| Responds when a Unit joins/leaves a squad. | Refresh presentation, UI, or local state; never rewrite SquadComponent member truth. |
When Tactical Assignment reports NoResolvedCommand, first verify that the candidate Actor/component implements a Resolver and that CommandIntentMappings contains the Batch IntentTag.
IGAIS_RoleAIOverrideProvider
Implement ResolveRoleOverrideStateTree on a Unit Actor or Unit-owned Component to override role AI dynamically by equipment, status, Buff, or project class system. Its priority is higher than Definition unit-class override, role default StateTree, and global fallback.
Squad condition observation
UGAIS_SquadCondition is stateless inline condition configuration. Built-in Unit-count and exact-role-count conditions cover common formation thresholds. For custom semantics, extend evaluation rather than storing subscriptions in a Condition asset. Runtime subscriptions belong to FGAIS_STT_ObserveSquadCondition instance data: entering subscribes to squad aggregate changes, it dispatches StateTree only when initially true or transitioning false-to-true, and cleans up on exit or Actor EndPlay. This avoids Tick dependence and avoids exposing intermediate replicated roster state.
