Overview
WCGASAttributeModSubsystem is a Game Instance Subsystem that generates and manages runtime Gameplay Effects for automatic attribute modifications in the Wonderscape GAS Ally plugin. It automatically initializes at game start, generates modification effects from attribute definitions, caches them for efficient reuse, and provides the infrastructure for applying/removing attribute modifications where source attributes automatically influence target attributes (e.g., Constitution → MaxHealth).
Purpose
The Attribute Modification Subsystem orchestrates the automatic attribute modification system by providing:
- Automatic Effect Generation: Creates runtime Gameplay Effects at initialization from WCGASAttributeModData configurations
- Effect Caching: Stores generated effects for efficient reuse across multiple actors
- Per-ASC Tracking: Monitors which modification effects are active on each Ability System Component
- Application Management: Provides functions to apply/remove modifications individually or in bulk
- Dynamic Recalculation: Leverages GAS to automatically recalculate modifications when source attributes change
How It Works
Initialization Flow
- Subsystem Startup: When the GameInstance initializes, this subsystem automatically loads
- Registry Dependency: Ensures WCGASAttributeRegistry is initialized first via
InitializeDependency()
- Scan Attributes: Retrieves all registered attributes from the registry using
GetAllAttributes()
- Process Modifications: For each attribute with WCGASAttributeModData configured:
- Loads the AttributeModData asset synchronously
- Validates the configuration using
IsValid()
- Generates a runtime Gameplay Effect via
CreateModificationEffect()
- Caches the effect in
CachedModificationEffects map (AttributeTag → UGameplayEffect)
- Ready for Use: All effects are cached and ready to be applied to any ASC
Effect Generation
Each generated effect is configured as: