UMassBattleAgentConfigDataAsset
Source/MassBattle/Public/DataAssets/MassBattleAgentConfigDataAsset.h
概述 Overview
agent 单位的配置数据资产,派生自 UMassBattleDataAssetBase。以扁平 fragment 成员的形式承载 agent 的全部策划可调参数:主/子/风格类型、碰撞体、物理、血量、曲线、事件、统计、控制器、渲染/LOD/动画、索敌、移动、寻路、避障、交通规则、行为面板(Appear/Sleep/Patrol/Chase/Attack/Damage/Debuff/Reinforce)、反应面板(Return/Hit/HealthBar/TextPop/Defence/Death/Gather/Select)与补充数据。两类字段:Fragment Visibility 开关(36 个 bool,控制编辑器折叠面板显隐,EditConditionHides)与fragment 成员(运行时经 UMassBattleAgentSubsystem::MakeAgentTemplateDataFromDataAsset 组装进实体模板)。运行时状态 fragment(带 -ing 后缀,如 FAttacking)为 BlueprintReadOnly + VisibleAnywhere,受 bHideRuntimeFragments 门控仅展示。PostLoad 执行版本门控的 FX 配置迁移(1.20.1 子类型枚举→索引、1.20.2 风格枚举→索引)。
Agent configuration data asset, derived from UMassBattleDataAssetBase. Carries all designer-tunable agent parameters as flat fragment members: main/sub/style types, collider, physics, health, curves, events, statistics, controller, render/LOD/animation, trace, move, navigation, avoidance, traffic rules, behavior panel (Appear/Sleep/Patrol/Chase/Attack/Damage/Debuff/Reinforce), reaction panel (Return/Hit/HealthBar/TextPop/Defence/Death/Gather/Select), and extra data. Two field kinds: Fragment Visibility toggles (36 bools controlling editor foldout visibility via EditConditionHides) and fragment members (assembled into the entity template at runtime by UMassBattleAgentSubsystem::MakeAgentTemplateDataFromDataAsset). Runtime-state fragments (the -ing suffix ones, e.g. FAttacking) are BlueprintReadOnly + VisibleAnywhere, gated for display only by bHideRuntimeFragments. PostLoad runs version-gated FX config migrations (1.20.1 subtype enum→index, 1.20.2 style enum→index).
继承 Inheritance
公开方法 Public Methods
资产加载后的版本门控迁移:① DataVersion < 12001 时对 Appear/Attack/Hit/Death/Select 五处 SpawnFx 执行 MigrateFxConfigSubType(EESubType 枚举 → int32 SubType_Index),置版本 12001 并 MarkPackageDirty();② DataVersion < 12002 时对同样五处执行 MigrateFxConfigStyleType(EEStyleType 枚举 → int32 StyleType_Index),置版本 12002 并 MarkPackageDirty()。
Version-gated post-load migration: ① when DataVersion < 12001, runs MigrateFxConfigSubType (EESubType enum → int32 SubType_Index) on the five SpawnFx sites in Appear/Attack/Hit/Death/Select, sets version 12001 and calls MarkPackageDirty(); ② when DataVersion < 12002, runs MigrateFxConfigStyleType (EEStyleType enum → int32 StyleType_Index) on the same five sites, sets version 12002 and calls MarkPackageDirty().
Input
无参数。
No parameters.
Output
无返回值。副作用:按需迁移 FX 配置、推进 DataVersion、标记资产脏。
No return value. Side effects: migrates FX configs when needed, advances DataVersion, marks the asset dirty.
成员变量 Members
Fragment Visibility 开关 Fragment Visibility Toggles
全部为 bool(默认 true,bShowStyleType 与 bHideRuntimeFragments 除外),控制下方 fragment 成员在资产编辑器中的显隐(EditConditionHides)。
All are bool (default true, except bShowStyleType and bHideRuntimeFragments), controlling the visibility of the fragment members below in the asset editor (EditConditionHides).
| 名称 Name | 默认值 | 说明 Description |
|---|---|---|
bHideRuntimeFragments | true | 隐藏运行时 fragment(用于缓存运行时数据)。为 false 时显示全部 -ing 运行时成员。Hides runtime fragments (used to cache runtime data). When false, all -ing runtime members are shown. |
bShowDebug | true | 显示/隐藏 Debug fragment。Show/Hide the Debug fragment. |
bShowSubType | true | 显示/隐藏 SubType fragment。Show/Hide the SubType fragment. |
bShowStyleType | false | 显示/隐藏 StyleType fragment。Show/Hide the StyleType fragment. |
bShowScaling | true | 显示/隐藏 Scaling fragment。Show/Hide the Scaling fragment. |
bShowCollider | true | 显示/隐藏 Collider fragment。Show/Hide the Collider fragment. |
bShowPhysicsShared | true | 显示/隐藏 PhysicsShared fragment。Show/Hide the PhysicsShared fragment. |
bShowHealth | true | 显示/隐藏 Health fragment。Show/Hide the Health fragment. |
bShowHealthBar | true | 显示/隐藏 HealthBar fragment。Show/Hide the HealthBar fragment. |
bShowAnimShared | true | 显示/隐藏 AnimShared fragment。Show/Hide the AnimShared fragment. |
bShowCurveShared | true | 显示/隐藏 CurveShared fragment。Show/Hide the CurveShared fragment. |
bShowRender | true | 显示/隐藏 Render fragment。Show/Hide the Render fragment. |
bShowLODShared | true | 显示/隐藏 LODShared fragment。Show/Hide the LODShared fragment. |
bShowTrace | true | 显示/隐藏 Trace fragment。Show/Hide the Trace fragment. |
bShowMove | true | 显示/隐藏 Move fragment。Show/Hide the Move fragment. |
bShowNavigation | true | 显示/隐藏 Navigation fragment。Show/Hide the Navigation fragment. |
bShowAvoidance | true | 显示/隐藏 Avoidance fragment。Show/Hide the Avoidance fragment. |
bShowTrafficShared | true | 显示/隐藏 TrafficShared fragment。Show/Hide the TrafficShared fragment. |
bShowBehavior | true | 显示/隐藏 Behavior fragment。Show/Hide the Behavior fragment. |
bShowAppear | true | 显示/隐藏 Appear fragment。Show/Hide the Appear fragment. |
bShowSleep | true | 显示/隐藏 Sleep fragment。Show/Hide the Sleep fragment. |
bShowPatrol | true | 显示/隐藏 Patrol fragment。Show/Hide the Patrol fragment. |
bShowChase | true | 显示/隐藏 Chase fragment。Show/Hide the Chase fragment. |
bShowReinforce | true | 显示/隐藏 Reinforce fragment。Show/Hide the Reinforce fragment. |
bShowReturn | true | 显示/隐藏 Return fragment。Show/Hide the Return fragment. |
bShowAttack | true | 显示/隐藏 Attack fragment。Show/Hide the Attack fragment. |
bShowDamage | true | 显示/隐藏 Damage fragment。Show/Hide the Damage fragment. |
bShowDebuff | true | 显示/隐藏 Debuff fragment。Show/Hide the Debuff fragment. |
bShowHit | true | 显示/隐藏 Hit fragment。Show/Hide the Hit fragment. |
bShowTextPop | true | 显示/隐藏 TextPop fragment。Show/Hide the TextPop fragment. |
bShowDefence | true | 显示/隐藏 Defence fragment。Show/Hide the Defence fragment. |
bShowDeath | true | 显示/隐藏 Death fragment。Show/Hide the Death fragment. |
bShowEvent | true | 显示/隐藏 Event fragment。Show/Hide the Event fragment. |
bShowGather | true | 显示/隐藏 Gather fragment。Show/Hide the Gather fragment. |
bShowSelect | true | 显示/隐藏 Select fragment。Show/Hide the Select fragment. |
bShowStatistics | true | 显示/隐藏 Statistics fragment。Show/Hide the Statistics fragment. |
bShowExtraData | true | 显示/隐藏 ExtraData fragment。Show/Hide the ExtraData fragment. |
bShowController | true | 显示/隐藏 Controller fragment。Show/Hide the Controller fragment. |
Fragment 成员 Fragment Members
配置 fragment 为 EditAnywhere 且受对应可见性开关门控;运行时 fragment(-ing 后缀)为 VisibleAnywhere + BlueprintReadOnly,受 bHideRuntimeFragments 门控。Shared 类型(PhysicsShared / CurveShared / LODShared / AnimShared / TrafficShared)为同一原型 agent 共享。
Config fragments are EditAnywhere gated by their visibility toggles; runtime fragments (-ing suffix) are VisibleAnywhere + BlueprintReadOnly, gated by bHideRuntimeFragments. Shared types (PhysicsShared / CurveShared / LODShared / AnimShared / TrafficShared) are shared across agents of the same archetype.
| 名称 Name | 类型 Type | 可见性 Visibility | 说明 Description |
|---|---|---|---|
Agent | FAgentTag | VisibleAnywhere | 主类型标签(运行时)。Main type tag (runtime). |
MainType | FMainType | VisibleAnywhere | 主类型,固定为 EEMainType::Agent。Main type, fixed to EEMainType::Agent. |
Debug | FAgentDebug | EditAnywhere (bShowDebug) | 调试参数。Debug parameters. |
SubType | FSubType | EditAnywhere (bShowSubType) | 子类型。Sub-type. |
StyleType | FStyleType | EditAnywhere (bShowStyleType) | 风格类型。Style type. |
Scaling | FScaling | EditAnywhere (bShowScaling) | 缩放。Scale. |
Locating | FLocating | EditAnywhere (运行时)EditAnywhere (runtime) | 位置(运行时 fragment,仅展示)。Location (runtime fragment, display only). |
Rotating | FRotating | EditAnywhere (运行时) | 旋转(运行时 fragment,仅展示)。Rotation (runtime fragment, display only). |
Collider | FCollider | EditAnywhere (bShowCollider) | 胶囊碰撞体配置。Capsule collider configuration. |
PhysicsShared | FPhysicsShared | EditAnywhere (bShowPhysicsShared) | 物理参数(PBD / 摩擦 / 空气阻力 / 压力场),同一原型 agent 共享。Physics knobs (PBD / friction / air drag / pressure-field), shared across agents of the same archetype. |
Health | FHealth | EditAnywhere (bShowHealth) | 血量。Health. |
CurveShared | FCurveShared | EditAnywhere (bShowCurveShared) | 曲线(同一原型 agent 共享)。Curves (shared across agents of the same archetype). |
Event | FAgentEvent | EditAnywhere (bShowEvent) | 事件配置。不要在数据资产中设置事件接收 actor —— 应当使用 SetMassFragment 节点。Event config. Do not fill the event receiver actor in the data asset — use the SetMassFragment node instead. |
EventRT | FAgentEventRT | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 事件运行时数据(仅展示)。Event runtime data (display only). |
Statistics | FStatistics | EditAnywhere (bShowStatistics) | 数据统计。Statistics. |
Determinism | FDeterminism | VisibleAnywhere (运行时) | 确定性数据(UID / 随机流,运行时)。Determinism data (UID / random stream, runtime). |
Controller | FAgentController | EditAnywhere (bShowController) | Agent 控制器配置。Agent controller config. |
Controlling | FAgentControlling | EditAnywhere | 仅运行时跟踪 fragment —— 不要编辑。Runtime-only tracking fragment. Do not edit. |
Visualize | FVisualize | EditAnywhere (bShowRender) | 渲染配置(每个 agent 独立)。Render config (per-agent). |
Visualizing | FVisualizing | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 渲染运行时(绑定指针等,仅展示)。Render runtime (binding pointers etc., display only). |
LODShared | FLODShared | EditAnywhere (bShowLODShared) | LOD 配置(同一原型 agent 共享)。LOD configuration (shared across agents of the same archetype). |
AnimShared | FAnimShared | EditAnywhere (bShowAnimShared) | 动画(同一原型 agent 共享)。Animation (shared across agents of the same archetype). |
Animating | FAnimating | VisibleAnywhere (运行时) | 动画运行时(仅展示)。Animation runtime (display only). |
Trace | FTrace | EditAnywhere (bShowTrace) | 索敌配置。Trace (target acquisition) config. |
Tracing | FTracing | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 索敌运行时(仅展示)。Trace runtime (display only). |
TracingShared | FTracingShared | VisibleAnywhere (运行时) | 索敌共享运行时 —— 这是一个可修改的共享 fragment(MutableSharedFragment)。Shared trace runtime — a MutableSharedFragment. |
Move | FMove | EditAnywhere (bShowMove) | 运动配置。Movement config. |
Moving | FMoving | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 运动运行时(仅展示)。Movement runtime (display only). |
Navigation | FNavigation | EditAnywhere (bShowNavigation) | 寻路配置。不要在数据资产中设置流场 actor —— 应当使用 SetMassFragment 节点。Navigation config. Do not fill the flowfield actor in the data asset — use the SetMassFragment node instead. |
Navigating | FNavigating | VisibleAnywhere (运行时) | 寻路运行时(仅展示)。Navigation runtime (display only). |
Avoidance | FAvoidance | EditAnywhere (bShowAvoidance) | 避障配置。Avoidance config. |
Avoiding | FAvoiding | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 避障运行时(仅展示)。Avoidance runtime (display only). |
TrafficShared | FTrafficShared | EditAnywhere (bShowTrafficShared) | 交通规则(同一原型 agent 共享)。Traffic rules (shared across agents of the same archetype). |
Networking | FNetworking | VisibleAnywhere (运行时) | 网络运行时数据(仅展示)。Networking runtime data (exhibition only). |
Behavior | FBehavior | EditAnywhere (bShowBehavior) | 中央行为控制面板。Central behavior control panel. |
Behaving | FBehaving | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 行为运行时(仅展示)。Behavior runtime (display only). |
Appear | FAppear | EditAnywhere (bShowAppear) | 出生配置。Appear config. |
Appearing | FAppearing | VisibleAnywhere (运行时) | 出生运行时(仅展示)。Appear runtime (display only). |
Sleep | FSleep | EditAnywhere (bShowSleep) | 休眠配置。Sleep config. |
Patrol | FPatrol | EditAnywhere (bShowPatrol) | 巡逻配置。Patrol config. |
Patrolling | FPatrolling | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 巡逻运行时(仅展示)。Patrol runtime (display only). |
Chase | FChase | EditAnywhere (bShowChase) | 追逐配置。Chase config. |
Attack | FAttack | EditAnywhere (bShowAttack) | 攻击配置(见 Fragments/Attack.h)。Attack config (see Fragments/Attack.h). |
Attacking | FAttacking | VisibleAnywhere (运行时) | 攻击运行时(仅展示)。Attack runtime (display only). |
Damage | FDamage | EditAnywhere (bShowDamage) | 攻击伤害配置。Attack damage config. |
Debuff | FDebuff | EditAnywhere (bShowDebuff) | 攻击减益配置。Attack debuff config. |
Debuffing | FDebuffing | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 减益运行时(仅展示)。Debuff runtime (display only). |
Reinforce | FReinforce | EditAnywhere (bShowReinforce) | 支援配置。Reinforce config. |
Reinforcing | FReinforcing | VisibleAnywhere (运行时) | 支援运行时(仅展示)。Reinforce runtime (display only). |
Return | FReturn | EditAnywhere (bShowReturn) | 被动反馈:静止 agent 被推离 Goal 后自动走回。Passive feedback: idle agent pushed away from its Goal walks back. |
Returning | FReturning | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 返回运行时(仅展示)。Return runtime (display only). |
Hit | FHit | EditAnywhere (bShowHit) | 受击配置。Hit config. |
BeingHit | FBeingHit | VisibleAnywhere (运行时) | 受击运行时(仅展示)。Hit runtime (display only). |
HealthBar | FHealthBar | EditAnywhere (bShowHealthBar) | 受击血条配置。Hit health bar config. |
TextPop | FTextPop | EditAnywhere (bShowTextPop) | 受击数字配置。Hit damage numbers config. |
Defence | FDefence | EditAnywhere (bShowDefence) | 受击抗性配置。Hit resistance config. |
Death | FDeath | EditAnywhere (bShowDeath) | 死亡配置。Death config. |
Dying | FDying | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 死亡运行时(仅展示)。Death runtime (display only). |
Gather | FGather | EditAnywhere (bShowGather) | 采集配置。Gather config. |
Gathering | FGathering | VisibleAnywhere (运行时) | 采集中运行时(仅展示)。Gathering runtime (display only). |
Select | FSelect | EditAnywhere (bShowSelect) | 选择配置。Select config. |
BeingSelect | FBeingSelect | VisibleAnywhere (运行时)VisibleAnywhere (runtime) | 被选择运行时(仅展示)。Selection runtime (display only). |
ExtraData | FMassBattleTemplate | EditAnywhere (bShowExtraData) | 补充数据。Extra data. |
管线角色 Pipeline Role
加载时 PostLoad 执行版本门控 FX 迁移;运行期由 UMassBattleAgentSubsystem::MakeAgentTemplateDataFromDataAsset 把 fragment 成员组装进 FMassEntityTemplateData,再经 UMassBattleAgentComponent::SpawnAgentFromTemplateAtTransform(本地路径)或 AgentComponent.Spawn 锁步指令(双端)生成实体;生成后组件调用 SyncAgentTagsAndController 同步标签。锁步指令载荷以数据资产路径(GetPathName)引用本资产,指令执行端按路径解析。
On load PostLoad runs the version-gated FX migrations; at runtime UMassBattleAgentSubsystem::MakeAgentTemplateDataFromDataAsset assembles the fragment members into FMassEntityTemplateData, which is then spawned via UMassBattleAgentComponent::SpawnAgentFromTemplateAtTransform (local path) or the AgentComponent.Spawn lockstep command (both peers); after spawn the component calls SyncAgentTagsAndController to sync tags. Lockstep command payloads reference this asset by path (GetPathName), resolved by the command-execution side.