Overview
WCGASHeritageSubsystem is a Game Instance Subsystem that serves as the central registry and coordinator for the Heritage System in the Wonderscape GAS Ally plugin. It automatically initializes at game start, loads heritage validation rules from Project Settings, manages the registry of all active heritage components, coordinates class tag validation and acquisition, evaluates race and subrace bonuses for assignment, processes class-based stat gains during level-ups, handles trigger-based class progression for non-leveling events, and applies race blessings with full validation support.
Purpose
The Heritage Subsystem orchestrates all heritage-related functionality by providing:
- Automatic Initialization: Loads HeritageValidationRules asset from Project Settings at startup
- Component Registry: Maintains array of registered UWCGASHeritageComponent instances for centralized coordination
- Class Tag Validation: Validates class tag additions against prerequisites, race-class restrictions, and existing class rules
- Race Tag Validation: Validates race assignments against maximum race limits and bidirectional class-race restrictions
- Level-Up Evaluation: Calculates and combines stat gains from multiple classes during level progression using configurable combine modes
- Trigger-Based Progression: Processes non-level triggers (quests, crafting, combat milestones) for class reward evaluation
- Class Acquisition Bonuses: Applies one-time bonuses when a character acquires a new class
- Race Evaluation: Applies race bonuses at character initialization with hybrid race support and configurable combine rules
- Subrace Evaluation: Validates and applies subrace bonuses after race application
- Blessing Management: Validates, applies, and removes race blessings with full lifecycle event support
- Data Lookup Queries: Provides Blueprint-callable functions to find race data, subrace data, and blessing data by tag
How It Works
Initialization Flow
- Subsystem Startup: When the GameInstance initializes, this subsystem automatically loads via UE's subsystem lifecycle