I’ve been thinking a bit about how to make more random structured specials generate, and I’ve come up with a few ideas that I’d like to get some feedback on. The end goal is to allow people to create structures like labs through json.
The first thing it needs is a field containing a tile or an array of tiles for each connecting direction, like the json mapgen roads. So, there would be something like an array for straight connections, dead ends, perpendicular connections, 3-way connections, and 4-way connections. Next, there would have to be arrays for up and down connections (these would also exist in the other connection arrays where applicable). Then there will be a set of parameters to control how large it can grow in each direction, including a min, max, and possibly a skew size (if you want a size between 2 and 8, but skewed towards 3). Finally, I think there should be some way to specify a set of features that have to be generated, and the randomly generated portions will fill in the connections.
Another way to specify could be to set up an array of “edge” tiles, then an array of “filler” tiles. Given a size and the given sets of tiles, it would generate a randomly sized structure with edge tiles forming a border and filled in with interior tiles. I think that works better for open spaces, like a junkyard, while previous method would work better for more detailed and enclosed structures, like a mall or a lab.