Purpose:

This is the calculation engine that automatically handles percentage-based regeneration effects (like health regenerating at 2% of max health per second). It performs complex math that combines your max attribute value, a percentage rate, and a regeneration modifier - something that can't be done with standard Gameplay Ability System attribute references alone.

What It Does:

When the regeneration system creates percentage-based regeneration for attributes (like Health, Mana, or Stamina), this calculator:

  1. Captures the max value of the attribute being regenerated (for example, MaxHealth = 500)
  2. Reads the percentage rate configured for the regeneration (for example, 2% per second)
  3. Captures the regeneration modifier attribute if one exists (for example, HealthRegeneration = 1.5 for 150% regen rate)
  4. Performs the multiplication to calculate how much should regenerate per tick: (MaxValue × Percentage) × RegenerationModifier
  5. Returns the regeneration amount that gets added to your attribute each tick
  6. Automatically recalculates whenever the max value or regeneration modifier changes

How It's Used:

You never interact with this class directly as a designer. The WCGASRegenerationSubsystem automatically uses this calculator when you configure percentage-based regeneration in your RegenerationConfig settings. The system sets it up dynamically at runtime and the Gameplay Ability System calls it automatically during each regeneration tick.

Designer-Friendly Example:

If you configure Health to regenerate at 2% of MaxHealth per second, and a character has MaxHealth=500 and HealthRegeneration=1.5, this calculator automatically computes: (500 × 0.02) × 1.5 = 15 health per second. If MaxHealth increases to 600, it instantly recalculates to 18 health per second. If HealthRegeneration drops to 0.5 (like during combat), it recalculates to 6 health per second.