Mass Battle Frameworkv1.20.0

BoneShared.h

USTRUCT ×2

Source/MassBattle/Public/Fragments/BoneShared.h

概述Overview

骨骼域的本单位能力:作者编写的布娃娃参数、烘焙出的 socket 清单,以及把瞄准骨名绑定到骨架的两个烘焙骨下标。它在 Agent 配置里以 Bone Shared 条目出现。布娃娃的刚体表与关节表不在这里——它们是体量大的烘焙数据,住在 ATT 资产上。

The bone-domain capability of one unit: the authored ragdoll tuning, the socket inventory discovered by the bake, and the two baked bone indices that bind the aim bone names to the skeleton. It appears as the Bone Shared entry on the agent config. The ragdoll body and joint tables are not here — they are bulk baked data and live on the ATT asset.

FRagdollShared USTRUCT

一个单位的三个布娃娃作者参数,收成一段,Details 面板因此只显示一个可折叠的 Ragdoll 块。只有寿命、刚体阻尼与 launch 初速按单位填写;每批尸体上限与跨尸体配对距离挂在渲染器上,摩擦、两个休眠阈值与休眠延迟是固定的求解器常量。

The three authored ragdoll knobs of one unit, grouped so the Details panel shows a single collapsible Ragdoll block. Only lifetime, body damping and launch speed are per-unit; the per-batch corpse cap and the cross-corpse pairing distance live on the renderer, while contact friction, the two sleep thresholds and the sleep delay are fixed solver constants.

成员变量Members

名称Name类型Type默认值说明Description
RagdollMaxSecondsfloat5 秒s单具尸体最多模拟多少秒,超过即强制休眠,以便按计划回收;0 = 不设上限。Maximum seconds one corpse simulates before it is forced to sleep so it can be retired on schedule;0 = no limit.
RagdollDampingfloat0.2尸体多快安静下来:线速度每秒衰减比例,取值 0 到 1。角速度按此值的两倍衰减,接触摩擦是固定的求解器常量。How quickly a corpse settles: per-second decay of linear velocity, 0 to 1. Angular velocity decays at twice this rate; contact friction is a fixed solver constant.
RagdollLaunchSpeedfloat300 cm/s播种帧沿致命一击方向(FDying.HitDirection)附加的速度,尸体因此朝致命一击传播的方向飞出。Speed added along the killing blow's direction (FDying.HitDirection) on the frame the ragdoll is seeded, so the corpse flies the way the blow travelled.

FBoneShared USTRUCT

每模板一份的共享片段(FA_MassBattleBaseSharedFragment 派生),分三部分持有:烘出的 socket 清单、作者编写的布娃娃块、两个烘焙出的瞄准关节骨下标。相同的取值会在模板之间合并成同一份片段。

The per-template shared fragment (derived from FA_MassBattleBaseSharedFragment) in three parts: the baked socket inventory, the authored ragdoll block, and the two baked aim-joint bone indices. Identical values are merged into one shared fragment across templates.

成员变量Members

名称Name类型Type默认值说明Description
SocketsTArray<FName>空empty只读,烘焙产物。源骨骼网格上的每个 socket,按名字字典序排列;每次 Generate 都由烘焙重写。首次烘焙前、或网格没有 socket 时为空。这些轨迹只服务生成点的 socket 解析——运行期附着与骨骼跟随都不读它们。Read-only, produced by the bake. Every socket on the source skeletal mesh, in lexicographic name order, rewritten by the bake on every Generate. Empty before the first bake or when the mesh carries no sockets. These tracks serve spawn-origin socket resolution only — runtime attachment and bone-follow read none of them.
RagdollFRagdollShared—作者编写的布娃娃块:寿命、刚体阻尼与 launch 初速。Details 面板把它显示为一组。The authored ragdoll block: lifetime, body damping and launch speed. The Details panel shows it as one group.

边界与注意Caveats

socket 清单为空不代表「关掉了 socket」。它表示还没有烘焙过,或源网格本身没有 socket——不是作者的选择。

An empty socket inventory does not mean sockets are turned off. It means no bake has run yet, or the source mesh carries no sockets — it is not an authoring choice.

布娃娃由 notify 行触发,没有单位级开关。要某个单位倒地时模拟布娃娃,给它的 notify 表加一行 Action = Ragdoll;该动作只在单位处于死亡过程中时生效。每批尸体上限与配对距离在渲染器上,摩擦与休眠阈值/延迟是求解器常量,都不在这里。

The ragdoll is triggered by a notify row; there is no per-unit switch. To simulate a ragdoll when a unit goes down, add a row with Action = Ragdoll to its notify table; the action only takes effect while the unit is dying. The per-batch corpse cap and pairing distance live on the renderer, and friction plus the sleep thresholds and delay are solver constants — none of them here.

两个瞄准骨下标是烘焙产物,不可编辑。烘焙按 Aim 配置上的骨名解析出它们;偏航下标没有解析出来(骨名留空、骨架没有这根骨,或还没有烘焙)时,瞄准关节保持关闭。俯仰下标没有解析出来时,单位被当成没有俯仰关节,攻击的俯仰一侧不构成约束。

The two aim bone indices are bake output and cannot be edited. The bake resolves them from the bone names on the Aim config. When the yaw index is unresolved (empty name, bone absent, or no bake yet) the aim joint stays off. When the pitch index is unresolved the unit is treated as having no pitch joint, so the pitch side of the attack gate is vacuous.

调参不会串到别的单位。socket 清单、布娃娃块与两个骨下标全部参与值相等:任一项不同的两个单位就是不同的共享片段,一个单位的调参因此不会驱动另一个单位的尸体或炮塔;一个单位烘出的骨架也不会被当成另一个单位的。

Tuning never crosses units. The socket inventory, the ragdoll block and both bone indices all take part in value equality: two units differing in any of them are different shared fragments, so one unit's tuning never drives another unit's corpses or turret, and one unit's baked skeleton is never read as another's.

布娃娃的刚体表与关节表烘焙在 ATT 资产上,修改它们需要重新烘焙;本片段只承载按单位可调的那三个值。

The ragdoll body and joint tables are baked onto the ATT asset and need a re-bake to change; this fragment carries only the three per-unit values.