Hello, it's been a long time since my last post, but I've been lurking the community every day.
My next project is a "Tower of the Sorcerer" / "DROD RPG" like game, but with randomly generated items, monsters and levels.
I'm trying to create an algorithm which generates rooms to completely fill a 20x20 dungeon.
Here's what I've accomplished so far.
That works perfectly fine.
When I want to create a new room, there is a big chance it will be created overlapping the pre-existing one.
I want my algorithm to automatically understand where a room can be made without making it overlap any other pre-existing room.
The algorithm should find a good starting point, a width and an height for the room, then create it.
And repeat itself until there is no more space for other rooms.
I'm not sure how to make the algorithm work.
Should I make it randomly select a free tile then create the biggest possible room?
Should I make it build a room with random width/height then find a place to create it in the grid?
Or is there any other easier or better approach?
Thanks for your time.
Can someone help me with the algorithm? I don't know how it should work.