Im making a game with randomly generated areas, those being interiors with rooms and hallways. I have a system down, where basically, all rooms have a connector1 and 1 or more connector2s, and a random room is chosen and its connector1 is connected to the last room’s connector2.
It works, but its very boring to explore and any enemies in the interior arent really scary, because if you know its general direction, you know exactly where it will come from, as no paths connect to eachother; paths just generate until a dead end, or maybe a new path will emerge depending on the random rooms chosen. But no 2 paths ever connect, meaning monsters (or you) cant take the long way around for example and will always have to take the same route as you.
im not good at explaining so I hope i got the issue clear.
i’ve thought about using some grid system , but i have no idea where to begin, and if I did use it, the rooms would be too limited in shape and doorway locations.
In this very high quality map, the white lines are the generated paths. Notice how they all always end in dead-ends, never loop back. Green lines is how i’d want it to connect.
I’m not exactly sure how you would achieve this; however, I imagine you may have to create an algorithm to generate rooms/hallways to connect 2 points/positions.
This could be done by finding 2 points with a straight path in between them with nothing in the way (could likely be achieved using a raycast) and then creating a hallway between the two points. (I would generate it by using a similar system including different parts/sections and having a range of lengths to ensure it fits the space between the points as this would allow for both variation and good looking rooms). You would likely have to create an algorithm to decide which parts to place based on the distance and their lengths.
I imagine this method is similar to how fences are generated in games such as Bloxburg but I am unsure.
I imagine this may work; however, I’m unsure but I hope it helps in some way
You could select a bunch of random positions (on a grid) for all of those points, and then create a room at each point. You could then connect each point with one or two nearest points with a hallway (make sure to account for the distance).