Commit Graph
9 Commits
Author SHA1 Message Date
joywayer a4b9729de7 @
fix(enemy): 巡逻边缘不越界 + 卡死兜底 + Locomotion 惰性发现

- WouldBlockAhead(EnemyMovement):按请求方向从碰撞体前缘(bounds.max/min.x)
  即时射线判墙/悬崖,天然考虑碰撞体宽度;MoveHorizontal 据此夹紧前进,保证
  "碰撞体边缘停在地形边缘、不越界"。移动层夹紧与 Pace 翻向共用同一判定,
  避免"夹停却不掉头"。nav 走 MoveWithSpeed 不受影响。
- Pace 加窗口净位移卡死兜底:撞上未挂检测层的墙/卡角(含贴墙微抖)也能翻向,
  用净位移而非逐帧差以免微抖重置计数。
- EnemyBase.Locomotion 改惰性发现:关域重载下 Awake 设的实例字段可能残留
  为 null,首次访问按需补发现,编辑器/构建都不为空(此前致入口态偶发 NRE)。

PlayMode(跨调用取样,避免 Thread.Sleep 冻结主线程)验证:Pace 来回踱步、
遇边缘/墙掉头、碰撞体不越界。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@
2026-07-10 15:12:28 +08:00
joywayerandClaude Opus 4.8 6a34b42db0 fix(enemy): 终审修复——删死代码群体警戒、修 Waypoints 到达推进、补 Locomotion 缺失报错
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 14:05:56 +08:00
joywayerandClaude Opus 4.8 490329e1dc refactor(nav): 敌人移动改为物理原生架构——根治 TBM 与 Dynamic 刚体冲突
根因: NavAgent.Position setter 直接写 transform.position, TBM 段移动每帧写它, 与敌人
Dynamic 刚体(重力/碰撞)冲突(旧代码靠"NavDriving清零velocity"缓解,但对Dynamic刚体直接
写transform.position本就不推荐,易卡墙/穿透/被物理覆盖)。

根本解: 寻路降为"顾问"(只给方向),移动执行归物理:
- EnemyNavAgent.Awake 禁用 TBM.SegmentMovement(不再写 transform.position);
- FixedUpdate 改物理原生桥: 朝 PathSubGoal 写 MoveDir+MoveSpeed 由 EnemyMovement 施加
  velocity+重力执行, 到达子目标时 CompleteSegmentTraversal 推进段(原由TBM负责);
- EnemyMovement 撤掉 NavDriving 的清零velocity/只朝向门, nav方向统一走velocity移动。
保留击退/击飞/落地等全部物理反馈。

附带修 PerceptionStateMachine: 追击维持改"追逐区 OR 视野区"任一(视野los可能被墙挡漏检,
仅靠视野会导致玩家在近身追逐区内却Chase↔Patrol抖动、nav被反复Stop不移动)。

PlayMode 验证: 敌人 nav 巡逻/追击均用velocity移动(FollowPath/onSeg=True)、追击稳定无抖动。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 17:19:01 +08:00
joywayer 06048c966a feat: Add HurtBoxOwnerGuard to prevent multiple damage registrations from the same HitBox activation
- Implemented HurtBoxOwnerGuard to ensure that multiple HurtBoxes on the same character do not register damage multiple times during a single HitBox activation.
- Added custom editor for HitBox to facilitate the creation of shape colliders with HitBoxColliderProxy.
- Introduced PhysicsPerceptionSystem for enemy perception, supporting multiple detection modes including RangeCircle, BatchLOS, FanCast, and BoxCast.
- Created EnemyPatrolZone to define patrol and chase areas for enemies, allowing for shared zones among multiple enemies.
- Added BD_IsOutsideZone conditional task for Behavior Designer to check if an enemy or player is outside a defined patrol zone.
2026-06-02 16:10:44 +08:00
joywayer bcd8b0e90b feat: Update enemy AI and movement systems
- Enhanced Physics2D layer collision report with new interactions between Player and Enemy layers.
- Refactored BD_InvestigateLastKnown to streamline animation handling and improve readability.
- Simplified BD_MaintainCombatDistance by consolidating movement stop logic.
- Updated BD_MoveToPlayer to set AI phase on start.
- Improved BD_Patrol logic with better handling of stuck states and path failures.
- Enhanced BD_PatrolWaypoints to manage stuck conditions and retry logic more effectively.
- Refined BD_ReturnToHome to remove unnecessary animation calls.
- Updated BD_WalkRandom to ensure AI phase is set correctly on start.
- Improved EnemyAbilityBase to delegate target facing to the movement system.
- Enhanced EnemyBase with new movement methods for better control.
- Refactored EnemyMovement to introduce a new input system for handling movement and facing.
- Added EnemyMoveInput struct to encapsulate movement intentions.
- Updated Physics2DSettings to reflect new layer collision matrix.
- Introduced RTK CLI instructions for optimized command usage.
2026-05-29 17:01:59 +08:00
joywayer 5a0f1548ea Refactor code structure for improved readability and maintainability 2026-05-26 13:04:38 +08:00
joywayer a1b4e629aa feat: Implement Room Streaming System
- Add RoomStreamingManager to manage room loading and unloading based on player proximity.
- Create StreamingBudgetConfigSO for memory and performance budgeting of the streaming system.
- Introduce TransitionDirector to handle seamless and atmospheric fade transitions between rooms.
- Develop WorldGraph to represent room connectivity and facilitate neighbor queries and distance calculations.
- Implement RoomNode and RoomEdge classes to structure room data and connections.
2026-05-23 19:10:29 +08:00
joywayer b7baf7ad6a Add WeaponFeedback component and AddressableManagerWindow meta file
- Implemented WeaponFeedback class for handling weapon-related feedbacks such as hit effects and attack sounds.
- Added meta file for AddressableManagerWindow to manage addressable assets.
- Included a new jump.data file for profiler data.
2026-05-22 22:03:32 +08:00
joywayer f264329751 摄像机区域的架构改动 2026-05-15 14:47:24 +08:00