Randomised region order?


I’ve been thinking of making a quick survival horror -type game where the player has to escape from a randomised maze. To make the maze not stupid, I’ve been thinking of creating a bunch of pre-designed regions, which are then linked together in a random order.

How it would practically work, is that you’d have, say, a pool of 30 different regions (lake region, forest region, cavern region, etc), and every time the game is started, it draws 15 of those from the pool, and links them together in a random order. So during one playthough the lake region would lead to both forest and cavern region, during a second one the forest region would link to cavern region which would lead to lake region, and during a third the lake region might lead to cavern region without the forest region existing at all. It’d probably best be accomplished by “joints”, a specific kind of a room that has a POSSIBILITY of leading to another region. So if the forest region, for example, is drawn from the pool of possible regions, then at least one of the forest region joints would have to lead to a joint from one or more different regions.

Naturally, the structure should also be logical. If you can get from forest region joint A to lake region joint B by going north, you should be able to get back to forest region joint A by going south. It also shouldn’t be too much of a web: dead ends are good, and every region connected to another would be a bad idea. Then again, it’d make it feel less linear and more organic if it at least had a possibility to happen…

Since pictures are worth a thousand words, I’ve uploaded some. In the following pictures, there are three example regions: A, B and C, and three different ways for them to be connected together.

The three regions, without any connections (circles represent rooms, red circles represent joint rooms): i.imgur.com/PhXWF.jpg
Simple linear connection (the joints crossed over mean dead ends): i.imgur.com/Fu0Oe.jpg
But a single joint might lead to multiple regions: i.imgur.com/iMuSl.jpg
And sometimes, you might be able to walk a full circle: i.imgur.com/3hcgB.jpg

Now, while I’ve got some basic grasp of how the structure would work, I can’t say I know where to begin to actually implement this. Any help?

I think Recipe Book 3.2 (Place: Map) would be useful here, especially examples 125 (Bee chamber) and 78 (All Roads Lead to Mars). I’d suggest trying to build what you want first, then coming here if you run into specific problems. We can always provide much more useful help when we have existing code to work from.