Dungeon Revision3

This commit is contained in:
dingo
2025-12-29 13:39:27 -05:00
parent e558930280
commit 3ddd76afbf
+19 -13
View File
@@ -978,14 +978,17 @@ public class DungeonGeneratorV2
// Determine wall type based on which direction has floor // Determine wall type based on which direction has floor
TileDefinition wallTile; TileDefinition wallTile;
// Check for corners first // Check for corners first.
if (hasFloorSouth && hasFloorEast) // IMPORTANT: corner_* tags indicate the quadrant where the *wall mass* lives inside this tile.
// That quadrant matches the direction of the interior (walkable) corner.
// Example: if the interior is to the NW (diagonal floor at NW), use corner_nw.
if (hasFloorNorth && hasFloorWest)
wallTile = wallCornerNW; wallTile = wallCornerNW;
else if (hasFloorSouth && hasFloorWest)
wallTile = wallCornerNE;
else if (hasFloorNorth && hasFloorEast) else if (hasFloorNorth && hasFloorEast)
wallTile = wallCornerNE;
else if (hasFloorSouth && hasFloorWest)
wallTile = wallCornerSW; wallTile = wallCornerSW;
else if (hasFloorNorth && hasFloorWest) else if (hasFloorSouth && hasFloorEast)
wallTile = wallCornerSE; wallTile = wallCornerSE;
else if (hasFloorSouth) else if (hasFloorSouth)
wallTile = wallNorth; // Wall is north of floor, so it's a north-facing wall wallTile = wallNorth; // Wall is north of floor, so it's a north-facing wall
@@ -1091,10 +1094,13 @@ public class DungeonGeneratorV2
// Only fill if there's "supporting" wall structure nearby; prevents random diagonal filling. // Only fill if there's "supporting" wall structure nearby; prevents random diagonal filling.
// The diagonal walkable indicates the interior corner; the adjacent walls indicate we are on the border. // The diagonal walkable indicates the interior corner; the adjacent walls indicate we are on the border.
if (floorSE && (wallS || wallE)) PlaceWall(x, y, wallCornerNW); // Diagonal-walkable indicates the interior corner. Choose the corner wall variant that visually
else if (floorSW && (wallS || wallW)) PlaceWall(x, y, wallCornerNE); // connects the two bordering wall runs (this tileset uses the opposite naming compared to the
else if (floorNE && (wallN || wallE)) PlaceWall(x, y, wallCornerSW); // earlier assumption, so NW<->SE and NE<->SW).
else if (floorNW && (wallN || wallW)) PlaceWall(x, y, wallCornerSE); if (floorSE && (wallS || wallE)) PlaceWall(x, y, wallCornerSE);
else if (floorSW && (wallS || wallW)) PlaceWall(x, y, wallCornerSW);
else if (floorNE && (wallN || wallE)) PlaceWall(x, y, wallCornerNE);
else if (floorNW && (wallN || wallW)) PlaceWall(x, y, wallCornerNW);
} }
} }
@@ -1126,10 +1132,10 @@ public class DungeonGeneratorV2
TileDefinition? replace = null; TileDefinition? replace = null;
// Choose connected outer corners using diagonal floor hints. // Choose connected outer corners using diagonal floor hints.
if (floorSE && !floorS && !floorE) replace = wallCornerNW; if (floorSE && !floorS && !floorE) replace = wallCornerSE;
else if (floorSW && !floorS && !floorW) replace = wallCornerNE; else if (floorSW && !floorS && !floorW) replace = wallCornerSW;
else if (floorNE && !floorN && !floorE) replace = wallCornerSW; else if (floorNE && !floorN && !floorE) replace = wallCornerNE;
else if (floorNW && !floorN && !floorW) replace = wallCornerSE; else if (floorNW && !floorN && !floorW) replace = wallCornerNW;
if (replace == null) continue; if (replace == null) continue;
if (replace.Id == id) continue; if (replace.Id == id) continue;