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:
@@ -119,4 +119,75 @@ Manages the playback of dialogue sequences: line queuing, timing, subtitle routi
|
||||
| [`GI_GameFramework`](../01-core/04_GI_GameFramework.md) | Direct | Set game phase during dialogue |
|
||||
|
||||
### Reuse Notes
|
||||
`DA_DialogueSequence` data assets hold all content — add new sequences per project without touching this system. Voice audio is optional: sequences work without audio (text-only dialogue). Lip-sync data is per-line and can use audio-driven or procedural lip sync.
|
||||
`DA_DialogueSequence` data assets hold all content — add new sequences per project without touching this system. Voice audio is optional: sequences work without audio (text-only dialogue). Lip-sync data is per-line and can use audio-driven or procedural lip sync.
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_DialoguePlaybackSystem`
|
||||
2. Add to Player Character
|
||||
3. Define struct `S_DialogueLine`: SpeakerTag, LineText (Text), VoiceAudio (SoundBase), Duration (Float), FlagToSetOnComplete (GameplayTag), bIsChoicePoint (Boolean)
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set bIsPlaying = false, bIsPaused = false
|
||||
├─ Set LineQueue = empty Array<S_DialogueLine>
|
||||
└─ Cache: BPC_NarrativeStateSystem, SS_AudioManager (via Get Game Instance)
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `PlaySequence(Sequence: DA_DialogueSequence)` → `void`
|
||||
```
|
||||
Step 1: If bIsPlaying → QueueSequence (or return error)
|
||||
Step 2: Validate RequiredFlags: Sequence.RequiredFlags → HasAllFlags → if false, return
|
||||
Step 3: Set bIsPlaying = true
|
||||
Step 4: Load LineQueue from Sequence.Lines array (copy all lines)
|
||||
Step 5: Set CurrentLineIndex = 0
|
||||
Step 6: Fire OnDialogueStarted(Sequence.SequenceTag)
|
||||
Step 7: Call PlayNextLine()
|
||||
```
|
||||
|
||||
#### `PlayNextLine()` → `void`
|
||||
```
|
||||
Step 1: If CurrentLineIndex >= LineQueue.Length:
|
||||
Fire OnSequenceCompleted → Set bIsPlaying=false → Return
|
||||
Step 2: CurrentLine = LineQueue[CurrentLineIndex]
|
||||
Step 3: If CurrentLine.bIsChoicePoint:
|
||||
Fire OnChoicePointReached → hand to BPC_DialogueChoiceSystem → pause here
|
||||
Return (resume when choice returns NextSequenceTag)
|
||||
Step 4: Fire OnLineStarted(CurrentLine)
|
||||
Step 5: If CurrentLine.VoiceAudio valid:
|
||||
SS_AudioManager.PlayDialogue(CurrentLine.VoiceAudio)
|
||||
Step 6: Show subtitle: Fire dispatcher → WBP_SubtitleDisplay.Show(CurrentLine.LineText, SpeakerTag)
|
||||
Step 7: Set Timer (CurrentLine.Duration) → On timer: Call OnLineCompleted()
|
||||
```
|
||||
|
||||
#### `OnLineCompleted()` → `void`
|
||||
```
|
||||
Step 1: If CurrentLine.FlagToSetOnComplete valid:
|
||||
BPC_NarrativeStateSystem.SetFlag(FlagToSetOnComplete, true)
|
||||
Step 2: Fire OnLineCompleted(CurrentLine)
|
||||
Step 3: Increment CurrentLineIndex
|
||||
Step 4: Call PlayNextLine()
|
||||
```
|
||||
|
||||
#### `SkipCurrentLine()` → `void`
|
||||
```
|
||||
Step 1: Clear LineTimer
|
||||
Step 2: Stop VoiceAudio if playing
|
||||
Step 3: Fire OnLineCompleted (skip to next line)
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create BPC_DialoguePlaybackSystem, add to Player Character
|
||||
- [ ] Define S_DialogueLine struct and DA_DialogueSequence Data Asset
|
||||
- [ ] Implement PlaySequence with flag validation
|
||||
- [ ] Implement PlayNextLine with line queue + timer + audio + subtitle
|
||||
- [ ] Implement choice point handoff to DialogueChoiceSystem
|
||||
- [ ] Implement SkipCurrentLine/SkipSequence
|
||||
- [ ] Wire subtitles to WBP_SubtitleDisplay via dispatcher
|
||||
- [ ] Test: trigger dialogue → lines play sequentially → subtitles show → audio plays
|
||||
Reference in New Issue
Block a user