1- Start tilemap full of walls
2- Chose a random point, spawn a drunk-walker to carve an open space
3- Spawn non overlaping rectangles (rooms)
4- Dig straight V or H corridors
5- Find each wall tile that have floor each side, carve that wall
6- Cleanup deadend corridors (each floor tile surronded by 7 walls become a wall)
7- Fill the initial big hole with rocks
8- Find the most left and right rooms to spawn stairs (player start and goal)
9- Draw doors on each carved hole from step 5
10- Find suitable walls to become doors. This will add loops on the dungeon
11- Each rock tile surrounded by 8 rocks will be grass
12- Open holes to connect the open space to the main dungeon
13- Create a lake: Each grass tile that is 3 tiles far from a rock will be water
14- Add plants: 25% of grass tiles that are near a rock or water will be a plant
15- Add trees: 10% os grass tiles that are surrounded by 8 grass tiles will be a tree
16- Animate water tiles
17- Find rooms with only ONE door. Spawn a chest on that room, lock the door
18- Add a key in any other room. This avoid any softlock
That's all! I will improve the algorithm by adding more elements like blueprint rooms, monsters, loot, decoration, etc., but this is all I have at the moment.
#ProceduralGeneration is awesome and a pleasure to watch!