0

I'm trying to create a procedurally generated dungeon based game. I have a set of rooms and I have the x,y coordinates of their midpoints.

What's the best way to create a connected graph based on these rooms' x,y coordinates?

Rooms

I'm coding in C#, but feel free to post some pseudocode.

Edit: Edges may overlap. I previously said that I don't want edges to overlap but overlapping edges should be fine. I apologize for the confusion.

Thanks!

See the image: I want to connect the red rooms in a graph data structure.

  • The midpoints of the rooms aren't a good connection point. Where the doors will be is a better connection point. – Morgoth Mar 18 '17 at 09:46
  • Can you draw a sketch of what you have and what you want? – TaW Mar 18 '17 at 10:04
  • Hi - I updated the question and uploaded an image above. I previously said I don't want overlap, but this is fine. I just want to generate a random connected graph between these nodes in an efficient way. – Sheel Parekh Mar 18 '17 at 10:15
  • @Morgoth - I'm not actually interested in creating the actual hallways at the moment. I'd just like to create a graph-like data structure so I can ensure my main rooms can reach each other. I should have clarified that, sorry! – Sheel Parekh Mar 18 '17 at 10:20

0 Answers0