EDIT: This is probably in the wrong place. If a mod sees this would you be able to move the thread for me please or redirect me to the correct sub-forum.
A little bit of context: I’m currently toying around with level generation for a game i want to make. I’ve managed to make it such that the rooms are randomly positioned and sized and none of them overlap as seen below.
Example of a generated level
What would be a good way of creating a path inbetween rooms. Perhaps with a variable average number of paths entering/leaving each room?
The general scripting area is fine to discuss this, but there is also a brand-new “World Building” forum right next to us in the main directory.
The problem you are working with touches on a lot of disciplines: graph theory, game design, spatial distribution, etc. You want to make connected rooms that are believable, not in any way disconnected and unreachable, and yet with enough hallways the entire level becomes open space, and you don’t want that either.
Fortunately there are a LOT of games that do this already, and their source is freely available for you to get ideas from, or sometimes just use outright. Rogue and Angband are two of the most popular grid-based roguelikes, but there are hundreds if not thousands of others out there, all employing varying ways of creating rooms. You might want to google up sourcecode for other roguelikes to get some ideas about how you can connect your rooms in a reliably complete way.
GREAT list of resources there both from @MadeFromPolygons_1 and @jhocking … thanks! If either of you spontaneously posted this list over in the World Building forum, I am sure there would be a warm reception there. If you like, I can post it there too, up to you.