MassBattle Docsv1.19.20

UMassBattleAgentConfigDataAsset

UCLASS

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

UDataAsset → UPrimaryDataAsset → UMassBattleDataAssetBase → UMassBattleAgentConfigDataAsset

公开方法 Public Methods

PostLoad virtual void (override)

资产加载后的版本门控迁移:① 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
bHideRuntimeFragmentstrue隐藏运行时 fragment(用于缓存运行时数据)。为 false 时显示全部 -ing 运行时成员。Hides runtime fragments (used to cache runtime data). When false, all -ing runtime members are shown.
bShowDebugtrue显示/隐藏 Debug fragment。Show/Hide the Debug fragment.
bShowSubTypetrue显示/隐藏 SubType fragment。Show/Hide the SubType fragment.
bShowStyleTypefalse显示/隐藏 StyleType fragment。Show/Hide the StyleType fragment.
bShowScalingtrue显示/隐藏 Scaling fragment。Show/Hide the Scaling fragment.
bShowCollidertrue显示/隐藏 Collider fragment。Show/Hide the Collider fragment.
bShowPhysicsSharedtrue显示/隐藏 PhysicsShared fragment。Show/Hide the PhysicsShared fragment.
bShowHealthtrue显示/隐藏 Health fragment。Show/Hide the Health fragment.
bShowHealthBartrue显示/隐藏 HealthBar fragment。Show/Hide the HealthBar fragment.
bShowAnimSharedtrue显示/隐藏 AnimShared fragment。Show/Hide the AnimShared fragment.
bShowCurveSharedtrue显示/隐藏 CurveShared fragment。Show/Hide the CurveShared fragment.
bShowRendertrue显示/隐藏 Render fragment。Show/Hide the Render fragment.
bShowLODSharedtrue显示/隐藏 LODShared fragment。Show/Hide the LODShared fragment.
bShowTracetrue显示/隐藏 Trace fragment。Show/Hide the Trace fragment.
bShowMovetrue显示/隐藏 Move fragment。Show/Hide the Move fragment.
bShowNavigationtrue显示/隐藏 Navigation fragment。Show/Hide the Navigation fragment.
bShowAvoidancetrue显示/隐藏 Avoidance fragment。Show/Hide the Avoidance fragment.
bShowTrafficSharedtrue显示/隐藏 TrafficShared fragment。Show/Hide the TrafficShared fragment.
bShowBehaviortrue显示/隐藏 Behavior fragment。Show/Hide the Behavior fragment.
bShowAppeartrue显示/隐藏 Appear fragment。Show/Hide the Appear fragment.
bShowSleeptrue显示/隐藏 Sleep fragment。Show/Hide the Sleep fragment.
bShowPatroltrue显示/隐藏 Patrol fragment。Show/Hide the Patrol fragment.
bShowChasetrue显示/隐藏 Chase fragment。Show/Hide the Chase fragment.
bShowReinforcetrue显示/隐藏 Reinforce fragment。Show/Hide the Reinforce fragment.
bShowReturntrue显示/隐藏 Return fragment。Show/Hide the Return fragment.
bShowAttacktrue显示/隐藏 Attack fragment。Show/Hide the Attack fragment.
bShowDamagetrue显示/隐藏 Damage fragment。Show/Hide the Damage fragment.
bShowDebufftrue显示/隐藏 Debuff fragment。Show/Hide the Debuff fragment.
bShowHittrue显示/隐藏 Hit fragment。Show/Hide the Hit fragment.
bShowTextPoptrue显示/隐藏 TextPop fragment。Show/Hide the TextPop fragment.
bShowDefencetrue显示/隐藏 Defence fragment。Show/Hide the Defence fragment.
bShowDeathtrue显示/隐藏 Death fragment。Show/Hide the Death fragment.
bShowEventtrue显示/隐藏 Event fragment。Show/Hide the Event fragment.
bShowGathertrue显示/隐藏 Gather fragment。Show/Hide the Gather fragment.
bShowSelecttrue显示/隐藏 Select fragment。Show/Hide the Select fragment.
bShowStatisticstrue显示/隐藏 Statistics fragment。Show/Hide the Statistics fragment.
bShowExtraDatatrue显示/隐藏 ExtraData fragment。Show/Hide the ExtraData fragment.
bShowControllertrue显示/隐藏 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
AgentFAgentTagVisibleAnywhere主类型标签(运行时)。Main type tag (runtime).
MainTypeFMainTypeVisibleAnywhere主类型,固定为 EEMainType::Agent。Main type, fixed to EEMainType::Agent.
DebugFAgentDebugEditAnywhere (bShowDebug)调试参数。Debug parameters.
SubTypeFSubTypeEditAnywhere (bShowSubType)子类型。Sub-type.
StyleTypeFStyleTypeEditAnywhere (bShowStyleType)风格类型。Style type.
ScalingFScalingEditAnywhere (bShowScaling)缩放。Scale.
LocatingFLocatingEditAnywhere (运行时)EditAnywhere (runtime)位置(运行时 fragment,仅展示)。Location (runtime fragment, display only).
RotatingFRotatingEditAnywhere (运行时)旋转(运行时 fragment,仅展示)。Rotation (runtime fragment, display only).
ColliderFColliderEditAnywhere (bShowCollider)胶囊碰撞体配置。Capsule collider configuration.
PhysicsSharedFPhysicsSharedEditAnywhere (bShowPhysicsShared)物理参数(PBD / 摩擦 / 空气阻力 / 压力场),同一原型 agent 共享。Physics knobs (PBD / friction / air drag / pressure-field), shared across agents of the same archetype.
HealthFHealthEditAnywhere (bShowHealth)血量。Health.
CurveSharedFCurveSharedEditAnywhere (bShowCurveShared)曲线(同一原型 agent 共享)。Curves (shared across agents of the same archetype).
EventFAgentEventEditAnywhere (bShowEvent)事件配置。不要在数据资产中设置事件接收 actor —— 应当使用 SetMassFragment 节点。Event config. Do not fill the event receiver actor in the data asset — use the SetMassFragment node instead.
EventRTFAgentEventRTVisibleAnywhere (运行时)VisibleAnywhere (runtime)事件运行时数据(仅展示)。Event runtime data (display only).
StatisticsFStatisticsEditAnywhere (bShowStatistics)数据统计。Statistics.
DeterminismFDeterminismVisibleAnywhere (运行时)确定性数据(UID / 随机流,运行时)。Determinism data (UID / random stream, runtime).
ControllerFAgentControllerEditAnywhere (bShowController)Agent 控制器配置。Agent controller config.
ControllingFAgentControllingEditAnywhere仅运行时跟踪 fragment —— 不要编辑。Runtime-only tracking fragment. Do not edit.
VisualizeFVisualizeEditAnywhere (bShowRender)渲染配置(每个 agent 独立)。Render config (per-agent).
VisualizingFVisualizingVisibleAnywhere (运行时)VisibleAnywhere (runtime)渲染运行时(绑定指针等,仅展示)。Render runtime (binding pointers etc., display only).
LODSharedFLODSharedEditAnywhere (bShowLODShared)LOD 配置(同一原型 agent 共享)。LOD configuration (shared across agents of the same archetype).
AnimSharedFAnimSharedEditAnywhere (bShowAnimShared)动画(同一原型 agent 共享)。Animation (shared across agents of the same archetype).
AnimatingFAnimatingVisibleAnywhere (运行时)动画运行时(仅展示)。Animation runtime (display only).
TraceFTraceEditAnywhere (bShowTrace)索敌配置。Trace (target acquisition) config.
TracingFTracingVisibleAnywhere (运行时)VisibleAnywhere (runtime)索敌运行时(仅展示)。Trace runtime (display only).
TracingSharedFTracingSharedVisibleAnywhere (运行时)索敌共享运行时 —— 这是一个可修改的共享 fragment(MutableSharedFragment)。Shared trace runtime — a MutableSharedFragment.
MoveFMoveEditAnywhere (bShowMove)运动配置。Movement config.
MovingFMovingVisibleAnywhere (运行时)VisibleAnywhere (runtime)运动运行时(仅展示)。Movement runtime (display only).
NavigationFNavigationEditAnywhere (bShowNavigation)寻路配置。不要在数据资产中设置流场 actor —— 应当使用 SetMassFragment 节点。Navigation config. Do not fill the flowfield actor in the data asset — use the SetMassFragment node instead.
NavigatingFNavigatingVisibleAnywhere (运行时)寻路运行时(仅展示)。Navigation runtime (display only).
AvoidanceFAvoidanceEditAnywhere (bShowAvoidance)避障配置。Avoidance config.
AvoidingFAvoidingVisibleAnywhere (运行时)VisibleAnywhere (runtime)避障运行时(仅展示)。Avoidance runtime (display only).
TrafficSharedFTrafficSharedEditAnywhere (bShowTrafficShared)交通规则(同一原型 agent 共享)。Traffic rules (shared across agents of the same archetype).
NetworkingFNetworkingVisibleAnywhere (运行时)网络运行时数据(仅展示)。Networking runtime data (exhibition only).
BehaviorFBehaviorEditAnywhere (bShowBehavior)中央行为控制面板。Central behavior control panel.
BehavingFBehavingVisibleAnywhere (运行时)VisibleAnywhere (runtime)行为运行时(仅展示)。Behavior runtime (display only).
AppearFAppearEditAnywhere (bShowAppear)出生配置。Appear config.
AppearingFAppearingVisibleAnywhere (运行时)出生运行时(仅展示)。Appear runtime (display only).
SleepFSleepEditAnywhere (bShowSleep)休眠配置。Sleep config.
PatrolFPatrolEditAnywhere (bShowPatrol)巡逻配置。Patrol config.
PatrollingFPatrollingVisibleAnywhere (运行时)VisibleAnywhere (runtime)巡逻运行时(仅展示)。Patrol runtime (display only).
ChaseFChaseEditAnywhere (bShowChase)追逐配置。Chase config.
AttackFAttackEditAnywhere (bShowAttack)攻击配置(见 Fragments/Attack.h)。Attack config (see Fragments/Attack.h).
AttackingFAttackingVisibleAnywhere (运行时)攻击运行时(仅展示)。Attack runtime (display only).
DamageFDamageEditAnywhere (bShowDamage)攻击伤害配置。Attack damage config.
DebuffFDebuffEditAnywhere (bShowDebuff)攻击减益配置。Attack debuff config.
DebuffingFDebuffingVisibleAnywhere (运行时)VisibleAnywhere (runtime)减益运行时(仅展示)。Debuff runtime (display only).
ReinforceFReinforceEditAnywhere (bShowReinforce)支援配置。Reinforce config.
ReinforcingFReinforcingVisibleAnywhere (运行时)支援运行时(仅展示)。Reinforce runtime (display only).
ReturnFReturnEditAnywhere (bShowReturn)被动反馈:静止 agent 被推离 Goal 后自动走回。Passive feedback: idle agent pushed away from its Goal walks back.
ReturningFReturningVisibleAnywhere (运行时)VisibleAnywhere (runtime)返回运行时(仅展示)。Return runtime (display only).
HitFHitEditAnywhere (bShowHit)受击配置。Hit config.
BeingHitFBeingHitVisibleAnywhere (运行时)受击运行时(仅展示)。Hit runtime (display only).
HealthBarFHealthBarEditAnywhere (bShowHealthBar)受击血条配置。Hit health bar config.
TextPopFTextPopEditAnywhere (bShowTextPop)受击数字配置。Hit damage numbers config.
DefenceFDefenceEditAnywhere (bShowDefence)受击抗性配置。Hit resistance config.
DeathFDeathEditAnywhere (bShowDeath)死亡配置。Death config.
DyingFDyingVisibleAnywhere (运行时)VisibleAnywhere (runtime)死亡运行时(仅展示)。Death runtime (display only).
GatherFGatherEditAnywhere (bShowGather)采集配置。Gather config.
GatheringFGatheringVisibleAnywhere (运行时)采集中运行时(仅展示)。Gathering runtime (display only).
SelectFSelectEditAnywhere (bShowSelect)选择配置。Select config.
BeingSelectFBeingSelectVisibleAnywhere (运行时)VisibleAnywhere (runtime)被选择运行时(仅展示)。Selection runtime (display only).
ExtraDataFMassBattleTemplateEditAnywhere (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.