Improved Room Decoration with Pattern Collections

The procedural room layout engine continues to improve. Today I added two main features:

1. The entire dungeon generation is deterministic for a given random number seed. Thanks to Chris Pavia for recommending I do this early on–it’s already helped out in testing a lot. If I find a flaw in the layout, I can keep working on the same room until it’s fixed.

2. The pattern merger takes the doorway positions into account, so it won’t block off an exit to the room. It also has a list of available decorations (currently just to serve as room corners and island splits), and picks one at random that is small enough to fit without blocking any doors.

Here’s how I design the corner decoration patterns:

sc3 corner designerAnd here is a room that draws from this collection:

sc3 corners

The corners get flipped and anchored properly, so any of the four source patterns can be applied to any of the four room corners. The split island with the two columns can also be rotated 90 degrees, to be anchored to any doorway in the room. In a smaller room, it probably couldn’t be this enormous structure without blockading a doorway–in which case the layout engine picks a smaller pattern that fits the same purpose.

At the top right, we still have some issues with merging of two patterns. One of the next things to do is set up merge mode priorities for tiles within the pattern, and patterns as a whole. This way I can add a wall or pillar structure without paving over the grass, like we see above.

I’m pretty close to having an explorable, decorated 5×5 dungeon (minus the creatures and items). The pattern system can be expanded to add all varieties of features to rooms, especially central structures like moats and interior rooms.

Leave a comment

Your email address will not be published. Required fields are marked *