Skip to main content
forge-combat owns the damage pipeline. As of v0.2 it no longer keeps its own HP ledger: health is HELIX native health. Every combatant is an actor with an HCharacterHealthComponent, and forge-combat drives it through the documented native globals (DamageTarget, HealTarget, GetHealth, IsDeadOrDying, …). Damage is still pure Lua and needs no cooked assets. The package is decoupled from rewards: it fires events and lets content react.
This reverses the old ADR-0001 “FORGE HP is authoritative, native health neutralized via SetEntityInvincible” model. Native health is now the single source of truth; forge-combat is a thin, testable driver over it. Player downed/respawn UX lives in forge-health.

Concepts

  • Combat id. A character_id for players; NPCs use their own id and register a pawn.
  • Native-backed vs entity pool. Player pawns take damage through native DamageTarget. Native DamageTarget is ignored on AI (NPC) pawns, so an NPC can opt into a session-only Lua HP pool by passing { hp = N } to RegisterCombatant. Pool combatants take damage/heal/death entirely in Lua; the pawn stays registered for position, FX and ragdoll. The pool is not persisted.
  • Damage validators. A veto chain: registered validators (friendly fire, invulnerability) can block a hit before it lands. Pass ctx = { attacker, spec } to DealDamage to run it.
  • Health and armor are separate pools. Native damage absorbs into armor before health; both are surfaced (armor gets its own HUD bar). HELIX has no runtime max-health setter, so SetMaxHP above the native base is represented as armor.
  • Death is an event. For NPCs, reaching 0 fires died inline. For players, downed is enabled, so a player at 0 goes downed (not dead); real death arrives from the native machine (bleed-out, give-up, lethal) via the delegate bridge, avoiding a double died.

Exports

HP verbs

Combatants, validators, archetypes

Events

Native access (DamageTarget, GetHealth, the death/downed delegates) goes through injectable seams (H.PawnFor, H.Api.*), so combat logic is unit-tested headless with an in-memory fake component, no live world needed.

Configuration

forge-combat ships no content; these are fallback tunables used when a native max can’t be read.

See also