# Cielonos 闪避系统摄像机反馈设计方案 ## 一、现有系统分析 ### 1.1 反馈系统架构 ``` FeedbackManager ↓ FeedbackPlayer(运行时播放器) ↓ FeedbackData(ScriptableObject - 包含多个Track) ↓ FeedbackTrack(轨道 - 并行播放) ↓ FeedbackClip(片段 - 包含FeedbackAction) ↓ FeedbackActionBase(具体的反馈动作) ├── CameraRotationShakeAction ✓ ├── CameraFieldOfViewAction ✓ ├── CameraPositionShakeAction ✓ ├── RadialBlurAction ✓ ├── VignetteAction ✓ ├── TimeScaleModifierAction ✓ ├── ChromaticAberrationAction ✓ └── ... 其他后处理效果 ``` ### 1.2 闪避系统架构 ``` DodgeSubmodule ├── DodgeSource[](闪避源列表) │ ├── dodgeTime(闪避持续时间) │ ├── perfectTime(完美闪避窗口,0.2秒) │ ├── isPerfectDodging(是否处于完美闪避中) │ └── 回调方法 └── 方法 ├── ApplyDodge() ├── RemoveDodge() ├── PerfectDodge() → 触发"PerfectDodge"反馈 └── NormalDodge() → 触发"NormalDodge"反馈 PlayerAnimationSubcontroller ├── SetupDash() → 触发"Dash"反馈 └── SetupDodge() → 触发"Dodge"反馈 ``` ### 1.3 现有的闪避反馈 在 `DodgeSource.Default()` 工厂方法中,已经预设了: - **PerfectDodge** 触发: - `MMF_RadialBlur` - 径向模糊 - `MMF_AdvancedVignette` - 高级暗角 - **Dash/Dodge** 触发: - `MMF_CinemachineRotation` - 旋转震动 - `MMF_RadialBlur` - 径向模糊 --- ## 二、闪避反馈设计方案 ### 2.1 普通闪避(Dash & Dodge)的摄像机反馈 #### 设计目标 - **Dash(冲刺)**:强调速度感、移动感、动态感 - **Dodge(后撤步)**:强调突然性、灵活性、敏捷感 #### Dash(冲刺)的反馈设计 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **FOV变化** | +8° → 0°(0.3秒) | 冲刺时视野扩大,增强速度感 | | **旋转震动** | X:2° Y:1° Z:3°(0.2秒) | 轻微旋转,增加动态感 | | **径向模糊** | 中心扩散(0.25秒) | 运动模糊效果,增强速度感知 | | **色调(可选)** | 轻微偏蓝(0.2秒) | 冷色调增强速度感 | #### Dodge(后撤步)的反馈设计 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **FOV变化** | +5° → 0°(0.2秒) | 轻微扩大,比Dash弱 | | **旋转震动** | X:1° Y:0.5° Z:1.5°(0.15秒) | 比Dash更轻微 | | **径向模糊** | 中心扩散(0.15秒) | 比Dash更短促 | | **色调(可选)** | 轻微偏青(0.15秒) | 青色增强灵活感 | ### 2.2 完美闪避(Perfect Dodge)的摄像机反馈 #### 设计目标 - **强调**:时机感、成就感、满足感 - **核心**:时间扭曲 + 视觉强化 + 中心聚焦 #### Perfect Dodge 的完整反馈设计 ##### 1. 时间扭曲效果 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **时间缩放** | 0.3x → 1.0x(0.3秒) | 瞬间慢动作,然后快速恢复 | | **曲线** | 先慢后快(EaseInOut) | 自然恢复 | ##### 2. 中心聚焦效果 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **暗角强化** | 强度 0.5 → 0.2(0.4秒) | 聚焦中心,增强紧张感 | | **暗角中心** | 偏移到攻击来源方向 | 视觉引导 | | **色调偏移** | 轻微偏蓝(0.2秒) | 冷色调增强冷静感 | ##### 3. 运动模糊效果 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **径向模糊强化** | 中心到边缘(0.2秒) | 强烈的速度感 | | **模糊强度** | 0.8 → 0.0(0.3秒) | 快速衰减 | ##### 4. 色散效果 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **色差(Chromatic Aberration)** | RGB分离 0.3 → 0.0(0.25秒) | 增强视觉冲击 | | **分离中心** | 攻击来源方向 | 动态分离 | ##### 5. 相机震动 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **旋转震动** | X:3° Y:2° Z:5°(0.3秒) | 比普通闪避更强 | | **震动曲线** | QuickImpact(快速冲击) | 即时峰值,快速衰减 | ##### 6. 屏幕特效 | 效果类型 | 参数配置 | 说明 | |---------|---------|------| | **屏幕闪光** | 中心白闪光(0.1秒) | 瞬间高亮 | | **Bloom强化** | 强度+0.5(0.2秒) | 增强发光效果 | #### 完美闪避反馈时间线 ``` 时间(秒): 0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 ───────────────────────────────────────────────────────────────── 时间缩放 ████▓▒▒░░░░ 0.3x → 1.0x FOV ▓▓▓▒▒░░░░░ +8° → 0° 径向模糊 ██████▓▒░░░ 强度0.8 → 0.0 暗角 ▓▓▓▓▓▒▒░░░ 强度0.5 → 0.2 色差 ████████░░░ 分离0.3 → 0.0 屏幕闪光 ██░░░░░░░░░ 瞬间 相机震动 █████▓▒░░░░ 3°旋转 ``` --- ## 三、需要创建/完善的反馈组件 ### 3.1 现有组件(可直接使用) | 组件 | 状态 | 用途 | |------|------|------| | CameraRotationShakeAction | ✅ 已存在 | 相机旋转震动 | | CameraFieldOfViewAction | ✅ 已存在 | FOV变化 | | CameraPositionShakeAction | ✅ 已存在 | 相机位置震动 | | RadialBlurAction | ✅ 已存在 | 径向模糊 | | VignetteAction | ✅ 已存在 | 暗角效果 | | ChromaticAberrationAction | ✅ 已存在 | 色差效果 | | TimeScaleModifierAction | ✅ 已存在 | 时间缩放 | ### 3.2 需要创建的新组件 #### 1. MotionBlurAction(运动模糊) **优先级**:P0 - 必须 **功能**: - 控制运动模糊效果(SpeedLines或MotionBlur后处理) - 支持模糊强度、方向、中心点控制 **参数**: ```csharp public class MotionBlurAction : CurveShakeAction { public bool modifyDirection; // 是否修改方向 public Vector2 direction; // 模糊方向 public bool modifyStrength; // 是否修改强度 public float strengthMin; // 最小模糊强度 public float strengthMax; // 最大模糊强度 public bool modifySamples; // 是否修改采样数 public int samplesMin; // 最小采样数 public int samplesMax; // 最大采样数 } ``` #### 2. ScreenFlashAction(屏幕闪光) **优先级**:P1 - 重要 **功能**: - 控制屏幕中心的白闪光效果 - 支持颜色、强度、衰减速度控制 **参数**: ```csharp public class ScreenFlashAction : FeedbackActionBase { [Title("Flash Settings")] public Color flashColor = Color.white; public float maxIntensity = 1.0f; public AnimationCurve fadeCurve; // 衰减曲线 public bool useCenterOffset; // 是否使用中心偏移 public Vector2 centerOffset; // 中心偏移 public bool affectBloom; // 是否影响Bloom public float bloomIntensity = 0.5f; } ``` #### 3. ColorGradeAction(色调调整) **优先级**:P2 - 可选 **功能**: - 动态调整画面色调 - 支持色温、色调、对比度调整 **参数**: ```csharp public class ColorGradeAction : FeedbackActionBase { public bool modifyTemperature; // 是否修改色温 public float temperatureMin; // 冷色调(负值) public float temperatureMax; // 暖色调(正值) public bool modifyTint; // 是否修改色调 public Color tintColor; // 色调颜色 public bool modifySaturation; // 是否修改饱和度 public float saturationOffset; // 饱和度偏移 } ``` #### 4. SpeedLinesAction(速度线) **优先级**:P1 - 重要 **功能**: - 控制屏幕边缘的速度线效果 - 增强速度感和动态感 **参数**: ```csharp public class SpeedLinesAction : CurveShakeAction { [Title("Speed Lines Settings")] public bool modifyCount; // 是否修改线条数量 public int countMin; // 最小线条数 public int countMax; // 最大线条数 public bool modifyLength; // 是否修改线条长度 public float lengthMin; // 最小长度 public float lengthMax; // 最大长度 public bool modifyOpacity; // 是否修改不透明度 public float opacityMin; // 最小不透明度 public float opacityMax; // 最大不透明度 public bool modifyCenter; // 是否修改中心 public Vector2 center; // 中心点 } ``` --- ## 四、实现计划 ### 4.1 Phase 1: 普通闪避反馈(1天) #### 目标 实现 Dash 和 Dodge 的基本摄像机反馈 #### 任务 1. [ ] **创建/配置 Dash FeedbackData** - 名称:`DodgeDash` - Track 1: "Camera" - CameraFieldOfViewAction - FOV: +8° → 0°(0.3秒) - Track 2: "Camera" - CameraRotationShakeAction - Rotation: (2°, 1°, 3°) - Curve: SmoothBump - Track 3: "PostProcess" - RadialBlurAction - Intensity: 0.3 → 0.0(0.25秒) 2. [ ] **创建/配置 Dodge FeedbackData** - 名称:`DodgeBackstep` - Track 1: "Camera" - CameraFieldOfViewAction - FOV: +5° → 0°(0.2秒) - Track 2: "Camera" - CameraRotationShakeAction - Rotation: (1°, 0.5°, 1.5°) - Curve: QuickImpact - Track 3: "PostProcess" - RadialBlurAction - Intensity: 0.2 → 0.0(0.15秒) 3. [ ] **修改 PlayerAnimationSubcontroller** - SetupDash() 使用新的"DodgeDash" FeedbackData - SetupDodge() 使用新的"DodgeBackstep" FeedbackData 4. [ ] **测试调整** - 根据实际效果调整参数 - 确保Dash和Dodge有明显区别 ### 4.2 Phase 2: 完美闪避反馈(1-2天) #### 目标 实现 Perfect Dodge 的特殊摄像机反馈 #### 任务 1. [ ] **创建 ScreenFlashAction(如果尚未实现)** - 屏幕中心白闪光 - 快速衰减 2. [ ] **创建 MotionBlurAction(如果尚未实现)** - 运动模糊效果 - 支持方向和强度控制 3. [ ] **创建/配置 Perfect Dodge FeedbackData** - 名称:`PerfectDodge` - Track 1: "Time" - TimeScaleModifierAction - Mode: Dynamic - Curve: Custom(0.3x → 1.0x) - Duration: 0.3秒 - Track 2: "Camera" - CameraFieldOfViewAction - FOV: +8° → 0°(0.3秒) - Track 3: "Camera" - CameraRotationShakeAction - Rotation: (3°, 2°, 5°) - Curve: QuickImpact - Duration: 0.3秒 - Track 4: "PostProcess" - VignetteAction - Intensity: 0.5 → 0.2(0.4秒) - 中心偏移到攻击来源 - Track 5: "PostProcess" - RadialBlurAction - Intensity: 0.8 → 0.0(0.3秒) - Track 6: "PostProcess" - ChromaticAberrationAction - Intensity: 0.3 → 0.0(0.25秒) - Track 7: "Effect" - ScreenFlashAction - Color: White - Intensity: 1.0 → 0.0(0.1秒) - Track 8: "Effect" - BloomEnhanceAction(可选) - Intensity: +0.5(0.2秒) 4. [ ] **修改 DodgeSource.Default() 工厂方法** - 更新 PerfectDodge 回调逻辑 - 确保所有反馈正确触发 5. [ ] **测试调整** - 调整时间曲线 - 确保慢动作效果明显 - 优化视觉效果 ### 4.3 Phase 3: 优化和细节(1天) #### 目标 完善细节,提升品质 #### 任务 1. [ ] **添加速度线效果(SpeedLines)** - 冲刺时显示速度线 - 增强速度感 2. [ ] **添加色调调整(可选)** - Dash: 冷色调(蓝) - Dodge: 青色(青绿) - Perfect Dodge: 偏蓝 3. [ ] **创建编辑器预览工具** - 在Editor中预览闪避效果 - 快速调整参数 4. [ ] **性能优化** - 确保反馈系统不会造成性能问题 - 优化后处理效果 5. [ ] **创建反馈预设库** - Dash_Powerful(强力冲刺) - Dash_Light(轻盈冲刺) - Dodge_Quick(快速后撤) - Dodge_Strong(强力后撤) - PerfectDodge_Time(时间扭曲型) - PerfectDodge_Impact(冲击型) --- ## 五、参数配置建议 ### 5.1 Dash(冲刺) ```csharp // DodgeDash FeedbackData { // FOV FOV Offset: +8° FOV Duration: 0.3s FOV Curve: EaseOut // Rotation Shake Rotation: (2°, 1°, 3°) Duration: 0.2s Curve: SmoothBump // Radial Blur Intensity: 0.3 Duration: 0.25s Center: Dynamic (player screen position) } ``` ### 5.2 Dodge(后撤步) ```csharp // DodgeBackstep FeedbackData { // FOV FOV Offset: +5° FOV Duration: 0.2s FOV Curve: EaseOut // Rotation Shake Rotation: (1°, 0.5°, 1.5°) Duration: 0.15s Curve: QuickImpact // Radial Blur Intensity: 0.2 Duration: 0.15s Center: Dynamic (player screen position) } ``` ### 5.3 Perfect Dodge ```csharp // PerfectDodge FeedbackData { // Time Scale Time Scale: 0.3x → 1.0x Duration: 0.3s Curve: EaseInOut // FOV FOV Offset: +10° FOV Duration: 0.4s FOV Curve: EaseOut // Rotation Shake Rotation: (3°, 2°, 5°) Duration: 0.3s Curve: QuickImpact // Vignette Intensity: 0.5 → 0.2 Duration: 0.4s Center Offset: Attack direction // Radial Blur Intensity: 0.8 → 0.0 Duration: 0.3s Center: Dynamic // Chromatic Aberration Intensity: 0.3 → 0.0 Duration: 0.25s // Screen Flash Color: White Intensity: 1.0 → 0.0 Duration: 0.1s } ``` --- ## 六、实现建议 ### 6.1 创建流程 1. **创建 FeedbackData** - 在 `Resources/Feedbacks/` 目录下创建 - 命名为 `DodgeDash.asset`, `DodgeBackstep.asset`, `PerfectDodge.asset` 2. **配置 FeedbackTracks** - 为每个效果创建独立的 Track - 建议 Track 命名: - "Camera" - 相机相关效果 - "PostProcess" - 后处理效果 - "Effect" - 特殊效果 - "Time" - 时间控制 3. **添加 FeedbackClips** - 在每个 Track 中添加 Clip - 配置时间范围 - 选择对应的 FeedbackAction 4. **配置 FeedbackAction 参数** - 根据设计文档调整参数 - 使用预设曲线 - 设置正确的持续时间 5. **在代码中引用** - 在 `PlayerAnimationSubcontroller` 中引用 FeedbackData - 在 `DodgeSource` 中配置 PerfectDodge 回调 ### 6.2 代码修改建议 #### DodgeSource.Default() 工厂方法修改 ```csharp public static DodgeSource Default(CharacterBase sourceCharacter, float duration = Mathf.Infinity) { DodgeSource defaultDodge = new DodgeSource( sourceCharacter, null, "DefaultDodge", 0, "NormalDodge", "PerfectDodge", duration, 0.2f ); if (sourceCharacter is Player player) { // 普通闪避反馈 defaultDodge.onNormalDodge = () => { // 可以根据闪避类型(Dash/Dodge)播放不同的反馈 // player.feedbackSc["NormalDodge"].Play(); }; // 完美闪避反馈 defaultDodge.onPerfectDodge = () => { // 更新效果中心点 var radialBlur = player.feedbackSc["PerfectDodge"].feedback .GetFeedbackOfType(); if (radialBlur != null) { radialBlur.modifyCenter = true; radialBlur.center = player.GetNormalizedScreenPosition(); } var vignette = player.feedbackSc["PerfectDodge"].feedback .GetFeedbackOfType(); if (vignette != null) { vignette.modifyCenter = true; vignette.center = player.GetNormalizedScreenPosition(); } // 播放完美闪避反馈 player.feedbackSc["PerfectDodge"].Play(); Debug.Log("Perfect Dodge!"); }; } return defaultDodge; } ``` #### PlayerAnimationSubcontroller 修改 ```csharp // SetupDash() 中 public void SetupDash(Vector3 direction, bool isInputDirection, float length) { if (player.movementSc.canDash && player.movementSc.canDodge && fullBodyFuncAnimSm.Play("Dash")) { length = length < 0 ? player.attributeSm["DashLength"] : length; float dashMultiplier = length / fullBodyFuncAnimSm.collection["Dash"] .variableCollection.GetVariable("RootMoveZ"); player.landMovementSc.dashMoveMultiplier = dashMultiplier; // 根据方向计算相机旋转 Vector3 cameraForward = player.viewSc.playerCamera.transform.forward.Flatten(); Vector3 dashCameraRotation; if (isInputDirection) { player.landMovementSc.TurnToInputDirection(direction); Vector3 playerForward = player.transform.forward.Flatten(); dashCameraRotation = CalculateDashAngles(playerForward, cameraForward); } else { player.landMovementSc.TurnToDirection(direction, 0f); dashCameraRotation = CalculateDashAngles(direction, cameraForward); } // 配置动态参数 var rotationShake = player.feedbackSc["DodgeDash"].feedback .GetFeedbackOfType(); if (rotationShake != null) { rotationShake.directionSettings.targetDirection = direction; } // 播放 Dash 反馈 player.feedbackSc["DodgeDash"].Play(); } } // SetupDodge() 中 public void SetupDodge(float length) { if (player.movementSc.canDodge && fullBodyFuncAnimSm.Play("Dodge")) { length = length < 0 ? player.attributeSm["DodgeLength"] : length; float dashMultiplier = length / fullBodyFuncAnimSm.collection["Dodge"] .variableCollection.GetVariable("RootMoveZ"); player.landMovementSc.dashMoveMultiplier = dashMultiplier; // 配置动态参数 var rotationShake = player.feedbackSc["DodgeBackstep"].feedback .GetFeedbackOfType(); if (rotationShake != null) { rotationShake.directionSettings.targetDirection = -player.transform.forward.Flatten(); } // 播放 Dodge 反馈 player.feedbackSc["DodgeBackstep"].Play(); } } ``` --- ## 七、测试清单 ### 7.1 功能测试 - [ ] Dash 反馈正常播放 - [ ] Dodge 反馈正常播放 - [ ] Perfect Dodge 反馈正常播放 - [ ] 所有效果平滑过渡 - [ ] 无视觉抖动或撕裂 - [ [ ] 时间缩放正常工作 - [ ] 后处理效果正常工作 ### 7.2 性能测试 - [ ] 60 FPS 稳定运行 - [ ] 无内存泄漏 - [ ] Feedback 实例正确回收 - [ ] 后处理效果不影响性能 ### 7.3 体验测试 - [ ] Dash 速度感明显 - [ ] Dodge 突然性明显 - [ ] Perfect Dodge 成就感强烈 - [ ] 效果与动作匹配 - [ ] 反馈强度适中(不晕眩) --- ## 八、后续优化方向 ### 8.1 高级功能 1. **动态反馈强度** - 根据冲刺距离调整反馈强度 - 根据完美闪避时机早晚调整强度 2. **连闪避加成** - 连续完美闪避时增强反馈 - 视觉上越来越夸张 3. **敌人攻击适配** - 根据攻击类型调整反馈 - 重攻击有更强的反馈 ### 8.2 辅助功能 1. **难度设置** - 新手模式:增强反馈提示 - 高手模式:减少辅助反馈 2. **无障碍选项** - 减少运动模糊 - 减少时间缩放 - 减少屏幕效果 --- *文档生成日期: 2026-04-17* *生成者: Game Designer Agent*