Commit Graph
5 Commits
Author SHA1 Message Date
joywayerandClaude Opus 4.8 790595d8de fix(scaffold): 碰撞体底部对齐 y=0(原点=脚底) 修正 NavAgent 有效位置 + 追击改回nav
根因: NavAgent 用 transform 原点(0,0)判定是否在导航段上,而脚手架 CreateBodyCollider
未设 offset(碰撞体居中,底部在-size.y/2),站到地面时原点悬在导航线上方→HasValidPosition=False。
修复: AlignColliderBottomToPivot 让所有身体/HurtBox/HitBox 碰撞体底部对齐 y=0(通用规则,
角色/敌人/Boss 同理);同步修 E001 prefab 碰撞体 offset。验证: 敌人落地后 navValid=True(自动)。
追击能力改回 nav 寻路(MoveTo),不再直接移动。

注: 导航路径"跟随"仍有既有集成问题(UpdatePath 后 agent 不跟随可达路径),需另行排查。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 16:22:54 +08:00
joywayerandClaude Opus 4.8 d0f69b0599 fix(ai): E001 追击真正移动+攻击——直接水平爬行 + prefab 补挂 EnemyAiBrain
追击移动从 A* 寻路(MoveTo)改为直接朝玩家水平爬行(MoveInDirectionWithSpeed):
地面爬行怪不需寻路,且不依赖场景 NavGraph 烘焙(PathBerserker2d 在测试场景失效)。
ENM_CaoZhi prefab 补挂 EnemyAiBrain(_definitionId=E001),使对象池/prefab 生成的敌人也有AI
(此前只有脚手架场景实例有brain)。PlayMode 验证:敌人爬向玩家并接触伤害击杀。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:48:50 +08:00
joywayerandClaude Opus 4.8 6c27993e09 feat(ai): 敌人感知↔状态模型——待机/警觉/追击/巡逻 + 可复用感知状态机
感知门面 EnemyBase.InChaseZone(追逐/aggro)/InVisionZone(视野/los,缺省回退aggro),纯查询;
转换逻辑归 AI 层: 新增可复用 PerceptionStateMachine(统一规则,HasAlert/视野缺省自动降级);
规则: 未发现进视野→警觉, 进追逐→追击(委托能力), 追击脱离视野→巡逻(永不回警觉,再进视野再警觉).
EnemyStatsSO.HasAlertState 勾选项; ContactChaseAbility 改纯执行器(退出由AI中断); E001 用可复用件.
PlayMode 验证四态转换全通过.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 15:10:39 +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 5a0f1548ea Refactor code structure for improved readability and maintainability 2026-05-26 13:04:38 +08:00