Hello,
I have been trying to give some refinement to the way I currently generate my level for an artistic choice, and also in order to prevent rooms overlapping at their exits which allows players to get outside of the map.
I have been unsuccessful thus far and so I have come here
This is the system I’ve fallen back on, it allows for me to set the first room then it chooses a random next room or corridor as long as it fits considering several hit boxes. I have on the right in the details two unused arrays which one holds all the rooms, and the other all of the corridors. I last tried using a flip flop off of the false branch which takes the boolean “Corridor?” as it’s input "which by default is true because after the first room I would want a corridor. on the flipflop a I set corridor? to false and then set the selected Room to Spawn to a random corridor. The flipflop b sets corridor? to true and spawns a room. I figured this would give some results, but it only resulted in a less complete generation, but rooms would still spawn after rooms. I presume because I have more than one room exit in most rooms that the flip flop would for a 3 exit room try to spawn a corridor on the first and last and a room on the second. and since they have access to fewer assets they would just continue after they fail.
I want for my system to if the next room is spawning off of a room have a 100% chance to spawn a corridor, and a controllable chance of spawning either a corridor or a room off of a corridor for more interesting layouts.