01 · 快速入门与清单规范
适用版本:
format: 1·api_version: "0.1-experimental"(实验期接口,随本体开发可能调整)
1. 核心思路:添加式叠加架构
WTOffline 采用添加式、按加载顺序逐层叠加的模组架构。模组通过增量补丁与新增文件作用于客户端与服务端,不支持直接整包替换原版 .vromfs.bin 归档文件:
- 启动游戏前,启动器从纯净原版备份(
<游戏副本>/wtoffline/stock/)出发,先应用离线版核心补丁,再按玩家在「模组」页排好的顺序,依次叠加所有已启用模组的客户端补丁与新增文件; - 大体积 3D 模型和贴图包通过 Windows NTFS 目录联接点(Junction) 跨盘零拷贝挂载;
- 本地服务器启动时自动读取叠加后的客户端数据包,再按同一顺序合并各模组的
server/tuning/*.jsonc并加载server/index.ts脚本; - 关掉模组或切换预设时,启动器自动拆除联接点并从
wtoffline/stock/还原原版文件,不破坏客户端本体。
- 全局模组仓库:默认位于
%APPDATA%\WTOffline Launcher\mods(可在启动器「模组 › 预设与仓库」修改到任意硬盘)。 - 首次启动自带 3 个官方模板:启动器首次初始化全局
mods/目录时,会自动放入example-vehicle-tweak(零代码改车与译名)、example-server-script(服务端 TS 脚本最小示例)和official-map-selector(原生 DaGui 弹窗 + 服务端选图全栈模组)三个现成模组(默认未勾选)。点击「模组 › 打开模组目录」即可直接阅读源码或复制改造! - 每客户端独立配置:模组开关、加载顺序和命名预设分别保存在各自客户端的数据目录
<数据目录>/mods-config.json中。
2. 前置准备:如何解包与查阅原版游戏数据
在动手改载具属性、挂科技树或写界面补丁之前,你需要先知道原版游戏里的内部载具 ID(例如美系初始轻坦 M2A4 的内部 ID 是 us_m2a4,M1A2 SEP V2 是 us_m1a2_sep2_abrams)以及原版文件的目录结构。
2.1 原版核心归档文件在哪里?
在你的《战争雷霆》客户端目录(以及离线副本目录)下,核心数据存放在以下 .vromfs.bin 虚拟文件系统包中:
| 原版包路径(相对于客户端根目录) | 里面的核心内容 |
|---|---|
char.vromfs.bin | 科技树排布(config/shop.blk)、载具价格/研发点/权重/改装件(config/wpcost.blk)、载具分类标签(config/unittags.blk)、道具与解锁配置 |
aces.vromfs.bin | 坦克模型与装甲参数(gamedata/units/tankmodels/*.blk)、飞机气动(gamedata/flightmodels/*.blk)、舰船、炮弹与导弹参数(gamedata/weapons/...) |
gui.vromfs.bin | 客户端全部界面逻辑脚本(scripts/**/*.nut)、界面模板(gui/**/*.tpl)与样式表(gui/**/*.css) |
lang.vromfs.bin | 多语言本地化词条表(lang/units.csv 载具名、lang/menu.csv 界面文本、lang/units_weaponry.csv 武器弹药名) |
ui/atlases.vromfs.bin | 科技树与商店使用的载具剪影图标(gameuiskin/<载具id>_ico.svg) |
ui/images.vromfs.bin | 资料卡与乘员槽位载具大图(units/<载具id>.ddsx) |
备份目录说明:
<游戏副本>/wtoffline/stock/是启动器用来重建和还原纯净客户端的原版备份目录,请按只读方式对待,不要手动修改或覆盖其中的文件,以免影响关闭模组后的自动还原。所有模组改动都放在mods/<你的模组>/下即可。
2.2 查阅与解包原版数据的方法
你可以根据自己的习惯,直接从本机原版客户端查阅 .blk、.csv 和 .nut 文件:
- 使用社区解包工具在本地查阅: 将客户端里的
char.vromfs.bin、aces.vromfs.bin、gui.vromfs.bin等归档复制到单独的临时工作文件夹(不要在游戏目录原地解包),使用常见的.vromfs.bin/.blk社区解包工具提取目录并将二进制.blk转为可读文本,即可查找任意载具的内部 ID、科技树路径和字段名。 - 用 WTOffline 仓库自带库直接读取(适合拉取了源码仓库的开发者): 如果你在本地克隆了 WTOffline 仓库,可以直接在仓库根目录用 Node 24 调用内置的
@wto/vromfs与@wto/blk读取任意原版包内的二进制.blk并打印为标准文本 BLK:
import { readFileSync } from 'node:fs';
import { getFile, NAME_MAP_PATH, readArchive } from './packages/vromfs/src/index.ts';
import { decodeBlk, formatBlkText, parseSharedNameMap } from './packages/blk/src/index.ts';
const ar = readArchive(readFileSync('C:/WarThunder/char.vromfs.bin'));
const dict = [...ar.files.entries()].find(([k]) => k.endsWith('.dict'))?.[1];
console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: ar.files.has(NAME_MAP_PATH) ? parseSharedNameMap(getFile(ar, NAME_MAP_PATH), dict).names : [], dictionary: dict })));3. 5 分钟做出你的第一个模组
- 在启动器里打开 「模组 › 打开模组目录」(你会看到里面已经有 3 个官方示例模组可供参考);
- 在里面新建文件夹
my-first-mod; - 创建清单文件
my-first-mod/mod.jsonc:
{
"format": 1,
"id": "demo.my-first-mod",
"name": {
"zh-CN": "我的第一个模组",
"en": "My First Mod"
},
"version": "0.1.0",
"author": "YourName",
"description": {
"zh-CN": "把对局银狮和研发点倍率调整为 2 倍。",
"en": "Doubles Silver Lions and Research Points battle rewards."
},
"api_version": "0.1-experimental",
"game_versions": ["2.61.0.*"]
}- 创建
my-first-mod/server/tuning/battle.jsonc:
{
"rewardMultiplierSilverLions": 2.0,
"rewardMultiplierResearchPoints": 2.0
}- 切回启动器窗口(页面获得焦点时会自动刷新,也可点击「刷新」),勾选启用你的模组并点击「启动游戏」即可生效。
4. 完整标准目录结构
按需创建你实际用到的子目录,未用到的部分完全不必建立:
<mod-folder>/
├─ mod.jsonc # 必需:模组清单
├─ server/ # 可选:服务端部分
│ ├─ tuning/ # 可调数值增量覆盖(*.jsonc)
│ └─ index.ts (或 index.mjs / .js) # 服务端脚本入口(默认自动探测)
└─ client/ # 可选:客户端部分
├─ packs/ # .vromfs.bin 数据包增量叠加
│ ├─ char.vromfs.bin/
│ ├─ aces.vromfs.bin/
│ ├─ gui.vromfs.bin/
│ ├─ lang.vromfs.bin/
│ ├─ mis.vromfs.bin/
│ ├─ game.vromfs.bin/
│ ├─ ui/atlases.vromfs.bin/
│ └─ ui/images.vromfs.bin/
├─ addon/ # 3D 模型与贴图扩展包(res/*.grp, res/*.dxp.bin)
├─ gui-patches/ # GUI 脚本/模板/样式增量补丁(与本体 patches/gui 同格式)
├─ exe-patches/ # 声明式 exe 补丁(与本体 patches/exe 同格式)
├─ files/ # 可选:大型整合包附带的配套涂装/瞄具/音效/任务
└─ config-blk.patch.jsonc # 可选:游戏根目录 config.blk 的增量补丁5. mod.jsonc 全字段参考
清单元数据解析采用严格白名单校验,写错字段名或出现未定义字段会被直接拒绝,并在启动器报错区显示具体原因。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
format | 是 | 1 | 清单格式版本号,目前固定为整数 1 |
id | 是 | string | 全局唯一模组 ID,匹配 /^[a-z0-9][a-z0-9._-]{0,63}$/(仅小写字母、数字、.、_、-,首字符须为字母或数字,最长 64 位;推荐 <作者>.<模组名>) |
name | 是 | string | { [lang]: string } | 展示名称,支持单字符串或按语言代码映射(如 zh-CN、en) |
version | 是 | string | 模组版本号(推荐语义化版本,如 0.1.0) |
author | 是 | string | 作者或制作组名称 |
description | 否 | string | { [lang]: string } | 模组简介,支持单字符串或多语言对象 |
api_version | 是 | string | 目标接口标识,当前固定填 "0.1-experimental" |
game_versions | 否 | string[] | 声明适配的游戏版本通配符列表(如 ["2.61.0.*"]);与客户端版本不符时仅发出警告,不强行阻断启动 |
requires | 否 | string[] | 前置依赖模组 ID 列表:缺失或未启用时作为阻塞错误阻止启动;同时约束加载顺序(若排在前置模组上方会触发 dependency-order 顺序警告,并参与启动器「按依赖自动排序」) |
conflicts | 否 | string[] | 已知互斥模组 ID 列表;同时启用时作为阻塞错误阻止启动 |
load_after | 否 | string[] | 建议排在这些可选模组 ID 之后(越靠下越晚加载、优先级越高);不强制要求对方启用,若同时启用则参与顺序提示与「按依赖自动排序」 |
load_before | 否 | string[] | 建议排在这些可选模组 ID 之前;同样参与顺序提示与「按依赖自动排序」 |
server | 否 | { entry?: string, tuning?: string } | 显式覆盖服务端入口文件(相对路径,不得含 ..)和 tuning 目录路径(默认自动探测 server/index.{ts,mjs,js} 与 server/tuning) |
6. 启动器自动计算的能力与风险徽标(多徽标叠加)
启动器扫描模组目录后会自动计算并展示能力徽标。徽标是多选累加(非互斥)的——例如同时包含数据包修改与服务端脚本的模组会同时显示 data 和 script 两个徽标,而 official-map-selector 会同时显示 data、gui、script 三个徽标:
- 数据/资源(
data):包含server/tuning/、client/packs/、client/addon/、client/files/或client/config-blk.patch.jsonc(若模组仅含清单且无gui/script/exe,也默认归类显示data); - 界面补丁(
gui):包含client/gui-patches/; - 服务端脚本(
script):包含可执行服务端 JS/TS 入口脚本; - 二进制补丁(
exe):包含client/exe-patches/(高风险,且受离线核心隔离补丁锁保护)。
7. 排序规则与冲突检测
- 加载顺序与优先级:列表中从上到下依次加载;越靠下(序号越大)越晚加载、覆盖优先级越高;
- 一键自动排序:启动器的「按依赖自动排序」会综合全部模组的
requires、load_after与load_before进行拓扑排序; - 叠加合并(提示
info):两个模组对同一个 BLK / CSV /tuning文件做增量补丁时,按顺序先后安全叠加; - 顺序与覆写警告(警告
warning):模组排在了requires/load_after目标之前、目标游戏版本不匹配、或后序模组用整文件替换了前序模组修改过的数据包文件/外置配套文件; - 阻塞错误(错误
error):缺少requires前置模组、前置模组未启用、或同时启用了声明conflicts互斥的模组时,启动器禁止启动并高亮提示处理。
01 · Quick Start & Manifest Reference
Target Spec:
format: 1·api_version: "0.1-experimental"(experimental API; subject to breaking changes as core development progresses)
1. Core Concept: Additive Overlay Architecture
WTOffline uses a stackable, load-order additive mod architecture. Mods supply incremental patches and added files to the client and server, and do not replace whole stock .vromfs.bin archives:
- Before launching the game, the launcher starts from clean stock backups (
<copy>/wtoffline/stock/), applies core offline patches first, and then layers every enabled mod's client patches and added files in the exact order shown on the Mods page; - Large 3D model and texture addons mount across drives with zero file copying via Windows NTFS Directory Junctions;
- When the local server starts, it automatically extracts static game data from the overlaid client packs, merges each mod's
server/tuning/*.jsoncin the same order, and loadsserver/index.tsscripts; - When you disable a mod or switch presets, the launcher automatically unmounts junctions and restores clean files from
wtoffline/stock/without corrupting the client copy.
- Global mod repository: defaults to
%APPDATA%\WTOffline Launcher\mods(configurable to any drive under Mods › Presets & repository). - 3 official templates seeded on first launch: the first time the launcher initializes the global
mods/folder, it automatically seedsexample-vehicle-tweak(code-free vehicle & localization tweak),example-server-script(minimal server TypeScript mod), andofficial-map-selector(full-stack native DaGui modal + server map filter), all disabled by default. Click Mods › Open mods folder right away to inspect their code or duplicate one as a starting point! - Per-client configuration: mod toggles, load order, and named presets are saved independently per client in
<dataFolder>/mods-config.json.
2. Prerequisite: How to Unpack & Inspect Stock Game Files
Before tweaking vehicle stats, wiring tech-tree entries, or patching UI scripts, you need to look up stock internal vehicle IDs (for example, the US reserve light tank M2A4 is us_m2a4, and the M1A2 SEP V2 is us_m1a2_sep2_abrams) and stock file paths.
2.1 Where Stock Archives Live in the Game Client
Inside your War Thunder client folder (and offline copy folder), stock game data lives inside .vromfs.bin virtual filesystem archives:
| Stock Archive Path (relative to client root) | Key Contents Inside |
|---|---|
char.vromfs.bin | Tech-tree layout (config/shop.blk), vehicle prices/RP/BR/modifications (config/wpcost.blk), unit classification tags (config/unittags.blk), items, and unlocks |
aces.vromfs.bin | Tank models & armor (gamedata/units/tankmodels/*.blk), aircraft flight models (gamedata/flightmodels/*.blk), ships, shells, and missiles (gamedata/weapons/...) |
gui.vromfs.bin | All client UI Quirrel scripts (scripts/**/*.nut), Handyman templates (gui/**/*.tpl), and DaGui stylesheets (gui/**/*.css) |
lang.vromfs.bin | Localization tables (lang/units.csv vehicle names, lang/menu.csv UI strings, lang/units_weaponry.csv weapons & ammo names) |
ui/atlases.vromfs.bin | Tech-tree and local web store vehicle silhouette icons (gameuiskin/<unit_id>_ico.svg) |
ui/images.vromfs.bin | Stat-card and crew-slot vehicle portraits (units/<unit_id>.ddsx) |
Note on the backup folder: Treat
<copy>/wtoffline/stock/as read-only. The launcher relies onwtoffline/stock/to rebuild overlays and restore clean files when mods are disabled; modifying files insidestock/can prevent automatic restoration. Place all mod changes undermods/<your-mod>/.
2.2 Practical Ways to Inspect Stock Files
You can inspect stock .blk, .csv, and .nut files directly from your own local game installation:
- Local unpacking with community tools: Copy
char.vromfs.bin,aces.vromfs.bin, orgui.vromfs.binfrom your client into a separate scratch folder (avoid unpacking in-place inside the game directory) and use standard community.vromfs.bin/.blkunpacking tools to extract readable text.blkand.nutfiles, vehicle IDs, and tech-tree paths. - 5-line Node 24 snippet using
@wto/vromfs+@wto/blk(if you cloned the WTOffline repo): If you have the WTOffline repository checked out locally, run Node 24 from the repo root to decode any binary.blkstraight out of a.vromfs.binarchive and print formatted text BLK:
import { readFileSync } from 'node:fs';
import { getFile, NAME_MAP_PATH, readArchive } from './packages/vromfs/src/index.ts';
import { decodeBlk, formatBlkText, parseSharedNameMap } from './packages/blk/src/index.ts';
const ar = readArchive(readFileSync('C:/WarThunder/char.vromfs.bin'));
const dict = [...ar.files.entries()].find(([k]) => k.endsWith('.dict'))?.[1];
console.log(formatBlkText(decodeBlk(getFile(ar, 'config/wpcost.blk'), { names: ar.files.has(NAME_MAP_PATH) ? parseSharedNameMap(getFile(ar, NAME_MAP_PATH), dict).names : [], dictionary: dict })));3. Build Your First Mod in 5 Minutes
- Open Mods › Open mods folder in the launcher (you will already see the 3 official template folders inside for reference);
- Create a new folder named
my-first-mod; - Create the manifest file
my-first-mod/mod.jsonc:
{
"format": 1,
"id": "demo.my-first-mod",
"name": {
"zh-CN": "我的第一个模组",
"en": "My First Mod"
},
"version": "0.1.0",
"author": "YourName",
"description": {
"zh-CN": "把对局银狮和研发点倍率调整为 2 倍。",
"en": "Doubles Silver Lions and Research Points battle rewards."
},
"api_version": "0.1-experimental",
"game_versions": ["2.61.0.*"]
}- Create
my-first-mod/server/tuning/battle.jsonc:
{
"rewardMultiplierSilverLions": 2.0,
"rewardMultiplierResearchPoints": 2.0
}- Switch back to the launcher window (the Mods page refreshes automatically on focus, or click Refresh), enable your mod, and click Launch.
4. Complete Standard Folder Layout
Create only the subdirectories your mod actually uses—unused folders can be omitted completely:
<mod-folder>/
├─ mod.jsonc # Required: mod manifest
├─ server/ # Optional: server-side extensions
│ ├─ tuning/ # incremental tuning overlays (*.jsonc)
│ └─ index.ts (or index.mjs / .js) # server script entry (auto-detected by default)
└─ client/ # Optional: client-side extensions
├─ packs/ # .vromfs.bin archive overlays
│ ├─ char.vromfs.bin/
│ ├─ aces.vromfs.bin/
│ ├─ gui.vromfs.bin/
│ ├─ lang.vromfs.bin/
│ ├─ mis.vromfs.bin/
│ ├─ game.vromfs.bin/
│ ├─ ui/atlases.vromfs.bin/
│ └─ ui/images.vromfs.bin/
├─ addon/ # 3D model & texture addon (res/*.grp, res/*.dxp.bin)
├─ gui-patches/ # incremental GUI script/tpl/css patches (same format as patches/gui)
├─ exe-patches/ # declarative exe patches (same format as patches/exe)
├─ files/ # optional companion skins/sights/sounds/missions
└─ config-blk.patch.jsonc # optional root config.blk incremental patch5. Full mod.jsonc Schema Reference
Manifest parsing enforces strict whitelist validation: typos or unknown keys are rejected immediately with a detailed error message on the Launcher Mods page.
| Field | Required | Type | Description |
|---|---|---|---|
format | Yes | 1 | Manifest schema version, currently fixed to integer 1 |
id | Yes | string | Globally unique mod ID matching /^[a-z0-9][a-z0-9._-]{0,63}$/ (lowercase letters, digits, ., _, -; must start with letter/digit; max 64 chars; <author>.<mod-name> recommended) |
name | Yes | string | { [lang]: string } | Display name as a plain string or locale map (e.g. zh-CN, en) |
version | Yes | string | Mod version string (SemVer such as 0.1.0 recommended) |
author | Yes | string | Author or team name |
description | No | string | { [lang]: string } | Short summary as a plain string or locale map |
api_version | Yes | string | Target API version tag, currently fixed to "0.1-experimental" |
game_versions | No | string[] | Supported game build wildcards (e.g. ["2.61.0.*"]); mismatches emit a warning without blocking launch |
requires | No | string[] | Required dependency mod IDs: missing or disabled dependencies raise a blocking error; also enforces load order (emits a dependency-order warning if placed above its dependency and participates in Auto-Sort) |
conflicts | No | string[] | Mutually incompatible mod IDs; enabling both raises a blocking error |
load_after | No | string[] | Optional mods this mod should load after (lower in the list = higher priority); does not require them to be enabled, and participates in order hints & Auto-Sort |
load_before | No | string[] | Optional mods this mod should load before; also participates in order hints & Auto-Sort |
server | No | { entry?: string, tuning?: string } | Explicit relative paths (no ..) overriding default auto-detection of server/index.{ts,mjs,js} and server/tuning |
6. Automatically Computed Capability & Risk Badges (Additive Multi-Badge)
After scanning each mod folder, the launcher computes capability badges automatically. Badges are additive, not mutually exclusive—for example, a mod with pack overlays and a server script displays both data and script, while official-map-selector displays data, gui, and script:
- Data / Assets (
data): containsserver/tuning/,client/packs/,client/addon/,client/files/, orclient/config-blk.patch.jsonc(a manifest-only mod with none ofgui/script/exealso defaults todata); - UI Patches (
gui): containsclient/gui-patches/; - Server Script (
script): contains an executable server JS/TS entry script; - Binary Patches (
exe): containsclient/exe-patches/(high-risk; guarded by the core offline isolation patch lock).
7. Load Order Rules & Conflict Detection
- Load order & priority: mods load top-to-bottom; items lower in the list (larger index) load later and take higher priority;
- One-click Auto-Sort: the launcher's Auto-sort by dependencies button topologically sorts mods using
requires,load_after, andload_beforetogether; - Additive merge (
info): when multiple mods patch the same BLK, CSV, ortuningfile, their edits stack cleanly in load order; - Order & override warnings (
warning): emitted when a mod sits above arequires/load_aftertarget, mismatchesgame_versions, or replaces an entire pack/companion file already modified by an earlier mod; - Blocking errors (
error): missingrequiresdependencies, disabled dependencies, or simultaneously enabledconflictsprevent launch and highlight the exact items to fix.