As it turns out, my “try to place a room in a square bordering two used squares” algorithm works extremely well; far better than I’d expected! However, the code required to make the system not get locked up repeatedly trying to place a room which simply won’t fit isn’t exactly trivial. the above is the first successful mansion floorplan I managed to generate; the previous attempts all ran into problems and ended up in infinite loops partway through the process. The algorithm will need an awful lot more smarts to avoid those infinite loops.
Some interesting points. I’ve found that hallways need to be only one square wide or high; they just didn’t look like they were the correct size at one square width. (Of course, that probably just means that my rooms are too small, which also means that my mansion grounds are too small, which they certainly are)
After having played with this for a little while, I’m starting to think that I should really grow a series of hallways after growing the entrance hall, and then grow rooms after that, to try to fill in the gaps, instead of trying to grow it all at once. Mansion floorplans look really unnatural if you have several hallways that aren’t actually connected to each other.
Still, I’m pleased to have been able to focus enough to put the code together today. Must mean that I’m getting better! :)