Fix elbow wall corner precedence and fallback flow

- Apply elbow->corner bucket mapping before cardinal bucket selection

- Add 8-direction fallback in pass1 when cardinal candidate exists but has no definition

- Keep pass2 unresolved resolution unchanged
This commit is contained in:
dingo
2026-02-10 07:59:51 -05:00
parent a2e206daf1
commit 191f919206
+16 -6
View File
@@ -554,15 +554,25 @@ public class DungeonGeneratorVNext
continue; continue;
} }
var wallDef = SelectWallDefinitionForBucket(tileContext, bucketName); TileDefinition? wallDef = null;
// Elbow masks should prefer corner buckets before broad cardinal buckets.
string? elbowBucket = ResolveElbowBucketName(mask4);
if (!string.IsNullOrEmpty(elbowBucket))
{
wallDef = SelectWallDefinitionForBucket(tileContext, elbowBucket);
}
wallDef ??= SelectWallDefinitionForBucket(tileContext, bucketName);
if (wallDef == null) if (wallDef == null)
{ {
// Elbow masks (two-cardinal-neighbor corners) should prefer explicit corner buckets // Try any 8-direction bucket before deferring to pass 2.
// before falling back to broad cardinal buckets. int fallbackMask8 = ComputeEightDirectionMask(layout, cell.X, cell.Y);
string? elbowBucket = ResolveElbowBucketName(mask4); string? any8Bucket = ResolveEightDirectionBucketName(fallbackMask8);
if (!string.IsNullOrEmpty(elbowBucket)) if (!string.IsNullOrEmpty(any8Bucket))
{ {
wallDef = SelectWallDefinitionForBucket(tileContext, elbowBucket); wallDef = SelectWallDefinitionForBucket(tileContext, any8Bucket);
} }
} }