hello, ive been trying to make a rougelike game for a while but one main obstacle has been stopping me and its the dungeon generation so i wonder there is some code online for dungeon generation (btw im using gdscript)
2d rougelike dungeon generator
This is how I did it. The algorithm is very simple. You divide the map into two random rectangles, then divide each of them, and repeat several times, saving each level of rectangles. The final set becomes each room. Then you connect each split rectangle to its twin with a corridor. That way you're guaranteed they'll all connect.
© 2022 - 2024 — McMap. All rights reserved.