MassBattle Docsv1.19.20

Loot.h

USTRUCT ×11

Source/MassBattle/Public/Fragments/Loot.h

概述 Overview

战利品实体的 fragment 集合,按「配置/运行时」与「移动模型」组织:核心配置 FLootParams(拾取/寿命/分数/碰撞/地面检测)与运行时状态 FLootParamsRT(生成者/收集者/状态机/流场/池化锁存);两种移动模型——弹道(FLootMove_Ballistic / FLootMoving_Ballistic,抛物线+反弹)与插值飞行(FLootMove_Interped_Spawn / FLootMoving_Interped_Spawn 生成路径、FLootMove_Interped_Gather / FLootMoving_Interped_Gather 收集路径——两组配置字段完全相同,仅运行时注释语境不同);乘数(FLootMultipliers 聚合弹道与插值乘数)。

Loot entity fragment set, organized as config/runtime pairs and movement models: core config FLootParams (pickup/lifespan/score/collision/ground detection) and runtime state FLootParamsRT (spawner/collector/state machine/flow field/pool latches); two movement models — ballistic (FLootMove_Ballistic / FLootMoving_Ballistic, parabola + bounce) and interped flight (FLootMove_Interped_Spawn / FLootMoving_Interped_Spawn for spawn paths, FLootMove_Interped_Gather / FLootMoving_Interped_Gather for gather paths — the two groups have identical config fields, differing only in runtime semantics); multipliers (FLootMultipliers aggregating ballistic and interped multipliers).

FLootParams USTRUCT

战利品配置 fragment,派生自 FA_MassBattleBaseFragment。所有字段为策划可调参数,运行时不变。

Loot config fragment derived from FA_MassBattleBaseFragment. All fields are designer-tunable and constant at runtime.

成员变量 Members

名称 Name类型 Type默认值说明 Description
PickupRadiusfloat100.0f拾取半径。Pickup radius.
LifeSpanfloat10.0f寿命秒数(0 = 无限)。Lifespan in seconds (0 = infinite).
ScoreValueint3210分数值。Score value.
bCanCollectbooltrue能否被收集。Can be collected?
CollectDelayfloat0.5f成为可收集前的延迟(秒)。Delay (seconds) before becoming collectible.
bDrawDebugShapeboolfalse绘制调试形状。Draw debug shapes.
bRotationFollowVelocitybooltrue旋转跟随速度。Rotation follows velocity.
InterpParamsFInterpParams—附着 FX 平滑插值参数。Interpolation parameters for attached FX smoothing.
bCollideWithObstaclesbooltrue启用与障碍物实体的碰撞(HashGrid 中的动态障碍物)。Enable collision with obstacle entities (dynamic obstacles in the HashGrid).
CollisionRadiusfloat30.0f障碍物实体碰撞半径。Collision radius for obstacle entity collision.
bDoSceneTraceboolfalse启用场景追踪以与静态几何体碰撞。Enable scene trace for collision with static geometry.
SceneTraceChannelTEnumAsByte<ECollisionChannel>ECC_WorldStatic场景碰撞检测的追踪通道。仅 bDoSceneTrace 为 true 时可编辑。Trace channel for scene collision detection. Editable only when bDoSceneTrace is true.
GroundSourceEGroundSourceFlowField地面高度检测策略(Raycast / FlowField 混合 / FlowField_Strict),枚举定义于 MassBattleEnums.h。Ground height detection strategy (Raycast / FlowField hybrid / FlowField_Strict); enum defined in MassBattleEnums.h.
GroundTraceChannelTEnumAsByte<ECollisionChannel>ECC_WorldStatic地面检测的追踪通道(射线/混合模式)。仅 GroundSource != FlowField_Strict 时可编辑。Trace channel for ground detection (raycast/hybrid mode). Editable only when GroundSource != FlowField_Strict.

FLootParamsRT USTRUCT

战利品运行时状态 fragment,派生自 FA_MassBattleBaseFragment,声明为不可平凡拷贝(含软引用)。bBornFired 为逐实体 OnBirth 锁存器——旧设计用一次性 archetype Tag(FLootBornTag)导致池复用后静默跳过 OnBirth;改用普通 bool(非位域——位域 pad 位不确定会导致 hash 折叠假失步,且非 UPROPERTY 位域无法被 FindFProperty 找到)。PoolDataAsset 记录按原型池路由。

Loot runtime state fragment derived from FA_MassBattleBaseFragment, declared not-trivially-copyable (contains soft references). bBornFired is a per-entity OnBirth latch — the old one-way archetype tag (FLootBornTag) made pool-reused loot silently skip OnBirth; a plain bool is used instead (not a bitfield — pad bits are indeterminate, causing false desync in hash folding, and non-UPROPERTY bitfields can't be found by FindFProperty). PoolDataAsset records per-archetype pool routing.

成员变量 Members

名称 Name类型 Type默认值说明 Description
SpawnerFEntityHandle—生成此战利品的实体。Entity that spawned this loot.
CollectorFEntityHandle—收集此战利品的实体。Entity collecting this loot.
StateELootStateSpawning当前状态(Spawning/Ready/BeingCollected/Collected/Expired),枚举定义于 MassBattleEnums.h。Current state (Spawning/Ready/BeingCollected/Collected/Expired); enum defined in MassBattleEnums.h.
CollectDelayTimeLeftfloat0.0f可收集前的剩余时间。Time left before collectible.
FlowFieldPtrTObjectPtr<AFlowField>nullptr用于地面检测的流场 Actor。Flow field actor for ground detection.
FlowFieldSoftPtrTSoftObjectPtr<AFlowField>nullptr流场软引用快照来源——恢复后解析为 FlowFieldPtr。Flow field soft source for snapshot restore — resolves to FlowFieldPtr after restore.
PoolDataAssetTObjectPtr<UMassBattleLootConfigDataAsset>nullptr按原型池路由:激活时设为生成该战利品所用的 DA;销毁时读取,将实体推入 LootPoolsByDataAsset[DA] 而非直接销毁。Per-archetype pool routing: set during activation to the DA used to spawn this loot; read at despawn to push the entity onto LootPoolsByDataAsset[DA] instead of destroying.
bBornFiredboolfalse逐实体 OnBirth 锁存器,保证池复用安全。在 ProcessHostOpsQueues 激活时复位为 false。快照注册表字段。Per-entity OnBirth latch for pool-reuse correctness. Reset to false at activation in ProcessHostOpsQueues. Snapshot registry field.
PoolCountdownfloat0.f逐实体池闲置倒计时。池中休眠时 TickEntityPoolCooldowns 每 MassBattle tick 递减;归零即无条件销毁(无保留下限——按原型桶可缩至 0)。每次入池(回收)复位为统一的 PoolIdleLifeSpan(UMassBattleHostSubsystem 的 ini 配置项,默认 15 秒,所有 MassBattle 池共用)。Per-entity pool idle countdown. While pooled (dormant), TickEntityPoolCooldowns decrements it each MassBattle tick; at zero the entity is destroyed unconditionally (no min floor — the per-archetype bucket can shrink to 0). Reset to the unified PoolIdleLifeSpan (an ini-config property on UMassBattleHostSubsystem, default 15 s, shared by all MassBattle pools) on every push (recycle).

FLootMove_Ballistic USTRUCT

弹道移动配置 fragment,派生自 FA_MassBattleBaseFragment。速度以范围给出,生成时随机取。

Ballistic movement config fragment derived from FA_MassBattleBaseFragment. Velocities are given as ranges, randomized at spawn.

成员变量 Members

名称 Name类型 Type默认值说明 Description
InitialVelocityXYFVector2f(200, 400)初始 XY 速度范围(最小, 最大)。Initial XY velocity range (min, max).
InitialVelocityZFVector2f(300, 600)初始 Z 速度范围(最小, 最大)。Initial Z velocity range (min, max).
Gravityfloat980.0f重力加速度。Gravity acceleration.
BounceDampingfloat0.5f反弹速度衰减因子。Bounce velocity damping factor.
MinBounceVelocityfloat50.0f继续反弹的最小速度——低于该值停止反弹。Minimum bounce velocity to continue bouncing.

FLootMoving_Ballistic USTRUCT

弹道移动运行时状态 fragment,派生自 FA_MassBattleBaseFragment。bHasSettled 为普通 bool(非位域),每 tick 门控 Spawning→Ready 转换。

Ballistic movement runtime state fragment derived from FA_MassBattleBaseFragment. bHasSettled is a plain bool (not a bitfield) gating the Spawning→Ready transition each tick.

成员变量 Members

名称 Name类型 Type默认值说明 Description
VelocityFVector3f(0,0,0)当前速度。Current velocity.
BirthTimefloat0.0f出生时间。Birth time.
bHasSettledboolfalse是否已落地。快照注册表字段。Has settled on the ground. Snapshot registry field.

FLootMove_Interped_Spawn USTRUCT

插值飞行移动配置(生成路径) fragment,派生自 FA_MassBattleBaseFragment,声明为不可平凡拷贝(含曲线)。偏移 = 曲线 × 距离映射 × 随机乘数。

Interped flight movement config (spawn path) fragment derived from FA_MassBattleBaseFragment, declared not-trivially-copyable (contains curves). Offset = curve × dist_remap × random_mult.

成员变量 Members

名称 Name类型 Type默认值说明 Description
Speedfloat1000.0f飞行速度。Flight speed.
XOffsetFRuntimeFloatCurve—X 偏移曲线。X offset curve.
YOffsetFRuntimeFloatCurve—Y 偏移曲线。Y offset curve.
ZOffsetFRuntimeFloatCurve—Z 偏移曲线。Z offset curve.
XOffsetMultFVector2f(1, 1)X 偏移乘数范围(最小, 最大)。X offset multiplier range (min, max).
YOffsetMultFVector2f(1, 1)Y 偏移乘数范围。Y offset multiplier range.
ZOffsetMultFVector2f(1, 1)Z 偏移乘数范围。Z offset multiplier range.
XOffsetRangeMapFVector4f(0,1,10000,1)X 偏移-距离映射乘数(DistMin, MultAtMin, DistMax, MultAtMax)。X offset distance mapping multiplier (DistMin, MultAtMin, DistMax, MultAtMax).
YOffsetRangeMapFVector4f(0,1,10000,1)Y 偏移-距离映射乘数。Y offset distance mapping multiplier.
ZOffsetRangeMapFVector4f(0,1,10000,1)Z 偏移-距离映射乘数。Z offset distance mapping multiplier.

FLootMoving_Interped_Spawn USTRUCT

插值飞行移动运行时状态(生成路径) fragment,派生自 FA_MassBattleBaseFragment,声明为不可平凡拷贝(含句柄)。

Interped flight movement runtime state (spawn path) fragment derived from FA_MassBattleBaseFragment, declared not-trivially-copyable (contains a handle).

成员变量 Members

名称 Name类型 Type默认值说明 Description
FromPointFVector(0,0,0)起点。Start point.
ToPointFVector(0,0,0)终点。End point.
TargetFEntityHandle—目标实体。Target entity.
StartTimefloat0.0f开始时间。Start time.
OffsetMultipliersFVector3f(1,1,1)偏移乘数(曲线 × 距离映射 × 随机乘数)。Offset multipliers (curve × dist_remap × random_mult).
InitialDistancefloat0.0f开始移动时到目标的初始距离。Initial distance to the target when movement started.
LerpProgressfloat0.0f当前插值进度(0–1)。Current lerp progress (0–1).

FLootMove_Interped_Gather USTRUCT

插值飞行移动配置(收集路径) fragment,派生自 FA_MassBattleBaseFragment,声明为不可平凡拷贝。字段与 FLootMove_Interped_Spawn 完全相同——两条路径复用同一组配置参数。

Interped flight movement config (gather path) fragment derived from FA_MassBattleBaseFragment, declared not-trivially-copyable. Fields are identical to FLootMove_Interped_Spawn — both paths share the same config parameters.

成员变量 Members

名称 Name类型 Type默认值说明 Description
Speedfloat1000.0f飞行速度。Flight speed.
XOffsetFRuntimeFloatCurve—X 偏移曲线。X offset curve.
YOffsetFRuntimeFloatCurve—Y 偏移曲线。Y offset curve.
ZOffsetFRuntimeFloatCurve—Z 偏移曲线。Z offset curve.
XOffsetMultFVector2f(1, 1)X 偏移乘数范围。X offset multiplier range.
YOffsetMultFVector2f(1, 1)Y 偏移乘数范围。Y offset multiplier range.
ZOffsetMultFVector2f(1, 1)Z 偏移乘数范围。Z offset multiplier range.
XOffsetRangeMapFVector4f(0,1,10000,1)X 偏移-距离映射乘数。X offset distance mapping multiplier.
YOffsetRangeMapFVector4f(0,1,10000,1)Y 偏移-距离映射乘数。Y offset distance mapping multiplier.
ZOffsetRangeMapFVector4f(0,1,10000,1)Z 偏移-距离映射乘数。Z offset distance mapping multiplier.

FLootMoving_Interped_Gather USTRUCT

插值飞行移动运行时状态(收集路径) fragment,派生自 FA_MassBattleBaseFragment,声明为不可平凡拷贝。字段与 FLootMoving_Interped_Spawn 相同,语义为收集阶段。

Interped flight movement runtime state (gather path) fragment derived from FA_MassBattleBaseFragment, declared not-trivially-copyable. Fields match FLootMoving_Interped_Spawn, with gather-phase semantics.

成员变量 Members

名称 Name类型 Type默认值说明 Description
FromPointFVector(0,0,0)起点(开始收集时的初始位置)。Start point (initial position when collection started).
ToPointFVector(0,0,0)终点(目标位置)。End point (target position).
TargetFEntityHandle—目标实体。Target entity.
StartTimefloat0.0f开始时间。Start time.
OffsetMultipliersFVector3f(1,1,1)偏移乘数(曲线 × 距离映射 × 随机乘数)。Offset multipliers (curve × dist_remap × random_mult).
InitialDistancefloat0.0f开始收集时到目标的初始距离。Initial distance to the target when collection started.
LerpProgressfloat0.0f当前插值进度(0–1)。Current lerp progress (0–1).

FLootMultipliers(与两个子结构) USTRUCT ×3

战利品参数乘数聚合(普通 USTRUCT,非 fragment):FLootMultipliers 聚合两种移动模型的乘数——Ballistic(缩放/分数/速度/重力)与 Interped(缩放/分数/速度)。全部默认 1(不变)。

Loot parameter multiplier aggregation (plain USTRUCTs, not fragments): FLootMultipliers aggregates multipliers of the two movement models — Ballistic (scale/score/velocity/gravity) and Interped (scale/score/speed). All default to 1 (identity).

名称 Name类型 Type默认值说明 Description
BallisticFLootMultipliers_Ballistic—抛物线乘数(ScaleMult / ScoreMult / VelocityMult / GravityMult)。Ballistic multipliers (ScaleMult / ScoreMult / VelocityMult / GravityMult).
InterpedFLootMultipliers_Interped—插值乘数(ScaleMult / ScoreMult / SpeedMult)。Interped multipliers (ScaleMult / ScoreMult / SpeedMult).

管线角色 Pipeline Role

grep 验证:FLootParamsRT / FLootMoving_* 被 MassBattleLootMonoProcessor(状态机推进:出生→可收集→收集中→收集完成,弹道/插值移动积分)、MassBattleGridUpdateProcessor(网格注册/拾取半径)、MassBattleHostMonoProcessor(宿主生命周期)、MassBattleNetworkProcessor(快照注册)、MassBattleAgentReactionProcessor / MassBattleAgentTraceProcessor(Agent 侧收集检测)与 MassBattleHostSubsystem / MassBattleLootComponent 引用。

Verified by grep: FLootParamsRT / FLootMoving_* are referenced by MassBattleLootMonoProcessor (state machine: born→ready→collecting→collected; ballistic/interped integration), MassBattleGridUpdateProcessor (grid registration/pickup radius), MassBattleHostMonoProcessor (host lifecycle), MassBattleNetworkProcessor (snapshot registration), MassBattleAgentReactionProcessor / MassBattleAgentTraceProcessor (agent-side collection detection) and MassBattleHostSubsystem / MassBattleLootComponent.