Overview
WCGASLevelingSubsystem is a Game Instance Subsystem that serves as the central coordinator for the character progression and leveling system in the Wonderscape GAS Ally plugin. It automatically initializes at game start, loads leveling rules from Project Settings, manages XP threshold calculations with performance caching, applies stat gains through Gameplay Effects, and orchestrates three distinct progression modes: Traditional RPG (automatic stat increases), Point Allocation (player-distributed points), and Souls-like (XP-based attribute purchases).
Purpose
The Leveling Subsystem orchestrates all character progression mechanics by providing:
- Automatic Initialization: Loads global leveling rules from Project Settings and initializes XP curve caching at startup
- Component Registry: Tracks all active leveling components across characters for centralized management
- XP Curve Evaluation: Calculates experience thresholds for each level with performance-optimized caching
- Multi-Mode Progression: Supports Traditional RPG, Point Allocation, and Souls-like progression systems simultaneously
- Stat Gain Application: Applies attribute increases via INSTANT Gameplay Effects with PERMANENT modifiers
- Cost Calculation: Computes XP costs for Souls-like attribute purchases with support for custom formulas
- Starting Level Configuration: Automatically configures attributes, points, and XP for characters starting above level 1
- Point Pool Management: Awards and tracks secondary point pools (skill points, talent points, etc.) for milestone-based and manual awards
- Event Broadcasting: Notifies game systems of level-ups, stat gains, and point awards via WCGASEventSubsystem
- Class Rule Evaluation: Processes multi-class configurations by combining stat gains from all matching ActorClassTags
How It Works
Initialization Flow
- Subsystem Startup: When the GameInstance initializes, this subsystem automatically loads via UE's subsystem lifecycle
- Load Global Rules: Retrieves leveling configuration from Project Settings via
UWCGASLevelingSettings::GetLevelingRulesData()