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:

  1. Provides access to all leveling context - base XP values, previous level thresholds, max level, and references to your full leveling rules
  2. Runs your custom calculation logic every time the system needs to know how much XP is required to reach a specific level
  3. Supports complex progression designs - logarithmic scaling, level brackets with different rates, cross-referencing stat gains, soft caps, or any mathematical formula you can implement
  4. Integrates seamlessly with the rest of the leveling system (XP tracking, level-up detection, stat gains)
  5. Validates your output and ensures Level 1 always equals 0 XP

How It's Used:

  1. Create a Blueprint child class (e.g., BP_MyCustomXPFormula) or C++ subclass
  2. Override Calculate XP For Level event/function
  3. Implement your custom logic using the Context parameter (which contains BaseXP, PreviousThresholds array, LevelingRules reference)
  4. Assign your custom formula to your Leveling Rules Data Asset → CustomXPFormula property
  5. 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: