chore(repo): merge tank AI checkpoint for 0.1.6

This commit is contained in:
N0VAN0M4LY committed 2026-12-06 15:47:46 +08:00
commit 710c8ecaaa
159 files changed
+35721 -1572

No files matched your search

+13 -3
View File
@@ -5,6 +5,7 @@
* --data <local server data folder>
* [--patches <patch set>]
* [--native <folder with wto_ws.dll>] [--decal-cache <folder>]
* [--map-nav <folder with <level>.wtonav packs>]
* [--skip-unavailable] [--verbose]
*
* Writes <out>/char.vromfs.bin, <out>/aces.vromfs.bin, <out>/gui.vromfs.bin, <out>/win64/aces.exe
@@ -13,14 +14,15 @@
* --data is the folder the local server will run with: the store packs it sells there (its tuning
* with that folder's overrides) get bundle GUIDs in gui.blk. --decal-cache names the cache/content
* folder of the player's online installation; it is copied to <out>/cache/content, otherwise
* char.vromfs.bin gets the placeholder decal index.
* char.vromfs.bin gets the placeholder decal index. --map-nav names the folder of the baked
* ground AI navigation packs (tools/navgen); wto_ws.dll loads them from there, nothing is copied.
* When a patch is unavailable nothing is written, unless --skip-unavailable is given and none of
* the unavailable patches is essential (the patcher's essential-features.ts).
* The patch set (exe, GUI and native definitions) and the hook library default to this
* repository's patches/ and build/native. The launcher runs the same build at every launch, with the port the player chose.
*/
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { parseArgs } from 'node:util';
import type { PatchFailure } from '@wto/exepatch';
@@ -47,7 +49,7 @@ import { loadGroundAiTuning, multiVehiclePackIds } from '@wto/server';
const REPOSITORY = fileURLToPath(new URL('..', import.meta.url));
const USAGE = 'usage: build-game-copy.ts --game <stock game folder> --out <game copy folder> --port <n> --data <local server data folder> '
+ '[--patches <patch set>] [--native <folder with wto_ws.dll>] [--ground-ai <folder>] '
+ '[--mods-dir <folder> --mod <id>...] [--decal-cache <folder>] [--skip-unavailable] [--verbose]';
+ '[--mods-dir <folder> --mod <id>...] [--decal-cache <folder>] [--map-nav <folder>] [--skip-unavailable] [--verbose]';
function resolveCliMods(modsDir: string | undefined, modIds: readonly string[] | undefined): DiscoveredMod[] {
if (!modsDir || !modIds || modIds.length === 0) return [];
@@ -73,6 +75,7 @@ function parseCliOptions() {
'mods-dir': { type: 'string' },
mod: { type: 'string', multiple: true },
'decal-cache': { type: 'string' },
'map-nav': { type: 'string' },
'skip-unavailable': { type: 'boolean', default: false },
verbose: { type: 'boolean', default: false },
},
@@ -99,6 +102,12 @@ function main(): number {
return 1;
}
const mapNav = values['map-nav'] === undefined ? undefined : resolve(values['map-nav']);
if (mapNav !== undefined && !existsSync(mapNav)) {
console.error(`--map-nav: ${mapNav} not found; nothing was written`);
return 1;
}
const port = Number(values.port);
const enabledMods = resolveCliMods(values['mods-dir'], values.mod);
const groundAiConfig = loadGroundAiTuning(values.data, (line) => console.log(line), enabledMods);
@@ -123,6 +132,7 @@ function main(): number {
...(enabledMods.length > 0 ? { mods: enabledMods } : {}),
...(extraStockPacks ? { extraStockPacks } : {}),
groundAi: { scriptsFolder: values['ground-ai'], config: groundAiConfig },
...(mapNav !== undefined ? { mapNavFolder: mapNav } : {}),
});
report(build, values.verbose);
return finishCliWrite(values, build, enabledMods, optionalPacksInBuild, groundAiConfig, port);