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
@@ -160,14 +160,15 @@ function pickCategoryPool(
|
||||
const mrank = vehicleMrank(vehicle, query.difficulty, query.requiredClass);
|
||||
return mrank >= query.minMrank && mrank <= query.maxMrank;
|
||||
});
|
||||
const source = inWindow.length > 0 ? inWindow : sortedByCloseness.slice(0, query.limitPerType);
|
||||
return roundRobinByCountry(source, orderedCountries, query.limitPerType);
|
||||
const source = inWindow.length > 0 ? inWindow : sortedByCloseness.slice(0, query.limitPerType);
|
||||
return roundRobinByCountry(source, orderedCountries, query.limitPerType, category);
|
||||
}
|
||||
|
||||
function roundRobinByCountry(
|
||||
vehicles: readonly CatalogueVehicle[],
|
||||
orderedCountries: readonly string[],
|
||||
limit: number,
|
||||
category: 'tank' | 'aircraft' | 'ship',
|
||||
): BotPoolEntry[] {
|
||||
const buckets = new Map<string, CatalogueVehicle[]>(orderedCountries.map((country) => [country, []]));
|
||||
for (const vehicle of vehicles) buckets.get(vehicle.country)?.push(vehicle);
|
||||
@@ -177,7 +178,8 @@ function roundRobinByCountry(
|
||||
for (const country of orderedCountries) {
|
||||
const vehicle = buckets.get(country)?.[index];
|
||||
if (!vehicle) continue;
|
||||
out.push({ name: vehicle.name, country: stripCountryPrefix(country), weight: 1 });
|
||||
const weight = category === 'tank' ? tankBotPoolWeight(vehicle) : 1;
|
||||
out.push({ name: vehicle.name, country: stripCountryPrefix(country), weight });
|
||||
added = true;
|
||||
if (out.length >= limit) break;
|
||||
}
|
||||
@@ -186,6 +188,15 @@ function roundRobinByCountry(
|
||||
return out;
|
||||
}
|
||||
|
||||
function tankBotPoolWeight(vehicle: CatalogueVehicle): number {
|
||||
if (vehicle.unitClass === 'exp_SPAA') return 0.12;
|
||||
if (vehicle.isLightTank) return 0.45;
|
||||
if (vehicle.unitClass === 'exp_tank_destroyer') return 0.55;
|
||||
if (vehicle.unitClass === 'exp_heavy_tank') return 0.85;
|
||||
if (vehicle.unitClass === 'exp_tank') return 1.15;
|
||||
return 1;
|
||||
}
|
||||
|
||||
function unitClassOfVehicleType(type: VehicleType | undefined): UnitClass | undefined {
|
||||
if (type === 'Tank') return 'tank';
|
||||
if (type === 'Aircraft') return 'aircraft';
|
||||
|
||||
Reference in new issue
Block a user