Skip to content

Regeneration and degeneration

Mass Forge regeneration profiles provide passive, linear attribute changes for actorless or represented Mass entities. They are opt-in and do not impose a combat formula.

Setup

  1. Define the target and optional rate attributes in the global Vital, Combat, or Support schemas.
  2. Create a Mass Forge Regeneration Profile Data Asset.
  3. Give the profile a stable ProfileId and add up to eight rules.
  4. Add Mass Forge Attributes Trait and Mass Forge Regeneration Trait to the same Mass Entity Config.
  5. Select the profile on the regeneration trait.

The regeneration trait resolves attribute names while building the entity template. Each entity then stores only domains, slots, numeric rate settings, bounds, and timing state. The processor performs no name lookup, asset loading, allocation, or delegate dispatch inside its entity loop.

Rule formula

Each completed update applies:

NewValue = CurrentValue + (ConstantRatePerSecond + RateAttributeValue × RateAttributeScale) × ElapsedSeconds

The rate-attribute term is included only when Use Rate Attribute is enabled. A negative total rate produces degeneration. If the target schema enables clamping, the new value is restricted to that schema's minimum and maximum.

Examples:

  • Health regeneration at 5 points per second: constant rate 5, no rate attribute.
  • Health regeneration driven by a stat: constant rate 2, rate attribute RegenerationPower, scale 0.25.
  • Hunger drain at 1 point per second: constant rate -1.

Tick interval

  • 0 applies the rule on every regeneration processor run.
  • A positive value accumulates time and applies complete intervals in one deterministic linear update.
  • Remainder time is retained, so variable frame lengths do not discard elapsed time.

The rate attribute is sampled when the completed interval is processed. This is intentionally a linear, low-cost policy; it does not reconstruct historical rate changes within an accumulated interval.

Validation and failure behavior

Profiles report invalid data when the ID is missing, no rules exist, more than eight rules are authored, multiple rules target the same attribute, an attribute is missing, an authored float is non-finite, or an interval is negative.

At template construction, rules whose attributes are absent from the configured schemas are skipped with an actionable log warning. If any global schema is missing, the regeneration fragment remains attached but inactive. At runtime, invalid slots or non-finite source state are ignored rather than contaminating the simulation.

Performance contract

The feature adds a fixed-capacity fragment only to entities with Mass Forge Regeneration Trait. Each fragment supports eight rules; use shared profiles to standardize authoring, but remember timing accumulators are intentionally per entity.

For adaptive scheduling, add Unreal's Simulation LOD trait and enable variable ticking. Non-due LOD chunks are skipped before entity iteration; due entities consume Unreal's full accumulated delta, while Entity Configs without variable ticking retain the ordinary per-frame path. High, Medium, Low, and Off guarantees, sampled-rate limitations, and setup are defined in the Regeneration Simulation LOD policy.

Mass Forge documentation — generated from the shipping Markdown source.