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:
@@ -114,4 +114,75 @@ Tracks active, completed, and failed objectives. Supports main objectives, sub-o
|
||||
| [`SS_SaveManager`](../05-save/28_SS_SaveManager.md) | [`I_Persistable`](../01-core/29_I_Persistable.md) | Objective state persistence |
|
||||
|
||||
### Reuse Notes
|
||||
Define objectives via `DA_ObjectiveData` data assets (one per objective) that specify display text, dependencies, associated narrative flag, and optional/hidden flags. The objective system reads from these assets at level start. Adding a new objective type (like timed objectives) requires adding an `S_TimedObjective` struct extension and a timer function — no system redesign needed.
|
||||
Define objectives via `DA_ObjectiveData` data assets (one per objective) that specify display text, dependencies, associated narrative flag, and optional/hidden flags. The objective system reads from these assets at level start. Adding a new objective type (like timed objectives) requires adding an `S_TimedObjective` struct extension and a timer function — no system redesign needed.
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_ObjectiveSystem`
|
||||
2. Add to Player Character
|
||||
3. Define struct `S_ObjectiveState`: ObjectiveTag, Status (E_ObjectiveStatus), DisplayText (Text), Description (Text), bIsHidden (Boolean), bIsOptional (Boolean), Dependencies (Array<GameplayTag>)
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set AllObjectives = empty Map<GameplayTag, S_ObjectiveState>
|
||||
├─ Set ActiveObjectiveTags, CompletedObjectiveTags, FailedObjectiveTags = empty arrays
|
||||
└─ Get Owner → Cache BPC_NarrativeStateSystem
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `RegisterObjectiveFromDataAsset(ObjTag, DataAsset)` → `void`
|
||||
```
|
||||
Step 1: Read DA_ObjectiveData fields
|
||||
Step 2: Create S_ObjectiveState struct:
|
||||
ObjectiveTag = ObjTag, Status = Inactive
|
||||
DisplayText = DataAsset.ObjectiveText
|
||||
Dependencies = DataAsset.PrerequisiteFlags
|
||||
bIsHidden = (DataAsset.ObjectiveCategory == Hidden)
|
||||
bIsOptional = DataAsset.bIsOptional
|
||||
Step 3: AllObjectives.Add(ObjTag, newState)
|
||||
```
|
||||
|
||||
#### `ActivateObjective(ObjTag)` → `void`
|
||||
```
|
||||
Step 1: State = AllObjectives.Find(ObjTag) — if not found, return
|
||||
Step 2: If State.bIsHidden: return (hidden until revealed)
|
||||
Step 3: Call CheckDependenciesMet(ObjTag) → if not met: set Status=Inactive, return
|
||||
Step 4: State.Status = Active
|
||||
Step 5: ActiveObjectiveTags.Add Unique(ObjTag)
|
||||
Step 6: Fire OnObjectiveActivated(ObjTag, DisplayData)
|
||||
Step 7: Update GS_CoreGameState.ActiveObjectiveTags
|
||||
```
|
||||
|
||||
#### `CompleteObjective(ObjTag)` → `void`
|
||||
```
|
||||
Step 1: Validate Status == Active → if not, return
|
||||
Step 2: State.Status = Complete
|
||||
Step 3: Move: ActiveObjectiveTags.Remove(ObjTag) → CompletedObjectiveTags.Add(ObjTag)
|
||||
Step 4: Fire OnObjectiveCompleted(ObjTag)
|
||||
Step 5: Set narrative flag: BPC_NarrativeStateSystem.SetFlag(ObjTag, true)
|
||||
Step 6: Check dependent objectives: ForEach AllObjectives → if Deps include ObjTag → ActivateObjective
|
||||
```
|
||||
|
||||
#### `GetActiveObjectives()` → `Array<S_ObjectiveDisplayData>`
|
||||
```
|
||||
Create results array → ForEach ActiveObjectiveTags:
|
||||
State = AllObjectives.Find(tag)
|
||||
Create S_ObjectiveDisplayData(Tag, State.DisplayText, false, State.bIsOptional)
|
||||
Add to results
|
||||
Return results
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create BPC_ObjectiveSystem, add to Player Character
|
||||
- [ ] Define E_ObjectiveStatus enum and S_ObjectiveState struct
|
||||
- [ ] Implement RegisterObjectiveFromDataAsset
|
||||
- [ ] Implement ActivateObjective with dependency check
|
||||
- [ ] Implement CompleteObjective with cascading activation
|
||||
- [ ] Implement GetActiveObjectives for UI binding
|
||||
- [ ] Sync to GS_CoreGameState.ActiveObjectiveTags
|
||||
- [ ] Test: register objective → activate → complete → dependent activates
|
||||
Reference in New Issue
Block a user