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:
@@ -124,4 +124,55 @@ Evaluates narrative consequences when flags change. Listens for flag changes acr
|
||||
| [`BPC_LoreUnlockSystem`](46_BPC_LoreUnlockSystem.md) | Direct | Unlock lore entries |
|
||||
|
||||
### Reuse Notes
|
||||
Consequence rules are data-driven via `DA_ConsequenceRule`, enabling designers to author branch logic without blueprint edits. The system supports both immediate and delayed consequences, allowing dramatic pacing. Priority sorting ensures critical consequences fire first. Blocking flag prevents race conditions between sequential narrative beats.
|
||||
Consequence rules are data-driven via `DA_ConsequenceRule`, enabling designers to author branch logic without blueprint edits. The system supports both immediate and delayed consequences, allowing dramatic pacing. Priority sorting ensures critical consequences fire first. Blocking flag prevents race conditions between sequential narrative beats.
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_BranchingConsequenceSystem`
|
||||
2. Add to Player Character
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set ConsequenceRules = empty array (loaded from DA_ConsequenceRule registry)
|
||||
├─ Set PendingConsequences = empty array
|
||||
├─ Set MaxConcurrentConsequences = 3
|
||||
└─ Cache: BPC_NarrativeStateSystem, BPC_DialoguePlaybackSystem, BPC_ObjectiveSystem, BPC_CutsceneBridge, BPC_LoreUnlockSystem
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `OnFlagChanged(Fage: GameplayTag, NewValue: Boolean)` → `void` *(Bind to NarrativeStateSystem.OnFlagChanged)*
|
||||
```
|
||||
Step 1: If NewValue == false → Return (only react to true flags)
|
||||
Step 2: ForEach ConsequenceRules:
|
||||
If Rule.TriggerFlag == Flag:
|
||||
Create FConsequencePayload(RuleRef=Rule, TriggerFlag=Flag, bIsImmediate=Rule.bIsImmediate, FireTime=Now+Delay)
|
||||
If bIsImmediate: Add to pending, call ProcessPendingConsequences
|
||||
Else: Add to PendingConsequences queue with timer
|
||||
```
|
||||
|
||||
#### `ProcessPendingConsequences()` → `void`
|
||||
```
|
||||
Step 1: Sort PendingConsequences by Rule.Priority (descending)
|
||||
Step 2: ForEach PendingConsequences (up to MaxConcurrentConsequences):
|
||||
Switch on Rule.ActionType:
|
||||
PlayDialogue → BPC_DialoguePlaybackSystem.PlaySequence(Rule.DialogueSequence)
|
||||
SetObjective → BPC_ObjectiveSystem.ActivateObjective(Rule.ObjectiveTag)
|
||||
UnlockLore → BPC_LoreUnlockSystem.UnlockEntry(Rule.LoreTag)
|
||||
TriggerCutscene → BPC_CutsceneBridge.PlayCutscene(Rule.CutsceneData)
|
||||
SetFlag → BPC_NarrativeStateSystem.SetFlag(Rule.FlagTag, true)
|
||||
GrantItem → BPC_InventorySystem.AddItem(Rule.ItemAsset, 1)
|
||||
Step 3: Remove processed from queue
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create component, add to Player Character
|
||||
- [ ] Bind to BPC_NarrativeStateSystem.OnFlagChanged
|
||||
- [ ] Load DA_ConsequenceRule assets into ConsequenceRules array
|
||||
- [ ] Implement OnFlagChanged: match trigger flag → create payload
|
||||
- [ ] Implement ProcessPendingConsequences with action switch
|
||||
- [ ] Create DA_ConsequenceRule Data Asset type with action enum and fields
|
||||
Reference in New Issue
Block a user