BPC_DeathCauseTracker — Death Cause Tracker
Blueprint Spec — UE 5.5–5.7
Parent Class
ActorComponent
Dependencies
Purpose
Records the cause and context of the player's death for use by the death handling system, adaptive systems, and run summary. Tracks full session death history with cause type, location, instigator, timestamp, and chapter context.
1. Enums
2. Structs
S_DeathRecord
| Field |
Type |
Description |
Cause |
E_DeathCause |
How the player died |
Location |
Vector |
World position of death |
Instigator |
Actor |
What/who killed the player (nullable) |
Timestamp |
Float |
Game time of death in seconds |
ChapterTag |
GameplayTag |
Which chapter the death occurred in |
3. Variables
Configuration (Instance Editable, Expose On Spawn)
| Variable |
Type |
Default |
Category |
Description |
MaxDeathHistorySize |
Integer |
50 |
DeathTracking |
Maximum number of death records to retain |
Internal (Private / Protected, No Expose)
| Variable |
Type |
Default |
Category |
Description |
LastDeathCause |
E_DeathCause |
Unknown |
Internal |
Cause of the most recent death |
LastDeathLocation |
Vector |
(0,0,0) |
Internal |
World position of last death |
LastDeathInstigator |
Actor |
None |
Internal |
Actor that caused last death |
DeathHistory |
Array of S_DeathRecord |
Empty |
Internal |
Full session death log |
4. Functions
Public Functions
RecordDeath → void
- Description: Called when player dies. Stores cause, location, instigator, timestamp, and chapter tag into a new S_DeathRecord.
- Parameters:
| Param |
Type |
Description |
Cause |
E_DeathCause |
How the player died |
Location |
Vector |
World position of death |
Instigator |
Actor |
Killing actor (optional) |
- Blueprint Authority: Any
- Flow: Create S_DeathRecord → populate fields → add to DeathHistory → update LastDeath* variables → trim history if over MaxDeathHistorySize → broadcast OnDeathRecorded
GetLastDeathCause → E_DeathCause
- Description: Returns the cause of the most recent death.
- Parameters: None
- Blueprint Authority: Any
GetLastDeathLocation → Vector
- Description: Returns the world location of the most recent death.
- Parameters: None
- Blueprint Authority: Any
GetLastDeathInstigator → Actor
- Description: Returns the actor that caused the most recent death (may be None).
- Parameters: None
- Blueprint Authority: Any
GetDeathHistory → Array of S_DeathRecord
- Description: Returns the full death history for this session.
- Parameters: None
- Blueprint Authority: Any
GetDeathCount → Integer
- Description: Returns the total number of deaths this session.
- Parameters: None
- Blueprint Authority: Any
ClearDeathHistory → void
- Description: Empties the death history and resets last death variables. Called on new game.
- Parameters: None
- Blueprint Authority: Server only (if multiplayer)
5. Event Dispatchers
| Dispatcher |
Parameters |
Bind Access |
Description |
OnDeathRecorded |
DeathRecord: S_DeathRecord |
Public |
New death entry added to history |
OnFirstDeath |
Cause: E_DeathCause |
Public |
First death of the session (for tutorials/achievements) |
OnDeathCountThreshold |
Count: Integer |
Public |
Death count reaches a configured threshold (e.g., 10, 25, 50) |
6. Overridden Events / Custom Events
Event: OnHealthSystemDeath
- Description: Subscribes to
BPC_HealthSystemOnDeath dispatcher on BeginPlay. Routes damage event data to RecordDeath.
- Flow:
- Extract DeathCause from S_DamageEvent
- Map DamageType to E_DeathCause (Physical→Melee or Projectile, Fire→Environmental, etc.)
- Get player world location
- Call RecordDeath(Cause, Location, Instigator)
7. Blueprint Graph Logic Flow
8. Communication Matrix
9. Validation / Testing Checklist
10. Reuse Notes
- E_DeathCause can be extended per project (add new enum values)
- S_DeathRecord fields are generic enough for any genre
- MaxDeathHistorySize prevents unbounded memory growth in long sessions
- Death history is not persisted to save file by default — wire to I_Persistable if cross-session tracking needed
- ChapterTag in death record enables chapter-based analytics and adaptive tuning
Specification based on Master Section 5.8, line 1836.