Purpose:
This is an abstract base class that allows you to create custom XP progression curves for your leveling system. Instead of using built-in formulas (linear, exponential, etc.), you inherit from this class to implement your own unique XP requirements per level.
What It Does:
When you create a Blueprint or C++ child class and override the Calculate XP For Level function, this system:
- Provides access to all leveling context - base XP values, previous level thresholds, max level, and references to your full leveling rules
- Runs your custom calculation logic every time the system needs to know how much XP is required to reach a specific level
- Supports complex progression designs - logarithmic scaling, level brackets with different rates, cross-referencing stat gains, soft caps, or any mathematical formula you can implement
- Integrates seamlessly with the rest of the leveling system (XP tracking, level-up detection, stat gains)
- Validates your output and ensures Level 1 always equals 0 XP
How It's Used:
- Create a Blueprint child class (e.g.,
BP_MyCustomXPFormula) or C++ subclass
- Override
Calculate XP For Level event/function
- Implement your custom logic using the Context parameter (which contains BaseXP, PreviousThresholds array, LevelingRules reference)
- Assign your custom formula to your Leveling Rules Data Asset →
CustomXPFormula property
- The system automatically calls it during initialization and whenever XP thresholds need to be calculated
Designer-Friendly Example:
You want early levels (1-10) to require 100 XP per level, mid levels (11-50) to require exponentially more (100 × 1.15^Level), and late levels (51+) to slow down with logarithmic scaling. Instead of trying to configure this with basic formulas, you:
- Create
BP_MyComplexXPCurve inheriting from WCGASCustomXPFormula
- Override
Calculate XP For Level and add Branch nodes checking the Level input
- Return your custom formula based on which bracket the level falls into