<\/a>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.<\/p>\nSome 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)<\/p>\n
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.<\/p>\n
Still, I’m pleased to have been able to focus enough to put the code together today. Must mean that I’m getting better! :)<\/p>\n","protected":false},"excerpt":{"rendered":"
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…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/po9WK-1L","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/109"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}