before tweaking
This commit is contained in:
parent
da9d8ef904
commit
e48fae5509
8 changed files with 980 additions and 246 deletions
44
mapOutput.js
44
mapOutput.js
|
|
@ -173,48 +173,6 @@ export function finishMapOutput({
|
|||
center.name = best.name;
|
||||
}
|
||||
}
|
||||
const adminNameSuffixes = [
|
||||
"\u753A\u57DF",
|
||||
"\u5E02\u57DF",
|
||||
"\u90F7\u57DF",
|
||||
"\u6D41\u57DF",
|
||||
"\u6E7E\u5CB8",
|
||||
"\u5C71\u9E93",
|
||||
"\u5E73\u91CE",
|
||||
"\u5730\u533A",
|
||||
];
|
||||
const adminNameCounts = new Map();
|
||||
for (const center of adminCenters) adminNameCounts.set(center.name, (adminNameCounts.get(center.name) || 0) + 1);
|
||||
const baseVariantCounts = new Map();
|
||||
for (const center of adminCenters) {
|
||||
const base = String(center.name || "");
|
||||
const count = adminNameCounts.get(base) || 0;
|
||||
if (count <= 1) {
|
||||
baseVariantCounts.set(base, Math.max(baseVariantCounts.get(base) || 0, 1));
|
||||
continue;
|
||||
}
|
||||
const usedForBase = baseVariantCounts.get(base) || 0;
|
||||
if (usedForBase === 0) {
|
||||
baseVariantCounts.set(base, 1);
|
||||
continue;
|
||||
}
|
||||
if (usedForBase < 2) {
|
||||
const i = indexOf(center.x, center.y);
|
||||
const naturalSuffix = coastalLowland[i] > 0.28
|
||||
? "\u6E7E\u5CB8"
|
||||
: basinField[i] > 0.28
|
||||
? "\u5E73\u91CE"
|
||||
: ridgeField[i] > 0.42 || slope[i] > 0.34
|
||||
? "\u5C71\u9E93"
|
||||
: river[i] > 0.25 || flowAccum[i] > 0.38
|
||||
? "\u6D41\u57DF"
|
||||
: adminNameSuffixes[(Math.floor(center.x / 12) + Math.floor(center.y / 12)) % adminNameSuffixes.length];
|
||||
center.name = `${base}${naturalSuffix}`;
|
||||
center.derivedFromBaseName = base;
|
||||
nameDebug.derivedNameCount++;
|
||||
baseVariantCounts.set(base, usedForBase + 1);
|
||||
}
|
||||
}
|
||||
const usedAdminNames = new Set();
|
||||
for (const center of adminCenters) {
|
||||
let candidate = center.name;
|
||||
|
|
@ -225,7 +183,7 @@ export function finishMapOutput({
|
|||
center.name = candidate;
|
||||
usedAdminNames.add(center.name);
|
||||
}
|
||||
nameDebug.maxDerivedPerBase = Math.max(0, ...baseVariantCounts.values());
|
||||
nameDebug.maxDerivedPerBase = 0;
|
||||
|
||||
const entitiesForNames = [
|
||||
...modernCities,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue