feat: Enhance Physics Perception System with new detection modes and performance optimizations
- Updated PhysicsPerceptionSystem to support seven detection modes: RangeCircle, BatchLOS, FanCast, BoxCast, Sight, RayCast, and TriggerZone. - Improved documentation for each detection mode, including performance optimization strategies. - Introduced PerceptionTriggerProxy for event-driven detection in TriggerZone slots. - Added SightBatchSystem to manage Sight slots efficiently, reducing CPU spikes during high enemy counts. - Updated SensorSlotNames to reflect new detection modes and their purposes. - Enhanced internal logic for detecting targets and managing detection events.
This commit is contained in:
@@ -16,7 +16,7 @@ namespace BaseGames.Enemies.Perception
|
||||
|
||||
/// <summary>
|
||||
/// 视线检测(BatchLOS):敌我之间无遮挡时持续为 true。
|
||||
/// 由 BatchLOSSystem 批量计算,BD_IsPlayerVisible 读取结果。
|
||||
/// 由 PhysicsPerceptionSystem 自研批量计算(OverlapCircle + 单次 Raycast),BD_IsPlayerVisible 读取结果。
|
||||
/// </summary>
|
||||
public const string LOS = "los";
|
||||
|
||||
@@ -29,5 +29,23 @@ namespace BaseGames.Enemies.Perception
|
||||
/// 远程攻击范围(RangeCircle):玩家进入时触发远程攻击条件。
|
||||
/// </summary>
|
||||
public const string AttackRange = "attack_range";
|
||||
|
||||
/// <summary>
|
||||
/// 巡逻范围(RangeCircle):定义敌人允许巡逻的地图固定区域半径。
|
||||
/// 超出此范围时触发"返回巡逻点"逻辑。
|
||||
/// </summary>
|
||||
public const string Patrol = "patrol";
|
||||
|
||||
/// <summary>
|
||||
/// 警觉半径(RangeCircle):进入此圈时敌人从待机/巡逻切换到 Alert 状态,
|
||||
/// 通常比 Aggro 小,用于区分"察觉"和"追击"两个阶段。
|
||||
/// </summary>
|
||||
public const string Alert = "alert";
|
||||
|
||||
/// <summary>
|
||||
/// 视线感知(Sight):带强制 LOS 遮挡检测的视锥传感器。
|
||||
/// 仅当目标在视野锥内且无障碍物遮挡时才触发,是"看见玩家"的核心传感器。
|
||||
/// </summary>
|
||||
public const string Sight = "sight";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user