Overview
WCGASRegenerationSubsystem is a Game Instance Subsystem that generates and manages runtime Gameplay Effects for automatic attribute regeneration and degeneration in the Wonderscape GAS Ally plugin. It automatically initializes at game start, generates regeneration/degeneration effects from attribute definitions, caches them for efficient reuse, and provides the infrastructure for applying/removing periodic attribute changes where attributes automatically restore or drain over time (e.g., Health regeneration, Hunger degeneration).
Purpose
The Regeneration Subsystem orchestrates the automatic regeneration and degeneration system by providing:
- Automatic Effect Generation: Creates runtime Gameplay Effects at initialization from
UWCGASAttributeDefinition regeneration/degeneration configurations
- Effect Caching: Stores generated effects for efficient reuse across multiple actors
- Per-ASC Tracking: Monitors which regeneration/degeneration effects are active on each Ability System Component
- Application Management: Provides functions to apply/remove regeneration and degeneration individually or in bulk
- Death State Handling: Automatically pauses regeneration when health reaches 0 and resumes on resurrection
- Delay Timer Management: Handles degeneration start delays when attributes are at maximum values
- Cooldown System: Applies cooldown effects when regeneration/degeneration is interrupted by blocking tags
How It Works
Initialization Flow
- Subsystem Startup: When the GameInstance initializes, this subsystem automatically loads
- Registry Dependency: Retrieves
UWCGASAttributeRegistry subsystem to access attribute definitions
- Scan Attributes: Loads all registered
UWCGASAttributeDefinition assets using the registry
- Process Regeneration: For each attribute with
bEnableRegeneration = true:
- Generates a regeneration Gameplay Effect (flat or percentage-based)
- Generates a cooldown Gameplay Effect (if
RegenerationStartDelay > 0)
- Caches effects in
CachedRegenerationEffects and CachedCooldownEffects maps
- Process Degeneration: For each attribute with
bEnableDegeneration = true:
- Generates a degeneration Gameplay Effect (flat, percentage, or curve-driven)
- Generates a cooldown Gameplay Effect (if
DegenerationResumeDelay > 0)
- Caches effects in
CachedDegenerationEffects and CachedDegenerationCooldownEffects maps