Overview
WCGASLevelingComponent is a lightweight ActorComponent that manages per-actor leveling state and experience points. It registers with the WCGASLevelingSubsystem for centralized leveling logic while maintaining individual actor progression. The component handles XP awards, level-up detection, milestone tracking for Souls-like systems, and attribute purchase history for escalating costs.
Core Functionality
- Tracks current level and experience points for individual actors
- Awards experience and automatically detects level-ups
- Registers with WCGASLevelingSubsystem for centralized leveling rules
- Reads XP values directly from GAS attributes (source of truth)
- Tracks claimed XP milestones to prevent duplicate Souls-like rewards
- Maintains attribute purchase counts for escalating cost calculations
- Caches AbilitySystemComponent reference for performance
- Replicates leveling state for multiplayer
- Provides Blueprint-accessible queries for UI and gameplay systems
- Broadcasts level-up events via Blueprint delegates
Initialization Flow
Automatic Initialization (Default Behavior):
- Component reaches BeginPlay
bAutoInitializeOnBeginPlay = true triggers automatic initialization
- Configuration validation (ASC exists, XP attribute valid)