Sample Levels from placerooms.pl

Table of Contents

Previously:
  1. Batch One
  2. Batch Two
  3. Batch Three, with the Cavern room type added.
  4. Batch Four, with the Barbell room type added.
  5. Batch Five, with Lakes added.
  6. Batch Six: Triangles, Quadrilaterals, and Fuzz
  7. Batch Seven: Fixing Dead-End Corridors
  8. Batch Eight: Cutouts and Bug Fixes
  9. Batch Nine: Traps
  10. Batch Ten: Lined Barbell Corridors
  11. Batch Eleven: More Corridors (quadrangles, lollipops)
New Content
  1. Batch Twelve: Reclaiming Negative Space
  2. Batch Thirteen: Intersections
  3. Batch Fourteen: Larger Map Sizes
  4. Batch Fifteen: Unfilled Maps
  5. Batch Sixteen: More Unfilled Maps
  6. Batch Seventeen: Less Regular Diagonal Corridors
  7. Batch Eighteen: Overlapping Corridors
  8. Batch Nineteen: Cyclic Corridors
  9. Batch Twenty: Hexagonal Rooms

Batch Twelve: Reclaiming Negative Space

After all the rooms are placed, sometimes there are some pretty big open areas left, so I asked myself, Why not try to reclaim some of that? Re-using some of the area-selection code from cavern-type rooms made this fairly easy to implement.
[map image] [map image] [map image] [map image]
One problem with this is, sometimes it reclaims too much of an edge, which calls an unfortunate amount of attention to the overall rectangular shape of the area in which the level is generated. This next one is a really pronounced example of that:
[map image] [map image]
The edge problem is particularly noticeable when it also includes a corner:
[map image] [map image] [map image]
The edge/corner problem gets even worse when multiple corners are involved:
[map image] [map image] [map image] [map image] [map image] [map image] [map image] [map image] [map image]
At this point I had an idea for how to mitigate the edge/corner issue somewhat, so as to avoid needing to throw out the whole idea of reclaiming negative space. It's a simple idea: I masked off the corner areas pre-emptively before looking for candidate areas to reclaim.
This next level was my very first run with that change: it was a barbell level with a non-stone-lined barbell corridor, and the negative space that got reclaimed was next to the corridor, causing the middle part of the corridor to get converted into room floor, leaving corridor at the ends of it:
[map image]
Areas on the edge do still get reclaimed sometimes, when they don't include a corner:
[map image] [map image] [map image]
Here's another case where negative space reclamation absorbed part of an adjacent corridor (three tiles of the corridor remain at the north end):
[map image]
Here a small internal area was reclaimed (a few tiles northeast of the corridor):
[map image]
Here a three-tile cutout inside a room was reclaimed:
[map image] [map image] [map image]
Here the middle part of the quadrangle interior was reclaimed:
[map image] [map image] [map image] [map image]
Finally, a demonstration of the fact that randomness can occasionally produce outcomes that don't look random. You wanna guess which part of this map is the reclaimed negative space? Would you believe it's that perfect 18x3 rectangle in the bottom center of the map?
[map image]
Yep, no kidding, it reclaimed a perfect rectangle. I know this stuff because I use the debug features to see progress as the level is generated. In this case, here is what the map looked like before negative space calculations, and so here are the negative spaces and the selected one being added.
Continued in Batch Thirteen