# Save/Load & Death Loop — Asset Creation Sheet (9 assets)

> **UE5 Path:** `Content/Framework/Save/`

---

## C++ Already Done
- `SS_SaveManager` (35) — auto-created subsystem, no BP needed
- `I_Persistable` (36) — in `I_InterfaceLibrary.h`

---

## BP Assets to Create

### BP_Checkpoint (Actor)
**Parent:** `Actor` → Add BoxCollision (trigger)

| Variable | Type | Default |
|----------|------|---------|
| `CheckpointTag` | GameplayTag | e.g. `Framework.Save.Checkpoint.Chapter1_Start` |
| `bActivated` | Boolean | `false` |
| `SpawnTransform` | Transform | (auto-set from actor location) |

**OnOverlapBegin(Player):**
```
  ├─ If bActivated → Return
  ├─ Set bActivated = true
  ├─ Get SaveManager → CreateCheckpoint(CheckpointTag)
  ├─ Play checkpoint sound + particle effect
  └─ Show WBP_NotificationToast: "Checkpoint Reached"
```

---

### BPC_AltDeathSpaceSystem (Component)
**Attach to:** Player pawn

| Variable | Type | Default |
|----------|------|---------|
| `bInAltDeathSpace` | Boolean | `false` |
| `DeathSpaceScene` | Level | Assign |
| `ExitFound` | Boolean | `false` |

---

### BPC_DeathHandlingSystem (Component)
**Attach to:** Player pawn

| Variable | Type | Default |
|----------|------|---------|
| `DeathAnimation` | AnimMontage | Assign |
| `RespawnDelay` | Float | `3.0` |
| `bDeathSequencePlaying` | Boolean | `false` |

**Bind to:** `BPC_HealthSystem.OnDeath`

**OnDeath(Killer):**
```
  ├─ Play DeathAnimation
  ├─ Delay(3.0)
  ├─ Determine outcome:
  │   ├─ AltDeathSpace chance → EnterAltDeathSpace
  │   └─ Normal death → Call GM_CoreGameMode.HandlePlayerDead
  └─ Call BPC_RunHistoryTracker.RecordDeath
```

---

### BPC_PersistentCorpseSystem (Component)
**Attach to:** Player pawn

| Variable | Type |
|----------|------|
| `CorpsePersistenceDuration` | Float = `-1` (infinite) |
| `CorpseSnapshotData` | `Array<Byte>` |

---

### BPC_PersistentWorldStateRecorder (Component)
**Attach to:** Player pawn or GameState

| Variable | Type |
|----------|------|
| `RecordedStates` | `Array<S_WorldStateEntry>` |
| `bIsRecording` | Boolean |

---

### BPC_PlayerRespawnSystem (Component)
**Attach to:** Player pawn

| Variable | Type | Default |
|----------|------|---------|
| `LastCheckpointTag` | GameplayTag | Empty |
| `bRespawning` | Boolean | `false` |

**Respawn():**
```
  ├─ Get SaveManager → LoadCheckpoint(active slot)
  ├─ Find BP_Checkpoint with LastCheckpointTag
  ├─ Teleport player to checkpoint transform
  ├─ Restore health, clear death state
  └─ Call BPC_StateManager.RestorePreviousState
```

---

### BPC_RunHistoryTracker (Component)
**Attach to:** Player pawn

| Variable | Type |
|----------|------|
| `TotalDeaths` | Integer |
| `TotalPlayTime` | Float |
| `ChaptersCompleted` | `Array<GameplayTag>` |
| `CheckpointsReached` | `Array<GameplayTag>` |

---

## Test These
- [ ] Walk into checkpoint trigger → toast "Checkpoint Reached" → game saved
- [ ] Die → death animation plays → respawn at last checkpoint
- [ ] Alt death → void space loads → find exit → return to normal world
- [ ] Corpse persists after respawn
