Troubleshooting: Overview
While DunGen aims to be robust and easy to use, you might occasionally encounter unexpected behaviour, performance issues, or situations where the generated dungeon doesn't quite meet your expectations. This section provides guidance on identifying and resolving common problems, understanding DunGen's limitations, and analysing the generation process.
Topics Covered:
-
Limitations & Considerations: Before diving into complex debugging, understand the inherent design constraints of DunGen. This page covers crucial aspects like the requirements for Doorway Placement relative to a Tile's bounding box (AABB) and how the collision system works. Understanding these limitations can often explain why certain layouts might fail or why specific Tile shapes are problematic.
-
Analysing Generation Performance: Performance analysis is crucial for optimizing your dungeon generation, especially for complex layouts or lower-spec target platforms. This page introduces tools like the
Runtime Analyzercomponent for gathering statistics on generation time and failure rates, and how to use asynchronous generation with pauses for visual debugging of the step-by-step layout process. Understanding where time is spent or why generation might fail is the first step to fixing it.
Common Issues (General Guidance)
While specific issues often relate to the topics above, here are some general areas to investigate when troubleshooting:
- Generation Failures: If DunGen frequently fails to generate a dungeon (especially noticeable in the Editor where it has a retry limit), check:
- Insufficient Tile Variety: Do you have enough unique Tile prefabs, especially if using
Disallowrepeat modes? - Overly Restrictive Rules: Are your Tile Connection Rules too strict? Are your Tile Injection rules impossible to satisfy?
- Tight Constraints: Is the dungeon length too long for the available space, or are the branch constraints too demanding?
- Incorrect Doorway Placement: Are doorways placed correctly on the Tile bounds as described in Limitations?
- Scene Collisions: Is DunGen colliding with hidden or unexpected objects in the scene?
- Insufficient Tile Variety: Do you have enough unique Tile prefabs, especially if using
- Performance Problems: If generation is slow or causes hitches:
- Complex Tiles: Are your Tile prefabs overly detailed or have too many components?
- Instantiation Cost: Consider enabling Tile Pooling.
- Runtime Baking: Is runtime pathfinding baking (Unity NavMesh, A* Pathfinding) taking too long? Consider pre-baking or optimizing bake settings.
- Use the tools described in Analyzing Performance to pinpoint bottlenecks.
- Visual Glitches: Check Tile prefab alignment, Doorway component orientation, and ensure materials/shaders are compatible with runtime instantiation if issues arise.
Refer to the specific pages in this section for more detailed solutions and techniques related to these common troubleshooting areas.