Troubleshooting: Limitations & Considerations
DunGen is a powerful tool, but like any system, it operates based on certain internal logic and assumptions. Understanding these limitations is crucial for designing compatible content and troubleshooting potential generation failures. Being aware of these constraints upfront can save significant debugging time.
The most critical limitation relates to how DunGen performs collision checks between Tiles.
Doorway Placement
-
The Core Mechanism: DunGen determines if Tiles overlap by checking their Axis-Aligned Bounding Boxes (AABB). This is a fast and efficient method suitable for runtime generation, but it's less precise than mesh-based collision.
-
The Critical Rule: Because collision is based on the AABB, Doorway components MUST be placed on the outer edge of their Tile's calculated AABB.
-
What This Means:
- The Doorway component's position must lie on one of the six faces of the invisible rectangular box that encompasses all renderers and colliders within the Tile prefab.
- DunGen can handle doorways that are slightly offset from the absolute edge, but they must fundamentally reside on the boundary plane of the AABB.
-
The Problem - Concave Shapes: Doorways placed on concave portions of a Tile (parts that indent inwards relative to the overall bounding box) will NOT work. DunGen's connection logic relies on finding doorways on the AABB edge where two tiles meet. If a doorway is inside this edge, it won't be detected correctly for connections.
-
Visual Example: The image below illustrates this. The
orange boxrepresents the Tile's AABB, and theblue linerepresents the Doorway's position.- (✓ Correct): Doorways are placed on the flat, outer edges of the AABB. Even if the visible mesh curves slightly inside the AABB near the doorway, the Doorway component itself is positioned on the AABB boundary.
- (X Incorrect): Doorways are placed on indented parts of the Tile geometry. These positions are inside the AABB's boundary, not on its edge. DunGen cannot connect these doorways.

-
When Does This Matter Most?
- Simple Rectangular Tiles: If your tiles are basically rectangular prisms, this is usually not a concern, as all walls naturally align with the AABB edges.
- Complex Shapes (L-shapes, T-shapes, Alcoves, etc.): This restriction becomes extremely important when designing Tiles with non-rectangular footprints. You must ensure doorways are only placed on segments of the Tile that correspond to the outer faces of its overall bounding box. Visualize the AABB around your complex tile and place doorways accordingly.
Consequences of Incorrect Placement
Failing to adhere to the AABB edge placement rule for Doorways is a common cause of dungeon generation failures or unexpected connectivity issues. If DunGen seems unable to connect certain tiles, verify the Doorway placement relative to the Tile's AABB.
Other Considerations
- Performance: While not a hard limitation on what can be generated, extremely complex Tile prefabs (high polygon counts, numerous components, complex scripts) can increase instantiation time and potentially impact runtime generation performance. Consider optimization or using features like Tile Pooling.
Understanding the AABB collision system and its implication for doorway placement is the most important technical limitation to grasp when designing content for DunGen, especially when moving beyond simple rectangular rooms.