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:
@@ -189,4 +189,65 @@ flowchart TD
|
||||
|
||||
---
|
||||
|
||||
*Specification based on Master Section 5.7, line 1821.*
|
||||
*Specification based on Master Section 5.7, line 1821.*
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_HitReactionSystem`
|
||||
2. Add to Player Character (or EnemyBase)
|
||||
3. Create HitReactionMontages per damage type: Physical, Fire, Explosive, etc.
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set CurrentTrauma = 0.0, bIsReacting = false
|
||||
├─ Populate HitReactionMontages map (E_DamageType → AnimMontage)
|
||||
├─ Cache: BPC_HealthSystem (bind OnDamageTaken), BPC_CameraStateLayer
|
||||
└─ Start TraumaDecay timer (0.1s loop)
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `ProcessHitReaction(DamageEvent: S_DamageEvent)` → `void`
|
||||
```
|
||||
Step 1: If bIsReacting → Return (already playing reaction)
|
||||
Step 2: Set LastDamageDirection = DamageEvent.HitNormal * -1 ← direction damage came from
|
||||
Step 3: If DamageEvent.Amount >= RagdollThreshold:
|
||||
Play ragdoll blend: ABP → Set bRagdoll=true, physics blend
|
||||
Set bIsReacting = true → timer to recover
|
||||
Return
|
||||
Step 4: If DamageEvent.Amount >= FlinchThreshold:
|
||||
Select montage: HitReactionMontages[DamageEvent.DamageType]
|
||||
If multiple: pick NextReactionIndex, cycle it
|
||||
Play Montage with blend from LastDamageDirection
|
||||
Set bIsReacting = true
|
||||
Step 5: Call ApplyTrauma(DamageEvent.Amount * 0.5)
|
||||
Step 6: Fire OnHitReactionPlayed(DamageEvent)
|
||||
Step 7: On montage complete → Set bIsReacting = false
|
||||
```
|
||||
|
||||
#### `ApplyTrauma(Amount: Float)` → `void`
|
||||
```
|
||||
Step 1: CurrentTrauma = Min(100, CurrentTrauma + Amount)
|
||||
Step 2: Push to camera: BPC_CameraStateLayer.ApplyPostProcessOverride(TraumaVignette, CurrentTrauma/100)
|
||||
Step 3: Fire OnTraumaChanged(CurrentTrauma)
|
||||
```
|
||||
|
||||
#### `TraumaDecay Tick` → `void` *(Timer 0.1s)*
|
||||
```
|
||||
CurrentTrauma = Max(0, CurrentTrauma - TraumaDecayRate * 0.1)
|
||||
Update camera effect intensity
|
||||
If zero: clear post-process override
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create BPC_HitReactionSystem, add to Player Character
|
||||
- [ ] Create hit reaction montages per damage type
|
||||
- [ ] Implement ProcessHitReaction with threshold branching
|
||||
- [ ] Implement ApplyTrauma with camera effect push
|
||||
- [ ] Set up trauma decay timer
|
||||
- [ ] Bind to BPC_HealthSystem.OnDamageTaken
|
||||
- [ ] Test: take small hit → flinch; take big hit → ragdoll; trauma decays over time
|
||||
@@ -49,4 +49,53 @@
|
||||
|
||||
- RecoilPattern is a CurveVector from DA_WeaponData — swap per weapon
|
||||
- For hitscan weapons, call ApplyRecoil on every shot. For projectile, call on fire release
|
||||
- Recovery runs on tick when bIsRecovering; disable tick at rest for performance
|
||||
- Recovery runs on tick when bIsRecovering; disable tick at rest for performance
|
||||
|
||||
---
|
||||
|
||||
## Manual Implementation Guide
|
||||
|
||||
### Class Setup
|
||||
1. Create Blueprint Class: Parent = `ActorComponent`, Name = `BPC_RecoilSystem`
|
||||
2. Attach to `BP_RangedWeapon` or Player Character
|
||||
3. **⚠️ Local only** — recoil is cosmetic, not replicated
|
||||
|
||||
### Variable Init (BeginPlay)
|
||||
```
|
||||
Event BeginPlay
|
||||
├─ Set CurrentRecoilOffset = (0, 0)
|
||||
├─ Set bIsRecovering = false
|
||||
├─ Read RecoilPattern from DA_WeaponData
|
||||
└─ Cache: BPC_CameraStateLayer (from Player)
|
||||
```
|
||||
|
||||
### Function Node-by-Node
|
||||
|
||||
#### `ApplyRecoil(ShotCount: Integer, bADS: Boolean)` → `void`
|
||||
```
|
||||
Step 1: Sample RecoilPattern curve at ShotCount (or accumulated counter)
|
||||
Step 2: Get curve output: Pitch = X channel, Yaw = Y channel
|
||||
Step 3: If bADS: Pitch *= ADSRecoilMultiplier, Yaw *= ADSRecoilMultiplier
|
||||
Step 4: CurrentRecoilOffset.X += Pitch, CurrentRecoilOffset.Y += Yaw
|
||||
Step 5: Push to camera:
|
||||
BPC_CameraStateLayer.AddControllerPitch(Pitch) ← or PlayCameraShake
|
||||
BPC_CameraStateLayer.AddControllerYaw(Yaw)
|
||||
Step 6: Set bIsRecovering = true
|
||||
Step 7: Set Timer (0.05s loop) → TickRecovery ← timer runs while recovering
|
||||
```
|
||||
|
||||
#### `TickRecovery(DeltaTime: Float)` → `void`
|
||||
```
|
||||
Step 1: CurrentRecoilOffset = Lerp(CurrentRecoilOffset, Vector2D(0,0), RecoverySpeed * DeltaTime)
|
||||
Step 2: If CurrentRecoilOffset nearly zero (< 0.01):
|
||||
ResetRecoil()
|
||||
Clear Recovery timer
|
||||
```
|
||||
|
||||
### Build Checklist
|
||||
- [ ] Create BPC_RecoilSystem, attach to Player
|
||||
- [ ] Create RecoilPattern CurveVector per weapon (X=pitch, Y=yaw)
|
||||
- [ ] Implement ApplyRecoil with curve sampling + ADS multiplier
|
||||
- [ ] Implement TickRecovery with lerp toward zero
|
||||
- [ ] Wire to BPC_FirearmSystem.OnFire
|
||||
- [ ] Test: fire weapon → camera kicks up → recovers to center
|
||||
Reference in New Issue
Block a user