From b99d5fce7fee6d4c2bf15a20199efbb9732c5d98 Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 9 Feb 2026 15:52:23 -0500 Subject: [PATCH] Prioritize corner buckets over broad cardinal wall matches - Defer cardinal-pass placement when an 8-direction corner/diagonal bucket match exists in the active palette - Prevent corner cells from being flattened into top/side walls during first pass - Keep two-pass flow intact: cardinal fallback first, unresolved cells resolved by 8-direction masks --- Game/Dungeon/DungeonGeneratorVNext.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Game/Dungeon/DungeonGeneratorVNext.cs b/Game/Dungeon/DungeonGeneratorVNext.cs index f66986e..9a9776d 100644 --- a/Game/Dungeon/DungeonGeneratorVNext.cs +++ b/Game/Dungeon/DungeonGeneratorVNext.cs @@ -541,6 +541,18 @@ public class DungeonGeneratorVNext continue; } + // If this cell has a specific 8-direction corner/diagonal match that exists in the + // current palette, defer to pass 2 so corners do not get flattened by broad cardinal buckets. + int mask8 = ComputeEightDirectionMask(layout, cell.X, cell.Y); + string? specific8Bucket = ResolveEightDirectionBucketName(mask8); + if (!string.IsNullOrEmpty(specific8Bucket) && + tileContext.WallDefinitionsByCanonicalBucket.TryGetValue(specific8Bucket, out var defs8) && + defs8.Count > 0) + { + unresolved.Add(cell); + continue; + } + var wallDef = SelectWallDefinitionForBucket(tileContext, bucketName); if (wallDef == null) {