Combat HUD

Module PulseCombatHUD (depends on PulseCombat and PulseHUD). It shows what happens in a fight: damage numbers, health bars over enemies, the player’s health bar, boss bars and screen feedback when the player gets hit. Everything is local and cosmetic; it reacts to the events of UPulseCombatComponent, which reach every machine.

The default HUD layout W_DefaultHUDWidget already contains all parts. With your own layout, add the widgets you want from /PulseCore/Combat/HUD/:

Widget Class What it does
W_DefaultFloatingTextLayer UPulseCombatFloatingTextLayer Damage and healing numbers over the hit combatants. Full screen, canvas NumberCanvas.
W_DefaultEnemyBarLayer UPulseCombatEnemyBarLayer Health bars over combatants. Full screen, canvas BarCanvas.
W_DefaultPlayerVitals UPulseCombatHealthBar (bFollowOwningPlayer) The player’s vitals: label and numbers, thin shield bar, health with trailing loss, thin stamina bar; follows respawns and stays hidden while the pawn has no health set (bHideWithoutHealth, e.g. a level without combat). Placed bottom left in W_DefaultHUDWidget.
W_DefaultPlayerHealthBar UPulseCombatHealthBar (bFollowOwningPlayer) Older, smaller player bar (health and shield); not in the default layout any more.
W_DefaultBossBarArea UPulseCombatBossBarArea Boss bars, panel BossBarBox.
W_DefaultDamageOverlay UPulseCombatDamageOverlay Red screen edges and direction indicators when the player gets hit.

All of them take their colors from the UI theme (color roles), so a game changes the look with its theme.

Damage numbers

  • Which hits show numbers: NumberVisibility in Project Settings > Pulse > Core > Combat HUD (only hits involving the local player, all, none) and the player setting Damage numbers.
  • Kinds: damage, critical (bigger, CriticalScale), damage the player took, healing, damage that only hit the shield, Immune and Blocked texts.
  • Quick hits on the same target add up in one number (MergeWindow).
  • Colors: one color role per kind and per damage type (DamageTypeColorRoles, e.g. fire → Pulse.UI.Color.Warning).
  • Own numbers or texts: Add Number on the layer (e.g. “Miss”).

Health bars

UPulseCombatHealthBar shows one combatant (Set Combatant): health, a trailing “lost health” part that shrinks after TrailDelay, optional shield and stamina, name and numbers. Bound widgets: HealthBar (required), TrailBar, ShieldBar, StaminaBar (UPulseStaminaAttributeSet, hidden without it: bHideMissingStamina), NameText, HealthText (HealthTextFormat), MaxHealthText (MaxHealthTextFormat, e.g. “/ 220” in a muted style next to the health), DetailText (Set Detail Text, e.g. the level next to an enemy’s name). Colors are roles: health (default negative, the player’s vitals positive), trail Pulse.UI.Color.BarLag, shield accent, stamina highlight. It updates on attribute changes and only ticks while the trailing part moves.

The enemy bar layer shows a bar

  • after hits involving the local player, for EnemyBarVisibleTime seconds;
  • for the lock-on target of the player’s UPulseTargetingComponent;
  • always, for combatants with Pulse Combat Health Bar (UPulseCombatHealthBarComponent) set to Always.

The component also sets a name, the height of the bar and an own bar class, or turns the bar off (Never, e.g. for bosses with a boss bar).

Boss bars

UPulseCombatHUDSubsystem* hud = UPulseCombatHUDSubsystem::Get(PlayerController);
FPulseHUDHandle bar = hud->PushBossBar(Boss, LOCTEXT("Boss", "The Shadow Warden"), /*bRemoveOnDeath*/ true);

Blueprint: Push Boss Bar / Remove Boss Bar on the combat HUD subsystem of the local player. Bars wait when more than MaxBossBars are requested and go away BossBarRemoveDelay seconds after the boss died. The call is local: in multiplayer every client pushes the bar for its own players (for example from a replicated encounter actor).

Hit feedback

A Pulse Hit Feedback data asset (UPulseHitFeedbackDefinition) says what the local player feels, separately for hits they take (Received) and deal (Dealt):

Field Effect
CameraShake, CameraShakeScale Camera shake, scaled by the hit strength and the player setting Camera shake
HitStopDuration, HitStopTimeDilation Attacker and target freeze for a moment (CustomTimeDilation, local only)
ForceFeedback Controller vibration (player setting Vibration)
Vignette, bShowDirection Screen edges and direction indicator of the damage overlay (received hits)
FullStrengthDamageFraction, MinStrength How the hit strength follows the damage relative to the maximum health

CriticalMultiplier and KillMultiplier make critical and killing blows stronger. Assign assets per damage type in the settings (HitFeedbackByDamageType, fallback DefaultHitFeedback = DA_PulseHitFeedback_Default).

Hit-stop slows the local pawn too (bHitStopAffectsLocalPawn); with Character Movement this can cause small corrections on clients, so keep it short.

Player settings

The module registers Damage numbers, Camera shake, Vibration and Hit effects (vignette, hit-stop) in the player settings (tab Interface, section Combat). Turn this off with bRegisterPlayerSettings when the game has its own options.

Events for own widgets

UPulseCombatHUDSubsystem passes on the events of every combatant of the player’s world (OnCombatantDamaged, OnCombatantHealed, OnCombatantDied, OnCombatantAdded) and OnLocalPlayerHit with the hit strength, so own widgets need no binding to each combatant.

Cheats

Command Does
PulseCombatShowcase Spawns an enemy dummy, hits it with every damage type, a critical hit and a heal, lets it hit you and shows its boss bar
PulseCombatBossBar [remove] Boss bar of the nearest combatant
PulseCombatHurtFrom [amount] The nearest combatant hits you (vignette, direction)

PulseCore plugin documentation.

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