Mass Battle Frameworkv1.20.0

Render Pipeline

AGENT RENDER STRUCTURE

Assembly → Creator bake → Niagara system → Material

结构 Structure

一个单位在运行时是一个 Niagara 系统,它的结构直接对应你在 Assembly 面板里搭出来的东西:一个部件(Part)对应一个 emitter,部件下的每个版本(Version)各对应一个 mesh renderer,而每个 renderer 恰好只装一个网格。

At runtime a unit is one Niagara system, and that system mirrors what you built in the Assembly panel: one emitter per part, one mesh renderer per version inside it, and exactly one mesh per renderer.

最后那条不变量是整套设计的支点:渲染器的材质覆盖是一张按材质槽(section)下标的表,会被套用到该渲染器持有的每一个网格上。所以一个渲染器里放多个网格,它们的第 i 个槽就必然共用同一份覆盖——多版本混搭时会串材质、串姿态。一个渲染器只装一个网格,覆盖表的下标才永远只指向唯一一个网格。

That last invariant is what the whole design rests on: a renderer's material overrides form one table indexed by material slot (section), and that table is applied to every mesh the renderer holds. Put several meshes in one renderer and their i-th slots must share the same override — mixing versions bleeds materials and poses into each other. With one mesh per renderer, a slot index can only ever mean that single mesh.

一部件一 emitterOne Emitter per Part

每个部件是系统里一条独立的分支,有自己的粒子与可见性判定。部件越多,emitter 越多,但每个 emitter 只负责一个部件,改动互不影响。把两个以上部件打成烘焙组后,整组共用一个 emitter(组内按版本元组合并几何,材质槽仍各自独立)——见制作与烘焙。Each part is its own branch in the system, with its own particles and visibility test. More parts mean more emitters, but each one owns exactly one part, so changes never cross over. Put two or more parts in a bake group and the whole group shares one emitter (geometry merged per version-tuple, material slots still separate) — see Authoring & Baking.

一版本一 rendererOne Renderer per Version

部件的每个版本有独立的 mesh renderer,只装该版本的那一个网格。每个版本因此可以拥有自己的材质、自己的 LOD 链与自己的姿态修正,而不是共用一份。Every version of a part gets its own mesh renderer holding just that version's mesh, so it carries its own materials, its own LOD chain and its own pose correction instead of sharing one.

逐槽独立材质Per-slot Materials

网格的每个材质槽(section)在产物里都有一条独立的覆盖项,并对应一个独立的用户参数;同一个版本的每个 section 可以各自绑定材质与贴图,互不影响。Each material slot (section) of a mesh gets its own override entry in the generated asset, wired to its own user parameter — every section of a version can carry its own materials and textures.

你改什么,运行时怎么生效 What You Author, What It Becomes

面板里的操作In the panel 产物里变成In the generated asset 运行时怎么生效At runtime
新增一个部件Add a part 系统里多一条 emitter 分支One more emitter branch 该部件的所有版本共享这条分支All versions of that part share this branch
给部件加一个版本Add a version 该部件下多一个单网格 rendererOne more single-mesh renderer for that part 由组合(Combination)决定显示哪一个The combination decides which one shows
录制一个组合Record a combination 配方表中一行,每个部件一格One recipe row: one cell per part 单位出生时定下所属组合,之后不变A unit picks its combination at spawn and keeps it
给部件或版本摆位置Offset a part or a version 烘进该版本网格或它的渲染条目Baked into the version's mesh or its render entry 见下方「变换层级」See Transform Levels below
把挂件挂到父件的 socketMount an attachment on a parent's socket 几何按 socket 摆位并刚性绑定Geometry placed on the socket, rigidly bound 跟随那根骨骼一起运动Follows that bone
改动部件/版本后重新烘焙Re-bake after changing parts 整份系统、渲染器与材质参数重新生成The whole system, renderers and material params are regenerated 旧单位换用新产物需重新生成Existing units pick the new asset up on their next spawn

变换层级 Transform Levels

两级偏移,各管一段。部件级变换对该部件的所有版本生效,所以整件部件一起移动;版本级变换只作用于那一个版本,按设计不会传递给它的子件。挂件的变换是相对 socket 的,烘进几何后随骨骼运动;顶层部件(Body)的变换是相对 Actor 根的,作用在整具单位上。

Two levels, each with its own scope. A part-level transform applies to every version of that part, so the whole part moves together; a version-level transform affects only that version and, by design, is not inherited by its children. An attachment's transform is socket-relative, baked into its geometry so it follows the bone; the top-level part's (Body) transform is actor-relative and moves the unit as a whole.

把手放上去判断你要哪一级:想让「这个部件的每一个版本都挪一点」用部件级;只想修「这一个版本」用版本级,并且不要指望它的子件跟着动。

A quick rule of thumb: to move every version of a part, use the part level; to nudge just one version, use the version level — and do not expect its children to follow.

这三层就是你在 Assembly 面板里摆东西时实际在摆的三个位置。要在面板里搭出这些层级、再把它们烘成产物,见制作与烘焙。

These three levels are what you are actually placing while arranging things in the Assembly panel. To build them there and bake them into the asset, see Authoring & Baking.

边界 Boundaries

①父子只有两层。顶层部件(Body)可以有任意多个子件、挂在任意多个 socket 上,但子件不能再有子件——面板会拒绝更深的连接,状态条会给出提示。

① Two levels of parenting only. The top-level part (Body) may own any number of children on any number of sockets, but a child cannot own children — the panel refuses deeper links and the status chip says why.

②同一单位的所有版本必须共享同一具骨架与同一套动画。这也是它们能共用一份骨骼数据的原因。烘焙时若发现某个版本对不上,会直接报错中止,而不是产出一个播放时会错位的资产。

② Every version of one unit must share the same skeleton and the same animation set. That is also why they can share one bone dataset. The bake stops with an error if a version does not match, instead of producing an asset that would play back wrong.