mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-28 03:15:01 +00:00
Update corridor parameters in CoarseToFineWaterPath for improved pathfinding robustness
- Adjusted the default corridor radius to 2 and increased maximum attempts to 6, enhancing the pathfinding algorithm's ability to handle tight corridors and avoid "optimistic coarse water" cliffs.
This commit is contained in:
@@ -270,9 +270,9 @@ export function findWaterPathFromSeedsCoarseToFine(
|
||||
);
|
||||
}
|
||||
|
||||
// Start tight (radius 0) and rely on local widening + final fallback for robustness.
|
||||
const corridorRadius0 = Math.max(0, coarseToFine.corridorRadius ?? 0);
|
||||
const maxAttempts = Math.max(1, coarseToFine.maxAttempts ?? 3);
|
||||
// Default to a slightly inflated corridor to avoid "optimistic coarse water" cliffs.
|
||||
const corridorRadius0 = Math.max(0, coarseToFine.corridorRadius ?? 2);
|
||||
const maxAttempts = Math.max(1, coarseToFine.maxAttempts ?? 6);
|
||||
|
||||
// Allowed corridor stamp is stable across attempts (widening is cumulative).
|
||||
const allowedSet = getStampSet(coarseMap);
|
||||
|
||||
Reference in New Issue
Block a user