Sott Data Schema Ue

返回索引

UE 侧配置表结构(DataTable / Excel → CSV)

程序设计总览 一致:运行期 只读配置;数值修正走 GameState 上的 Modifier,不直接改表行。

1. 命名与路径约定

约定
Excel 源文件 Tools/Excel/ 或仓库外策划目录,一表一 Sheet 导出 UTF-8 CSV。
CSV 落地 Content/Data/CSV/
DataTable 资产 Content/Data/DT_*.uasset,Row Name = 主键字符串(如 MAP_01BLD_FARM)。
版本 Content/Data/ruleset_version.txt 单文件整数,与服务器 matches.ruleset_version 对齐。

2. 核心表(行结构说明)

DT_MapLevel — 关卡

类型 说明
MapId FName 主键。
Width / Height int32 逻辑格尺寸;新手约 5×5,上限 ≤20。
DefaultWardId FName 默认城区。
LogicRoundsMax int32 胜利前最大逻辑回合(如 10)。
RealtimeRoundSeconds float [01] 即时制下每逻辑轮次秒数;0 表示纯回合不计时。
StartingCash int32 每座席基础现金。
EventTableLevel SoftObjectPath 指向关卡事件表或 DataTable。

DT_TileCell — 格属性(或嵌入 UMapLevelDataAsset 的数组)

类型 说明
MapId + X + Y 复合键 或用独立 Row:MAP01_2_3
BaseLandPrice int32 基础地价。
TileType uint8 枚举 普通 / 核心竞拍 / 不可建 / 特殊。
WardId FName 城区。
UnlockLogicRound int32 解锁逻辑回合;-1 表示开局可用。
SpecialTag FName 事件引用、剧情格等。

DT_Building — 建筑

类型 说明
BuildingId FName 主键。
DisplayName FText UI。
Cost / DemolishCost / MaintPerRound int32 费用。
BuildSeconds float 建造时间(动画与逻辑可共用)。
FootprintW / FootprintH int32 占地;1×1 或 2×2。
InputGoodId / OutputGoodId FName 产业链;空表示无。
ClusterBonus bool 是否参与 2×2 同类型集群 +1。
Tags FString NoCrossWardMall 等,解析为 GameplayTagContainer

DT_Good — 物资类型

说明
GoodId Food / Material / Service 等。
StorageFeePerRound [01] 仓储费系数。
CanCrossWardDefault 默认是否允许跨城区现货(物流规则可覆盖)。

DT_MarketBand — 市场区间(按逻辑回合刷新)

说明
GoodId 外键。
PriceMin / PriceMax / DemandMin / DemandMax int32。
ApplyPerLogicRound bool

DT_EventMaster — 总事件

说明
EventId 主键。
EffectType 枚举:AdjustLandPricePlayDialogUnlockTiles
Param1..ParamN FString,由 EffectType 解析。
Tips FText。

DT_EventLevel — 关卡事件绑定

说明
MapId 外键。
TriggerLogicRound int32 或 0 表示按时间轴(秒)由另一列指定。
RandomPool FString

DT_MetaLoadout — 局外

说明
LoadoutId 主键。
CashDelta / BuildCostMul / TradePriceMul float。
AllowedBuildingWhitelist FString

3. 调用逻辑(子系统只读)

  1. UConfigRegistrySubsystem::InitializeLoadSynchronous 全部 DT_*,校验行键唯一。
  2. 查询GetBuilding(FName Id) -> const FBuildingRow*;缺失行 Development 断言、Shipping 记日志 + 默认值。
  3. 热更(可选):Editor 下 FileWatch 重载;Shipping 仅整包更新 ruleset_version

4. Excel 列与 CSV 表头

  • 表头 英文蛇形 与上表列名一致,首列为 RowName(Unreal DataTable 导入默认)。
  • 枚举列使用 整型或短字符串,与 C++ UENUM 对齐并在文档维护对照表。