human tweaks

This commit is contained in:
33333-33333 2026-05-24 19:33:09 +09:00
commit f5e7a1df1d
9 changed files with 1201 additions and 45 deletions

View file

@ -105,6 +105,8 @@ export function finishMapOutput({
terrainDebug,
regionalPrefectureBorders,
}) {
const outputProgress = (step) => options?.onProgress?.({ status: "output-step", key: "output", label: `Output: ${step}`, step });
outputProgress("population recalculation");
// Final population pass after land-use cleanup, satellite municipality locking, and isolated urban deletion.
// Use all generated prefecture regions for human-geography density, not only the focused prefecture.
const humanRegionMask = new Uint8Array(MAP_W * MAP_H);
@ -123,6 +125,8 @@ export function finishMapOutput({
}
}
outputProgress("harbor works");
function makeHarborWorks(ports) {
const out = [];
for (const port of ports) {
@ -155,6 +159,7 @@ export function finishMapOutput({
const usedNames = new Set();
const nameDebug = createNameDebug();
outputProgress("feature naming");
villages = attachIdsAndNames(tagInsidePrefecture(villages, prefectureMask), "village", seed, null, nameFields, usedNames, nameDebug);
ports = attachIdsAndNames(tagInsidePrefecture(ports, prefectureMask), "port", seed, null, nameFields, usedNames, nameDebug);
crossings = attachIdsAndNames(tagInsidePrefecture(crossings, prefectureMask), "crossing", seed, null, nameFields, usedNames, nameDebug);
@ -171,6 +176,7 @@ export function finishMapOutput({
newTowns = attachIdsAndNames(tagInsidePrefecture(newTowns, prefectureMask), "newtown", seed, null, nameFields, usedNames, nameDebug);
castleRuins = attachIdsAndNames(tagInsidePrefecture(castleRuins, prefectureMask), "castleRuin", seed, null, nameFields, usedNames, nameDebug);
externalGateways = attachIdsAndNames(tagInsidePrefecture(externalGateways, prefectureMask), "gateway", seed, "External Gateway", nameFields, usedNames, nameDebug);
outputProgress("municipality naming");
const adminCenters = attachIdsAndNames(tagInsidePrefecture(adminCentersRaw, humanRegionMask), "admin", seed, "Municipal Center", nameFields, usedNames, nameDebug);
const representativeFeatures = [
...modernCities.map((p) => ({ ...p, representativeWeight: 5.0 + (p.population || 0) / 180000 })),
@ -206,6 +212,8 @@ export function finishMapOutput({
}
const usedAdminNames = new Set();
for (const [index, center] of adminCenters.entries()) {
center.adminNumericId = index;
center.municipalityId = index;
let candidate = municipalityNameFromRoot(center.municipalityRootName || center.generatedMunicipalityName || center.name, center, nameFields, seed, index);
const generated = municipalityNameFromRoot(center.generatedMunicipalityName || center.name, center, nameFields, seed + 177, index);
if (usedAdminNames.has(candidate) && Array.from(generated).length >= 2 && !usedAdminNames.has(generated)) {
@ -223,6 +231,7 @@ export function finishMapOutput({
}
nameDebug.maxDerivedPerBase = 0;
outputProgress("final package");
const entitiesForNames = [
...modernCities,
...ports,