
-
Dungeon Scene
Press Space to generate an area map, Enter to populate it.
Try it online! -
Node Scene
Press Space to place a node in a room.
Try it online!
A flexible, modular procedural dungeon generation system for Unity (C#).
Create diverse, replayable dungeons for games, prototypes, or experiments—perfect for roguelikes or custom level design.
- Unity: 2018.4 or newer
- C#: 7.3 or newer
- Clone the Repository
git clone https://github.com/macetini/ProceduralGeneration.git
- Import into Unity
- Drag the
DungeonGeneration
folder into your project’sAssets
.
- Drag the
-
Create a New Scene
Open Unity and start a new scene. -
Add the Dungeon Generator
Attach theDungeonGenerator
script to any GameObject. -
Configure Parameters
Use the Inspector to customize generation parameters. -
Generate a Dungeon
Call theGenerateDungeon
method—either in code or via the Inspector.
GenerateDungeon()
: Generates a new dungeon layout using current settings.
GenerateNodeGraph()
: Builds a node graph structure for dungeon layout.
GenerateZones()
: Creates distinct zones within the dungeon, each with unique features.
- Procedural Dungeon Creation: Unique layouts for every run
- Dynamic Paths & Connections: Flexible linking between dungeon elements
- Highly Customizable: Tweak parameters for endless variety
- Node-Based Graphs: Branching, complex structures
- Zone-Based Generation: Distinct areas with configurable content
nodeCount
: Number of nodes in the graphconnectionChance
: Probability of linking nodesnodeSize
: Size of each node
zoneSize
: Size of each zonezoneShape
: Shape (rectangular, circular, etc.)zoneContents
: What fills the zone (enemies, treasure, obstacles, etc.)
- Themed dungeons for every playthrough
- Roguelike games with unique layouts on each run
- Custom algorithms building on the core system
- Complex multi-path dungeons via node graphs
- Distinct challenge/reward areas using zones
-
Errors or Issues:
Check the Unity console for error messages. -
Dungeon Not Generating:
Adjust generation parameters or review theDungeonGenerator
script. -
Node Generation Problems:
Experiment with node count, connection chance, or node size. -
Zone Generation Problems:
Try different zone sizes, shapes, or contents.
Pull requests, suggestions, and bug reports are welcome!
Please open an issue or submit a PR to help improve the system.
Distributed under the MIT License.
See LICENSE
for details.