feat(patcher,server): wire ground AI tuning, bot weights, and pack build
Add ground-ai.jsonc tuning validation, realistic tank class weights for customBots pools, on-demand game.vromfs.bin / ailist.blk injection in @wto/patcher, and launcher/CLI build integration while keeping all ground AI layers disabled by default in shipped configuration.
This commit is contained in:
1 parent
18637cf1ff
commit
4ac3484f56
17 files changed
+836
-75
No files matched your search
@@ -27,11 +27,14 @@ import type { Dataset } from './dataset.ts';
|
||||
import { shopEntriesByName } from './shop-tree.ts';
|
||||
|
||||
const VEHICLE_ECONOMY = 'config/wpcost.blk';
|
||||
const UNIT_TAGS = 'config/unittags.blk';
|
||||
|
||||
export interface CatalogueVehicle {
|
||||
readonly name: string;
|
||||
readonly country: string;
|
||||
readonly unitClass: string;
|
||||
/** True when config/unittags.blk tags the vehicle with type_light_tank. */
|
||||
readonly isLightTank?: boolean;
|
||||
readonly rank: number;
|
||||
/** wpcost.blk reqAir; absent when empty or missing. */
|
||||
readonly requires?: string;
|
||||
@@ -70,15 +73,27 @@ export interface CatalogueVehicle {
|
||||
|
||||
export const vehicleCatalogue: Dataset<readonly CatalogueVehicle[]> = {
|
||||
id: 'vehicle-catalogue',
|
||||
version: 6,
|
||||
version: 7,
|
||||
extract: (source) => {
|
||||
const shopEntries = shopEntriesByName(source);
|
||||
const treeOrder = new Map([...shopEntries.keys()].map((name, index) => [name, index]));
|
||||
return source.readBlk('char.vromfs.bin', VEHICLE_ECONOMY).blocks.map((vehicle) => catalogueVehicle(vehicle, shopEntries.get(vehicle.name), treeOrder.get(vehicle.name) ?? -1));
|
||||
const lightTanks = lightTankNames(source.readBlk('char.vromfs.bin', UNIT_TAGS));
|
||||
return source.readBlk('char.vromfs.bin', VEHICLE_ECONOMY).blocks.map((vehicle) =>
|
||||
catalogueVehicle(vehicle, shopEntries.get(vehicle.name), treeOrder.get(vehicle.name) ?? -1, lightTanks.has(vehicle.name)),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
function catalogueVehicle(vehicle: BlkBlock, shopEntry: BlkBlock | undefined, treeOrder: number): CatalogueVehicle {
|
||||
function lightTankNames(unitTagsRoot: BlkBlock): ReadonlySet<string> {
|
||||
const names = new Set<string>();
|
||||
for (const unit of unitTagsRoot.blocks) {
|
||||
const tags = unit.blocks.find((block) => block.name === 'tags');
|
||||
if (tags && boolField(tags, 'type_light_tank') === true) names.add(unit.name);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
function catalogueVehicle(vehicle: BlkBlock, shopEntry: BlkBlock | undefined, treeOrder: number, isLightTank: boolean): CatalogueVehicle {
|
||||
const requires = stringField(vehicle, 'reqAir');
|
||||
const researchType = stringField(vehicle, 'researchType');
|
||||
const requiredUnlock = stringField(shopEntry, 'reqUnlock');
|
||||
@@ -90,6 +105,7 @@ function catalogueVehicle(vehicle: BlkBlock, shopEntry: BlkBlock | undefined, tr
|
||||
name: vehicle.name,
|
||||
country: stringField(vehicle, 'country') ?? '',
|
||||
unitClass: stringField(vehicle, 'unitClass') ?? '',
|
||||
...(isLightTank ? { isLightTank: true } : {}),
|
||||
rank: numberField(vehicle, 'rank') ?? 0,
|
||||
...(requires ? { requires } : {}),
|
||||
researchPoints: numberField(vehicle, 'reqExp') ?? 0,
|
||||
|
||||
Reference in new issue
Block a user