Here's some screenshots from when I was debugging my new island/building placement system. I have created about 20 islands that can then be flipped across the x or y axis, providing me with many extra island permutations. Then when I'm procedurally generating a level, it can attempt to place any of these islands underneath a building. It has to make sure it doesn't hit another island, and then if the island is placed, it then checks if there's other space left on it for the next buildings to be placed on it. It's all kind of a headache. What this doesn't show is how I carve the river out of the cavern in the first place. That was a great struggle solved long ago!
- Red squares: failed island spawn attempts
- Magenta squares: possible building spawns
- Tiny green squaress: the corners of a building's 'placement collider' or area that needs to be accessible
- Tiny teal/tiny black squares: the nearest map coordinates to the green points, going around perimeter, checking if inside cavern wall (teal) or not inside cavern wall (black)
- Tiny yellow squares: points along building's placement collider's perimeter that are outside of map coordinates
This image has a lot of the debug stuff turned off, so you can see what's underneath.