Enhance narrative systems with detailed implementation guides and data-driven structures

- Updated BPC_NarrativeStateSystem with a comprehensive manual implementation guide, including class setup, variable initialization, and function breakdowns.
- Expanded BPC_ObjectiveSystem documentation to include a manual implementation guide and detailed function descriptions.
- Added a manual implementation guide for BPC_DialoguePlaybackSystem, outlining class setup and function nodes.
- Introduced a manual implementation guide for BPC_DialogueChoiceSystem, detailing choice presentation and selection processes.
- Enhanced BPC_BranchingConsequenceSystem documentation with a manual implementation guide for consequence evaluation.
- Updated BPC_TrialScenarioSystem with a manual implementation guide for scenario management.
- Expanded BPC_LoreUnlockSystem documentation to include a manual implementation guide for lore entry management.
- Added a manual implementation guide for BP_NarrativeTriggerVolume, detailing trigger volume setup and action execution.
- Enhanced BPC_EndingAccumulator documentation with a manual implementation guide for ending evaluation.
- Updated BPC_HitReactionSystem with a manual implementation guide for hit reaction management.
- Added a manual implementation guide for BPC_RecoilSystem, detailing recoil application and recovery processes.
- Introduced DT_ProjectTags.csv to define gameplay tags for various systems, enhancing data-driven design capabilities.
This commit is contained in:
Lefteris Notas
2026-05-19 18:48:37 +03:00
parent eeb1bf82c9
commit bec6cb715e
12 changed files with 745 additions and 11 deletions

View File

@@ -133,4 +133,66 @@ Evaluates all narrative flags accumulated throughout gameplay and determines whi
Completely data-driven. Designers create DA_EndingData assets with required flags, exclusive flags, score thresholds, and score entries. The priority system ensures specific endings (e.g., "True Ending") override general ones. The system supports both linear and score-based ending evaluation simultaneously.
- Renamed from `45_BPC_EndingAccumulatorSystem` to `BPC_EndingAccumulator` per Master naming convention.
- Cross-references updated: `BPC_CheckpointSystem``BP_Checkpoint`.
- Cross-references updated: `BPC_CheckpointSystem``BP_Checkpoint`.
---
## Manual Implementation Guide
### Class Setup
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_EndingAccumulator`
2. Add to Player Character or GameState
### Variable Init (BeginPlay)
```
Event BeginPlay
├─ Set EndingScores = empty Map<GameplayTag, Float>
├─ Load all DA_EndingData assets into EndingDefinitions array
└─ Bind to BPC_NarrativeStateSystem.OnFlagChanged
```
### Function Node-by-Node
#### `OnNarrativeFlagChanged(Flag: GameplayTag, NewValue: Boolean)` → `void`
```
Step 1: If NewValue == false → Return (only accumulate on true flags)
Step 2: ForEach EndingDefinitions:
ForEach Entry in Ending.ScoreEntries:
If Entry.FlagTag == Flag:
EndingScores[Ending.EndingTag] += Entry.Weight
Break inner loop
Step 3: Fire OnEndingScoresUpdated(EndingScores)
```
#### `EvaluateEndings()` → `DA_EndingData`
```
Step 1: QualifiedList = empty array
Step 2: ForEach EndingDefinitions:
If EndingScores[Ending.EndingTag] >= Ending.RequiredScore:
Check Ending.RequiredFlags: all set? → Add to QualifiedList
Check Ending.ExclusiveFlags: any set? → Skip
Step 3: Sort QualifiedList by Priority (descending)
Step 4: Return QualifiedList[0] (highest priority qualified ending)
```
#### `GetQualifiedEndings()` → `Array<DA_EndingData>` *(Pure)*
```
Same logic as EvaluateEndings but returns all qualified, not just best
```
#### `TriggerGameEnding(OverrideTag: GameplayTag)` → `void`
```
Step 1: If OverrideTag valid → SelectedEnding = Find(OverrideTag)
Else: SelectedEnding = EvaluateEndings()
Step 2: Fire OnGameEndingTriggered(SelectedEnding)
Step 3: GM_CoreGameMode.TriggerEnding(SelectedEnding.EndingTag)
→ initiates cutscene, game-over screen, credits
```
### Build Checklist
- [ ] Create BPC_EndingAccumulator
- [ ] Define DA_EndingData with ScoreEntries, RequiredFlags, ExclusiveFlags, RequiredScore, Priority
- [ ] Bind to NarrativeStateSystem.OnFlagChanged → accumulate scores
- [ ] Implement EvaluateEndings with qualification gating
- [ ] Wire to GM_CoreGameMode.TriggerEnding
- [ ] Test: make choices throughout game → check ending scores → trigger end → correct ending plays