Some people may already know, but I'm working on a random dungeon generator for a project of mine, and so far I've been able to make a several rooms and such randomly on the map, but I'm having a problem that I need a suggestion on how to do it correctly.
Basically the problem is this: When I am creating the rooms, I create..lets say 7 rooms. What happens is that they tend to overlap and kill each other, sometimes I have 3 rooms in 1 room, or very rarely they go all over the place and make a real dungeon with several rooms and such. When they overlap, a tiny bit of the map is really used and they are all clumped together.
I was thinking about making it so that if they bump into each other that the room is remade, but that causes it to possibly loop infinately. For example, if theres no legit space left to actually make a room, it will loop indefinately, or if theres just barely enough space, the actual ability to get that random chance is so rare, that it will never reach it in any amount of time (Or in the 200 or so loop limit).
A suggestion I was thinking about to myself is to create basically Sectors of the map, and use those. If I have like 6 rooms to create, I cut the map into 6ths and allow it to use only the space in those 6ths.
Any other ideas on this? I'm probably going to try to implement the sectors idea later on and see if that helps, but if anyone has any ideas feel free to let me know.
Thanks
~Polantaris.
Copyright © 2025 BYOND Software.
All rights reserved.
Steps 1-3 look something like this:
Lummox JR