Configuration Reference

Documentation Unreal Engine AI Configuration Reference

Complete reference for all data assets: AICombatConfig, ActionSets, Movement Profiles, and Damage Config.


All data assets in one place. Link here from system pages for specific configuration details.

EnemyAIConfig

Defines combat role selection, behavior logic, and action set binding for an AI.
Config Resolution Order:
  1. SECCombatControllerComponent cached config (from DefaultAIConfig property)
  2. Pawn implementing IEnemyAIConfigProvider
Set the config on the pawn for per-enemy customization, or on the SECCombatControllerComponent's DefaultAIConfig when all units sharing a controller should use the same config.

SECCombatControllerComponent Properties

PropertyCategoryDefaultPurpose
DefaultAIConfigAI|SECnullptrFallback AI Config when pawn doesn't provide one
bAutoRegisterForCombatRolesCombat RoletrueAuto-register with the role subsystem on possession
bEnableThreatDetectionThreat ResponsetrueEnable ThreatDetectionComponent on BeginPlay

SECCombatControllerComponent Delegates

DelegatePurpose
OnCombatRoleChangedBroadcast when combat role changes (new role, old role)
OnCombatTargetLostBroadcast when assigned combat target is destroyed/unregistered
OnCombatRoleSystemReadyBroadcast after successful registration with the role subsystem. Safe to call ForceAssignRole here.

MovementBehaviorProfile Threat Response

These settings live on the MovementBehaviorProfile data asset, so they automatically change when the AI switches combat roles:
PropertyDefaultPurpose
bSwapStrafeOnHighThreatfalseSwap strafe direction when threat duration exceeded
bAdjustDistanceByThreatfalseAdjust movement distance based on threat level
ThreatDistanceScale1.0Scale factor: DistMultiplier = 1.0 + ThreatLevel * Scale

Full Structure

// Role Registration
bool AutoRegisterForCombatRoles;     // Auto-register with role subsystem
TArray<FGameplayTag> AllowedRoles;   // Roles this AI can take
int32 Priority;                       // Lower = higher priority for slots
FGameplayTag PreferredRole;           // Default role when available
 
// Fitness Evaluation
TArray<URoleEvaluator*> FitnessEvaluators;  // Scoring objects for role assignment
 
// Target Selection
UTargetSelector* TargetSelector;      // Per-AI target selector (instanced)
bool bIgnoreTargetRedistribution;     // Opt out of periodic target reshuffling
 
// Behavior
UStateTree* StateTree;                // Main AI behavior tree
 
// Action Set Management
bool ManageActionSetsAutomatically;   // Swap ActionSets based on role
UActionSet* DefaultActionSet;         // Fallback ActionSet
TMap<FGameplayTag, FRoleActionSetMapping> RoleActionSets;  // Per-role ActionSets
 
// Reaction Set Management
bool bManageReactionSetsAutomatically; // Swap ReactionSets based on role
UReactionSet* DefaultReactionSet;     // Fallback ReactionSet
TMap<FGameplayTag, FRoleReactionSetMapping> RoleReactionSets; // Per-role ReactionSets
 
// Movement Profile Management
bool ManageMovementProfilesAutomatically; // Swap Movement Profiles based on role
UMovementBehaviorProfile* DefaultMovementProfile; // Fallback Profile
TMap<FGameplayTag, FRoleMovementProfileConfig> RoleMovementProfiles; // Per-role Profiles

Example

Name: DA_SEC_CombatConfig_Default
 
CombatRole
  AutoRegisterForCombatRoles: true
 
RoleRegistration
  AllowedRoles:
    - SEC.Role.Attacker
    - SEC.Role.Flanker
    - SEC.Role.Supporter
    - SEC.Role.Waiter
  Priority: 0
  PreferredRole: SEC.Role.Attacker
 
FitnessEvaluators
  - DistanceEvaluator
  - BP_HealthEvaluator
  - BP_RandomEvaluator
 
Behavior
  StateTree: StateTree_SEC_Core
 
ActionSets
  ManageActionSetsAutomatically: true
  DefaultActionSet: DA_SEC_ActionSet_Attacker
 
RoleActionSets
  SEC.Role.Waiter   → DA_SEC_ActionSet_Waiter
  SEC.Role.Flanker  → DA_SEC_ActionSet_Flanker
  SEC.Role.Supporter → DA_SEC_ActionSet_Ranged
 
ReactionSets
  bManageReactionSetsAutomatically: true
  DefaultReactionSet: DA_SEC_ReactionSet_Default
 
RoleReactionSets
  SEC.Role.Attacker → DA_SEC_ReactionSet_Aggressive
  SEC.Role.Waiter   → DA_SEC_ReactionSet_Defensive
 
MovementProfiles
  ManageMovementProfilesAutomatically: true
  DefaultMovementProfile: DA_SEC_Movement_Aggressive
 
RoleMovementProfiles
  SEC.Role.Waiter   → DA_SEC_Movement_Passive
  SEC.Role.Flanker  → DA_SEC_Movement_Flanking
Fitness Evaluators are editor-instanced UObjects. Inherit from URoleEvaluator to create custom scoring logic for role assignment.

ActionSet

Used by: Action System
Contains an array of FActionSpec, which are all available actions for an AI.

Creating an ActionSet

  1. Right-click → Miscellaneous → Data Asset → ActionSet
  2. Add actions to the Actions array
  3. Configure each action's properties

FActionSpec Structure

struct FActionSpec
{
    // Identity
    FName Id;                          // Unique identifier
    FString DisplayName;               // Editor display name
    EActionExecutionMode ExecutionMode; // Ability or BehaviorTree
    
    // Gameplay Ability Mode
    FGameplayTag AbilityTag;           // Tag to activate ability
    FGameplayTag AbilityEndTag;        // Completion signal tag
    
    // Behavior Tree Mode
    TArray<UBehaviorTree*> BehaviorTrees;  // Sequence of BTs to run
    float BehaviorTreeTimeout;              // Max execution time
    
    // Scoring
    FRangeEval Distance;               // Optimal distance range
    FRangeEval Angle;                  // Optimal angle to target
    FRangeEval Health;                 // Optimal self-health range
    float BaseWeight;                  // Base priority multiplier
 
    // Cooldowns
    FActionCooldown Cooldown;
        float Duration;                // Time before reuse
        float WarmupCooldown;          // Starting cooldown
        float RandomDeviation;         // Randomness range
    
    // Chaining
    FName PreferredNextAction;         // Bonus for this action next
    float ChainBonusMultiplier;        // Score multiplier if chaining
    
    // Context Tags
    FGameplayTagContainer RequiredTags;// Must have these to use
    FGameplayTagContainer BlockedTags; // Cannot use if these exist
    FGameplayTagContainer AddTags;     // Added while action active
};

FRangeEval Explained

Defines a scoring curve for distance, angle, or health:
struct FRangeEval
{
    float MinValue;      // Score = 0 below this (invalid)
    float OptimalMin;    // Score = 1.0 starts here
    float OptimalMax;    // Score = 1.0 ends here
    float MaxValue;      // Score = 0 above this (invalid)
};
Visualization:
   0    100       250      400
   |-----|========|--------|
  0.0   1.0     1.0      0.0
   ↑     ↑        ↑        ↑
  Min  OptMin  OptMax    Max
Example: Melee attack valid 0-400cm, optimal 100-250cm:
Distance.MinValue = 0;
Distance.OptimalMin = 100;
Distance.OptimalMax = 250;
Distance.MaxValue = 400;

MovementBehaviorProfile

Contains all parameters for MovementEvaluatorComponent.

Full Structure

// Distance
float DesiredMinDistance;         // Approach until this close
float DesiredMaxDistance;         // Retreat if farther than this
float DistanceTolerance;          // Acceptable variance (0.0-1.0)
 
// Strafing
bool EnableStrafe;                // Allow lateral movement
bool AutoStrafeSwap;              // Randomly change direction
float StrafeSpeedPenalty;         // Speed multiplier when strafing
 
// Strafe Fatigue
bool EnableStrafeRest;            // Pause strafing periodically
float StrafeTimeLimit;            // Seconds before rest
float StrafeRestDuration;         // Rest duration
 
// Avoidance
bool EnableAvoidance;             // Avoid other pawns
float AvoidanceRadius;            // Distance to maintain
 
// Hybrid Navigation
bool EnableHybridMovement;        // Switch pathfind/direct
float HybridSwitchDistance;       // Distance threshold
 
// Custom Rules
TArray<UPositioningRule*> PositioningRules;  // Custom direction modifiers

Example Profile

Name: DA_AggressiveMelee
 
DesiredMinDistance: 200
DesiredMaxDistance: 350
DistanceTolerance: 0.15
 
EnableStrafe: true
AutoStrafeSwap: true
StrafeSpeedPenalty: 0.8
 
EnableStrafeRest: true
StrafeTimeLimit: 5.0
StrafeRestDuration: 1.0
 
EnableAvoidance: true
AvoidanceRadius: 125
 
PositioningRules: []

Built-in Presets

For quick setup without data assets:
FMovementBehaviorConfig::MakeAttacker();   // Close-range aggressive
FMovementBehaviorConfig::MakeWaiter();     // Mid-range patient
FMovementBehaviorConfig::MakeFlanker();    // Wide circling
FMovementBehaviorConfig::MakeCoward();     // Maintains distance
Positioning Rules are editor-instanced UObjects. Inherit from UPositioningRule and override EvaluateDirection() to create custom direction scoring.

DamageConfig

Contains damage values and type for melee attacks.

Full Structure

float BaseDamage;              // Base damage value
TSubclassOf<UDamageType> DamageType;  // Damage type class
float ImpulseStrength;         // Physics impulse on hit
 
bool bCanBeBlocked;            // Can target block this?
bool bCanBeParried;            // Can target parry this?
 
bool bCanCritical;             // Can this crit?
float CriticalMultiplier;      // Damage multiplier on crit
float CriticalChance;          // Base crit chance (0.0-1.0)

Example

Name: DA_SwordDamage
 
BaseDamage: 25.0
DamageType: UDamageType_Physical
ImpulseStrength: 500.0
 
bCanBeBlocked: true
bCanBeParried: true
 
bCanCritical: true
CriticalMultiplier: 2.0
CriticalChance: 0.1

Usage

Assigned to weapons via the DamageConfig property. Automatically applied during melee traces.
// In weapon Blueprint:
DamageConfig: DA_SwordDamage