How to generate dungeons with doors?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SebSharper

I am trying to make a dungeon generation system for my game. I plan on using rooms (scenes) I already made and just add them in a random position, for example. The issue is that I don’t know how could I add doors to these rooms.

Would it be better to make the rooms with the doors? Or would it be better to get the position where two rooms collide and “break” that part, adding a door after that (The rooms are tilemaps)

:bust_in_silhouette: Reply From: Inces

I am doing a project with design just like this right now

My room blueprints have marked joint tiles. Room menager generates rooms in certain locations and orientations connected by these joint tiles. After connection joint tile becomes integral part of a second room and later door is generated in this place, oriented as indicated by connection. Finally menager builds walls everywhere to border generated tiles from surrounding emptiness.
This way of solving this was important for pathfinding - You don’t want one-tile long roomless corridor just for the purspose of door.