Chase.h
Source/MassBattle/Public/Fragments/Chase.h
概述Overview
追逐行为的配置 fragment(FA_MassBattleBaseFragment 派生):结束条件(AcceptanceRadius)、放弃条件(MaxChaseDistance)、移动速度乘数,以及飞行单位的 3D 追逐选项(bChaseIn3D + HeightRange)。字段全部为策划可调参数,运行时不变。
Chase-behavior config fragment (derived from FA_MassBattleBaseFragment): end condition (AcceptanceRadius), give-up condition (MaxChaseDistance), movement speed multiplier, plus 3D chasing options for flying agents (bChaseIn3D + HeightRange). All fields are designer-tunable, constant at runtime.
FChase USTRUCT
追逐配置 fragment。与索敌(FChase::bCanTrace)配合:索敌找到目标后进入追逐,距离低于 AcceptanceRadius 时结束追逐(转攻击);超过 MaxChaseDistance 触发 OnLostTarget。
Chase config fragment. Works with target tracing (FChase::bCanTrace): once a target is found the agent chases; chase ends below AcceptanceRadius (handing over to attack); exceeding MaxChaseDistance fires OnLostTarget.
成员变量Members
| 名称Name | 类型Type | 默认值 | 说明Description |
|---|---|---|---|
bEnable | bool | true | 是否启用追逐行为。Enable chase behavior. |
bCanTrace | bool | true | 是否索敌。Whether to search for enemies. |
AcceptanceRadius | float | 100.f | 与攻击目标距离低于该值时结束追逐(转入攻击)。End chase when the distance to the attack target drops below this value. |
MaxChaseDistance | float | 0.f | 追击放弃距离:Agent 到目标实时位置的 2D 距离超过该值时触发 OnLostTarget。不会清除索敌目标——若目标重新进入索敌范围,追击可恢复。<=0 禁用此放弃检查。Maximum 2D distance from the agent to the target's live location before chase gives up; fires OnLostTarget. Does NOT clear the trace target — chase can resume if the target re-enters trace radius. <=0 disables the give-up check. |
MoveSpeedMult | float | 1 | 追逐时移动速度乘数。Movement speed multiplier while chasing. |
bChaseIn3D | bool | false | 飞行单位在 3D 空间追逐目标(直接飞向目标高度)。禁用时,飞行单位在追逐时保持其配置的飞行高度。Flying agents chase in 3D (fly directly towards the target height). When disabled, flying agents maintain their configured flying height while chasing. |
HeightRange | FVector2f | (0, 10000) | 3D 追逐时距离地面的高度范围(X=Min, Y=Max)。单位使用 Z 速度/加速度保持在此范围内。仅 bChaseIn3D 时可编辑。Height range above ground when chasing in 3D (X=Min, Y=Max). The agent uses Z speed/acceleration to stay within this range. Editable only when bChaseIn3D. |
管线角色Pipeline Role
FChase 由行为/移动/追踪处理器读取(grep 验证:MassBattleAgentBehaviorProcessor、MassBattleAgentMoveProcessor / MoveProcessorFP、MassBattleAgentTraceProcessor、MassBattleAgentSubsystem 与追逐任务节点 MassBattleBPTaskAgentsChaseAttack)。行为处理器执行追逐状态机与 MaxChaseDistance 放弃判定,移动处理器按 MoveSpeedMult / bChaseIn3D 驱动运动。
FChase is read by behavior / movement / trace processors (verified by grep: MassBattleAgentBehaviorProcessor, MassBattleAgentMoveProcessor / MoveProcessorFP, MassBattleAgentTraceProcessor, MassBattleAgentSubsystem and the chase task node MassBattleBPTaskAgentsChaseAttack). The behavior processor runs the chase state machine and the MaxChaseDistance give-up check; the movement processor drives motion with MoveSpeedMult / bChaseIn3D.