The Dungeon Generator is a web-based application developed using JavaScript, HTML, CSS, and SVG that procedurally generates Dungeon & Dragons dungeon maps. The application creates interconnected rooms, doorways, room descriptions, traps, treasures, and other dungeon elements based on user-selected parameters.
This project is inspired by and uses the functionality available in the Mystic Waffle Dungeon Generator:
- https://v1.mysticwaffle.com/
- https://v1.mysticwaffle.com/maps
- https://v1.mysticwaffle.com/rooms
- https://v1.mysticwaffle.com/items
- https://v1.mysticwaffle.com/release-notes
The generated dungeon is rendered dynamically as SVG graphics without the use of third-party JavaScript libraries.
- Procedural dungeon generation
- Random room placement
- Automatic doorway generation
- Connected dungeon layout
- Random room types and descriptions
- Trap and treasure generation
- Item generation using probability-based rules
- Dynamic SVG map rendering
- User-configurable dungeon parameters
- Custom unit testing for dungeon generation logic
- HTML5
- CSS3
- JavaScript (ES6)
- SVG
- Load the application.
- Initialize dungeon parameters such as map size, room count, and complexity.
- Create a multi-dimensional grid to represent the dungeon.
- Place the initial room at a random position.
- Generate additional rooms while preventing overlap.
- Validate room placement within the map boundaries.
- Connect adjacent rooms using doorways.
- Assign random room properties, traps, and difficulty levels.
- Generate random items and treasures.
- Create descriptive information for every room.
- Convert dungeon data into SVG elements.
- Render the dungeon map dynamically.
- Execute unit tests to verify generation and rendering.
- Display the generated dungeon and room information.
- Download or clone the project.
- Open the project folder.
- Open index.html in a web browser.
- Configure the dungeon parameters.
- Generate the dungeon.
- Enter the required dungeon settings.
- Generate the dungeon map.
- View the SVG dungeon layout.
- Read the generated room descriptions.
- Regenerate the dungeon to create a new random layout.
The application generates:
- Procedural dungeon map
- Connected rooms and doorways
- SVG-based dungeon layout
- Random room descriptions
- Traps and treasures
- Random items
- Difficulty information
The generated dungeon and all associated details are displayed dynamically within the web page.
The Dungeon Generator successfully implements procedural dungeon generation using JavaScript. It creates random Dungeon & Dragons dungeon layouts with interconnected rooms, doorways, traps, treasures, and descriptive room information. The dungeon is rendered as scalable SVG graphics, and the generation logic is validated using a custom unit testing framework without relying on third-party JavaScript libraries.