Overview
WCGASSquadComp is a runtime ActorComponent that manages AI squad membership, roles, and command coordination. It enables coordinated AI behavior through shared threat information, tactical formations, and hierarchical command systems. The component supports role-based behavior modification, configurable formations, threat distribution, and difficulty-aware configuration loading.
Core Functionality
- Tracks squad membership via unique GUID-based SquadId
- Manages assigned combat roles within squad hierarchy (Tank, DPS, Support, Leader, etc.)
- Issues and receives squad commands for coordinated behavior (Attack, Defend, Retreat, etc.)
- Shares threat information with squad members using configurable multipliers
- Calculates formation positions based on preset or custom slot layouts
- Supports role-based behavior modifiers (threat generation, formation priority, targeting bias)
- Integrates with difficulty system for difficulty-aware configuration selection
- Provides Blueprint-friendly delegates for command handling and membership changes
- Caches subsystem and component references for performance
- Replicates squad state to clients for synchronized display
Initialization Flow
Automatic Initialization (Default Behavior):
- Component reaches BeginPlay
- Caches reference to owner's UWCGASAICombatComp (if present)
- Caches reference to UWCGASAICombatSubsystem for squad management