Did you try using the event that was disabled at the top of the event sheet ( Gizmos is in collision with Rooms; Delete gizmos) ? Not sure if you meant that when you said “it’s not just a matter of checking if there’s a room next to the new room”. I’ve found that it reduces the time of creating the full layout (most of the time) and the layout created looks more random. Though, it still uses brute force until it comes up with the solution and I’m not sure if layout will be created correctly every time ( I’m still checking this).
But to be honest, even if it takes around 10-20 seconds is okay. Maybe I can put up a loading screen until it is finished. What worries me now is that memory gets flooded quickly and game slows down when rooms are generated this way. You can check it for yourself in the task manager.
I don’t know if there is a way to clear the cache when layout is created?
EDIT: Nevermind, layouts are created incorrectly sometimes with this event. I will add the lines you did and dig some more.