Ardenian
A
Ardenian
I currently create a dungeon generator and have the problem that I have to check for overlaps when creating dungeon rooms.
My current approach is to check if the edges and the center of a room are within another room, based on x and y values of the corresponding points.
However, this is quite odd to read and perform, the reason why I don't post a script,
also because there is still a possibility there is an undetected overlap.
Therefore I would like to know, what is the most efficient way to check if there is an overlap between two different regions ?
Now the problem comes: I initally don't have regions.
Each dungeon rooms has a clear defined edge at the top left. One can create all other locations of this room with that point.
I would like to create regions with two points, the top left edge and the bottom right one.
However, how do I transform these two points into a region and how do I check if two of these regions overlap ( saving each region of a dungeon room in a variable) ?
My current approach is to check if the edges and the center of a room are within another room, based on x and y values of the corresponding points.
However, this is quite odd to read and perform, the reason why I don't post a script,
also because there is still a possibility there is an undetected overlap.
Therefore I would like to know, what is the most efficient way to check if there is an overlap between two different regions ?
Now the problem comes: I initally don't have regions.
Each dungeon rooms has a clear defined edge at the top left. One can create all other locations of this room with that point.
I would like to create regions with two points, the top left edge and the bottom right one.
However, how do I transform these two points into a region and how do I check if two of these regions overlap ( saving each region of a dungeon room in a variable) ?