Map Generation Logic
Posted: Mon Jun 20, 2016 3:19 pm
Hey guys. So now that I've got the rooms imported into Unity I'm working on the random map generation which will include item placement and triggers for each room. I'm working on making that stuff modular. As for the room generation algorithm itself, I'm merely copying the code for CreateMap() into C# and then will pass it a list of rooms of each type. I'm starting to get a grasp on it, but was wondering if experienced modders could point out anything I should look out for.
I'm assuming that mapTemp is just where rooms should be on a grid? Is it an integer array that is also being treated as boolean, since it is assigned values such as true that are later changed to 2, 3, etc? And finally, if I pass in the x and y coordinates generated by the CreateMap() script, is there anything else i have to do to handle positioning or will that do it? Also how does this guarantee rooms do not overlap?
I'll probably stumble along the answers as I continue to convert and parse the code, but I'd rather not reinvent the wheel if people have a better understanding of these things. Thanks!
I'm assuming that mapTemp is just where rooms should be on a grid? Is it an integer array that is also being treated as boolean, since it is assigned values such as true that are later changed to 2, 3, etc? And finally, if I pass in the x and y coordinates generated by the CreateMap() script, is there anything else i have to do to handle positioning or will that do it? Also how does this guarantee rooms do not overlap?
I'll probably stumble along the answers as I continue to convert and parse the code, but I'd rather not reinvent the wheel if people have a better understanding of these things. Thanks!