I have been trying my hand at autogenerator things the last few days, and figured I try this one too.
I set off with trying to find my own method for connecting rooms, but it got sloppy and rather cumbersome ... So .. I borrowed prims method from what R0j0 posted, and played around with it.
One of the things I pondered with how this could work and most importantly, be applied in game.
Here I took the extra step of creating portals in the interconnected rooms.
I added a delay between the creation steps, so you can see how the map gets build.
In the end the rooms get repositioned, this with the idea that you could eventually place the room anywhere on your layout, and still get connected to the proper rooms. This lends itself for a variety of extra options.
The repositioning is done so the visual aspects still shows where rooms doors point to atm.
Now, the rooms have no solid walls atm, and the player is a simple move8 which can just cross over walls atm. In a worked out scenario, the rooms will have extra walls with solids or what not.
edit: added some walling with solids and pushout
The test is to use the portals with the player.
boomtanium.com/construct/Dungeon_generator
I liked creating this, if you have feedback or suggestions for adaption, feel free.