Skip to main content

health Folder

Folders Index

foldercomponents
folderevents
foldersystems
foldertypes

Files Index

filehelios/engine/mechanics/health/_module.ixx

Module facade for the health system. More...

fileHealthManager.ixx

Manager for processing damage commands and emitting health events. More...

filemechanics/health/registry.ixx

Component registration for health module. More...

Description

helios::engine::mechanics::health

Health management system for game entities.

This module provides components, events, types, systems, and a manager for tracking entity health, processing damage, and handling death.

Submodules

SubmodulePurpose
HealthManagerManager that processes ApplyDamageCommands in batch during flush
components/Health-related ECS components
events/Health-related events (update, depletion)
systems/Systems for health processing
types/Bitmask enums and context structs

Architecture

1. HealthComponent tracks current/maximum health and carries behaviour flags 2. HealthManager receives ApplyDamageCommands via submit() and processes them in batch during the manager flush phase:

  • Applies damage to the target's HealthComponent
  • Pushes a HealthChangedEvent to the phase bus (available next phase)
  • On health depletion, evaluates HealthDepletedBehavior flags and optionally attaches a DeadTagComponent (flag DeadTag)
  • Pushes a HealthDepletedEvent to the pass bus (available after commit within the same pass) 3. HealthUpdateClearSystem resets the dirty flag after observers have run

Key Types

  • HealthChangeBehavior – selects the event bus for health-change reporting
  • HealthDepletedBehavior – selects actions on health depletion (event, despawn, dead-tag)
  • HealthChangeContext – carries target, source, contact point, and amount

Integration

The health system integrates with:

  • Combat systemApplyDamageCommand is routed to HealthManager
  • Scoring systemHealthDepletedEvent triggers score awards
  • Lifecycle systemGameObjectLifecycleSystem reads depletion events and despawns entities
  • Spawn system – dead entities are returned to pools via DespawnCommand


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.