- Home /
Help me finish my room generator
Hey there,
I have made a small algorithm that can randomly spawn walls inside a defined spacial range. Basically it works like this; firstly it will generate some points around the edges and then draw walls toward the inside and stop drawing walls until it has n crosspoints with other walls. But here comes the problem. I dont know how to easily create doors within those walls. Now, I need to know what would be the best way to store information about a "room". I thaught about a class that has a list for all the points on the bounds of the room. But how much would it help finding out a way to spawn doors ? You would probably go breadth search style fom a random room and generate doors so that each room can be reached. So it needs to also know a way to store information about the neighbouring room and where to place the door to get there.
As you can see a pretty simple task but maybe there are better ways to solve it rather than what I was thinking ? Keep in mind this is Unity3d. I will release a version of this for free if I get it done. It looks like this: