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 /PulseGameplay/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 attribute (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.

Without a layout of the UI host

A UI host without a layout of its own (the default presenter of Pulse Foundation, or a game presenter) shows none of these widgets by itself. UPulseCombatHUDSubsystem adds them to the gameplay part of the UI host when a placement in Project Settings > Pulse > Gameplay > Combat HUD (category Added By Code, FPulseUIGameplayWidgetPlacement) has Add By Code on, once the host is ready and again after every map change; a widget of that class the host already shows is used instead. All are off by default, because W_DefaultHUDWidget contains them.

Setting Default widget Where
FloatingTextLayerPlacement W_DefaultFloatingTextLayer Whole screen (bFill)
EnemyBarLayerPlacement W_DefaultEnemyBarLayer Whole screen (bFill)
DamageOverlayPlacement W_DefaultDamageOverlay Whole screen (bFill)
BossBarAreaPlacement W_DefaultBossBarArea Top center, 48 px from the edge
PlayerVitalsPlacement W_DefaultPlayerVitals Bottom left, 32 px from the corner; the host is searched for this class itself (a health bar class would also find the enemy bars)

Specs: PulseCombatHUD.Placement.

Damage numbers

  • Which hits show numbers: NumberVisibility in Project Settings > Pulse > Gameplay > 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 (Pulse.Stat.Stamina, hidden while the source does not know 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 bar reads HealthAttribute, ShieldAttribute and StaminaAttribute (default Pulse.Stat.Health, .Shield, .Stamina) through Pulse Attribute Value view models (UMVVMPulseAttributeValue of Pulse Foundation; Get Health View Model gives the one of the health), so it shows any attribute source: the GAS adapter with the sets of PulseAttributes, the Pulse Attributes component of a target without an ability system, or a source that comes later. The fill is the percent of the source between its bounds; a value above a lowered maximum shows as full. A rate of the source (stamina coming back) moves the bar without a change event. A Pulse Combat Health Bar component on the combatant can name another pool as its health (HealthAttribute). Without a combat component the combatant counts as dead while its health is depleted, and the bar fires On Died / On Revived on that change. bHideWithoutHealth hides the bar of the owning player (bFollowOwningPlayer) while the source of the pawn does not know the health attribute.

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; none while the player wants less motion (accessibility setting Reduce motion)
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. Hit-stop is cosmetic: on a listen server it never slows actors the server simulates for others (the pawns of clients, AI), only the own pawn and proxies of other machines (Pulse::Combat::HUD::CanApplyHitStop); alone (standalone) it slows both sides.

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.

Switching it off. UPulseCombatHUDSubsystem is switchable: add it to Disabled Subsystems (Project Settings > Pulse > Foundation > Subsystems) when your game brings its own combat HUD. Damage numbers, enemy and boss bars and the hit feedback then stay away. See Replacing and switching off subsystems.

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)

PulseGameplay plugin documentation.

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