MassBattle Docsv1.19.20

LOD.h

USTRUCT ×4

Source/MassBattle/Public/Fragments/LOD.h

概述 Overview

LOD 配置体系:单级配置 FLODData、固定 5 级容器 FLODsData(按屏幕尺寸降序,Data0 = 最近/最高细节)、逻辑 LOD 占位 FLogicLODData、以及共享片段 FLODShared(同一原型的 Agent 共享同一份实例,按值去重)。渲染(视觉)LOD 与未来的逻辑/TickRate LOD 分离。

LOD configuration system: single-level FLODData, fixed 5-level container FLODsData (ordered by decreasing screen size, Data0 = nearest/highest detail), logic-LOD placeholder FLogicLODData, and the shared fragment FLODShared (agents of the same archetype share one instance, deduplicated by value). Render (visual) LOD is separated from the future logic/tickrate LOD.

FLODData USTRUCT

单级 LOD 配置(普通 USTRUCT,非 fragment)。定义一级 LOD 的屏幕尺寸阈值、表现模式、Mesh LOD 层级与动画融合层级。

Single LOD level configuration (plain USTRUCT, not a fragment). Defines the screen-size threshold, representation mode, mesh LOD index and animation blend level for one LOD band.

成员变量 Members

名称 Name类型 Type默认值说明 Description
ScreenSizefloat-1屏幕尺寸阈值(0–1)。Screen size threshold (0–1).
RepresentationERepresentationModeParticle表现模式:粒子+VAT 或 Actor,枚举定义于 MassBattleEnums.h。Representation mode: Particle+VAT or Actor; enum defined in MassBattleEnums.h.
LODIndexint32-1VAT Mesh LOD 层级(0–4)。仅 Representation == Particle 时可编辑。VAT Mesh LOD index (0–4). Editable only when Representation == Particle.
AnimBlendLevelint322该 VAT 使用的动画融合层级(1–3)。仅粒子模式时可编辑。Animation blend level this VAT uses (1–3). Editable only in Particle mode.

方法 Methods

operator== FORCEINLINE bool

四个字段全部相等时视为相同——供容器去重与共享片段值比较。

Equal only when all four fields match — used for container dedup and shared-fragment value comparison.

Input

无参数(成员方法,隐式 this)。

No parameters (member method, implicit this).

Output

返回四字段全等结果。

Returns the four-field equality result.

FLODsData USTRUCT

固定 5 级 LOD 数据容器(普通 USTRUCT)。每个 Data 槽代表一级 LOD,按屏幕尺寸降序排列(Data0 = 最近/最高细节)。

Fixed 5-level LOD data container (plain USTRUCT). Each Data slot represents one LOD band, ordered by decreasing screen size (Data0 = nearest/highest detail).

成员变量 Members

名称 Name类型 Type默认值说明 Description
Data0FLODData—LOD 0 配置(最近/最高细节)。LOD 0 configuration (nearest/highest detail).
Data1FLODData—LOD 1 配置。LOD 1 configuration.
Data2FLODData—LOD 2 配置。LOD 2 configuration.
Data3FLODData—LOD 3 配置。LOD 3 configuration.
Data4FLODData—LOD 4 配置(最远/最低细节)。LOD 4 configuration (farthest/lowest detail).

方法 Methods

operator== FORCEINLINE bool

五个槽位逐一相等时视为相同。

Equal only when all five slots match.

Input

无参数(成员方法)。

No parameters (member method).

Output

返回五槽全等结果。

Returns the five-slot equality result.

FLogicLODData USTRUCT

逻辑/TickRate LOD 占位结构体(普通 USTRUCT)。当前为空——开发中;未来将保存每级 LOD 的 Tick 频率、感知更新速率与行为节流配置。operator== 恒返回 true(空结构)。

Logic/TickRate LOD placeholder struct (plain USTRUCT). Currently empty — under development; it will hold per-LOD tick frequency, sensor update rate and behavior throttling config. operator== always returns true (empty struct).

FLODShared USTRUCT

可修改的共享片段,派生自 FA_MassBattleBaseSharedFragment。同一原型的所有 Agent 共享同一实例——LOD 设置相同的 Agent 去重为一个实例,避免逐实体冗余。

Mutable shared fragment derived from FA_MassBattleBaseSharedFragment. All agents of the same archetype share one instance — agents with identical LOD settings deduplicate to a single instance, avoiding per-entity redundancy.

成员变量 Members

名称 Name类型 Type默认值说明 Description
RenderLODFLODsData—渲染 LOD 数据——按屏幕尺寸排序的 5 级视觉 LOD。Render LOD data — 5 visual LOD levels ordered by screen size.
LogicLODFLogicLODData—逻辑 LOD 数据——开发中,将控制每级 LOD 的 Tick 频率、感知频率与行为节流。Logic LOD data — under development; will control tick rate, sensor frequency and behavior throttling per LOD level.
DeterministicHashint320确定性 CRC32 种子。模板构建时从资产路径(GetPathName)赋值,确保每个 DataAsset 有不同哈希。有意不参与 operator==——它是哈希扰动,不是语义数据。Deterministic CRC32 seed. Set from the asset path (GetPathName) at template build to guarantee a distinct hash per DataAsset. Purposefully NOT part of operator== — it is a hash perturbation, not semantic data.

方法 Methods

operator== FORCEINLINE bool

仅比较 RenderLOD 与 LogicLOD,忽略 DeterministicHash。

Compares only RenderLOD and LogicLOD; DeterministicHash is ignored.

Input

无参数(成员方法)。

No parameters (member method).

Output

返回两字段全等结果。

Returns the two-field equality result.

管线角色 Pipeline Role

grep 验证:FLODShared / FLODsData 被 MassBattleAgentRenderProcessor(按屏幕尺寸选择 LOD 级并切换表现)与 MassBattleAgentSubsystem(模板构建时创建共享实例)引用。

Verified by grep: FLODShared / FLODsData are referenced by MassBattleAgentRenderProcessor (picks the LOD level by screen size and switches representation) and MassBattleAgentSubsystem (creates the shared instance at template build).