I'm having difficult deciding on how to procedurally generate a dungeon floor. The way I've been doing it so far is like so:
- Populate list of Rooms with random height and width.
- Place first room in list at (0, 0).
- Add room to a temporary list of rooms that have been successfully placed.
- Place next room adjacent to a room randomly chosen from the aforementioned temporary list
- Keep repeating previous step until room is successfully placed then move onto the next room.
- Repeat the two previous steps until all rooms have been placed.
After that the doorways between the rooms are created and various steps are taken to assure collision is working properly but my question is this: Why does it appear to be common practice to first create a large area of cells that all are 'filled in' and to then 'carve out' rooms and corridors rather than to generate dungeons my way? I'm not saying my way is better, I would be happy for someone to tell me what I'm doing wrong and why I should be doing it differently. I just find my way easier for managing the various rooms and cells within my dungeon. It also means I don't have a bunch of 'useless' cells on the other side of the dungeon walls doing nothing but hogging processing power - that's something I never understood.
I just want to a way of generating a dungeon which balances efficiency and design.