Attributes

Module PulseAttributes (Gameplay Ability System). Health, shield and stamina as attribute sets with regeneration and view models, usable on their own: food that restores health, a potion, falling damage or a survival game without weapons need no combat system. The combat system (PulseCombat) builds on these sets.

Attribute sets

Set Attributes Notes
UPulseHealthAttributeSet Health, MaxHealth, Shield, MaxShield, HealthRegenRate, meta IncomingDamage, IncomingHealing Damage takes the shield first, then health. Values are clamped (health 0..MaxHealth, MaxHealth at least 1); a lower maximum pulls the current value down. Health 0 is never healed. The rules are pure functions on FPulseHealthPools (see below).
UPulseStaminaAttributeSet Stamina, MaxStamina, StaminaRegenRate For costs (normal GAS cost effects). Native event OnOutOfStamina.

Give a set to an ability system like any attribute set: a default subobject of the owner, AddAttributeSetSubobject, a PulseSkill grant, or Default Attribute Sets of the combat component (PulseCombat). Default Starting Data of the ability system component only creates sets that also have a data table. Both sets replicate to every client.

Damage and healing without combat

  • Damage: any instant effect that adds to IncomingDamage. The set reports what happened with OnDamageReceived (FPulseHealthChange: amount, shield part, health lost, shield broken, depleted, instigator, causer, location) and OnOutOfHealth once when health reaches 0. A system on top can attach own data with SetPendingPayload right before the damage is applied; it arrives as FPulseHealthChange::Payload (PulseCombat sends its FPulseDamageResult this way).
  • Healing: Pulse::Attributes::ApplyHealing (Blueprint Restore Health) or own effects that add to IncomingHealing. UPulseHealEffect takes the amount from the set-by-caller tag Pulse.Attribute.SetByCaller.Healing.
  • Regeneration: UPulseHealthRegenEffect (every 0.5 s HealthRegenRate) and UPulseStaminaRegenEffect (every 0.25 s StaminaRegenRate) are infinite effects; apply them once. The tags Pulse.Attribute.State.RegenBlocked and Pulse.Attribute.State.StaminaRegenBlocked pause them (the combat component pauses health regeneration after damage and stamina regeneration while dead).

Health rules without an ability system

FPulseHealthPools (Attributes/PulseHealthPools.h, no GAS include) holds health, maximum health, shield and maximum shield as plain values. The rules of the health set are functions in Pulse::Attributes: ClampHealth, ClampMaxHealth, ClampShield, ClampMaxShield, ClampPools, ApplyDamageToPools (shield first, never below 0, the dead take nothing; fills an FPulseHealthChange), ApplyHealingToPools (up to the maximum, the dead are not healed) and DescribeAppliedDamage. Targets without an ability system (build pieces, resource nodes) use them for the same behavior. The set plans with them and reports the values it reads back, so duration and infinite modifiers count (a temporary shield that stays above 0 is not broken). Specs: PulseAttributes.Pools.

Replication: the sets replicate with the push model. Ability system writes, base value changes (PostAttributeBaseChange) and InitFromMetaDataTable (Init Stats) mark the attributes; code that calls an Init<Attribute> accessor after the first replication must mark the attribute itself (MARK_PROPERTY_DIRTY), or set it through the ability system instead.

View models

UMVVMPulseAttribute shows one attribute of any set (Attribute, optional MaxAttribute): Value, MaxValue, Percent. With the Pulse Player View Model Resolver it follows the player’s pawn, also after respawns; SetSource shows any actor. When an actor gets its ability system later, call Pulse::Attributes::NotifyAbilitySystemReady so view models bind (the combat component does it by itself). HasAttribute (field notify) tells whether the source has an attribute set with Attribute, so a bar can hide without it; the Pulse Attribute Bar of Status effects and attribute bars is built on this view model.


PulseCore plugin documentation.

This site uses Just the Docs, a documentation theme for Jekyll.