Map Generation in the 7DRL Get Well Soon

I’ll talk about the actual 7-day roguelike game itself eventually, but this dev blog post about using WaveFunctionCollapse to generate levels caught my eye for both the technical results and the description of the process of working with a PCG algorithm.

I’m always interested to see the processes that other developers use: what problems did you run into, how did you approach solving them, why did you make those particular design decisions?

For the use of WFC specifically, the two things that caught my eye here was the emphasis on the image-based pipeline for prototyping with WFC and the use of additional constraints.

In my opinion, one of the most powerful aspects of WFC for PCG development is that the interface can be entirely based on the images you give it. Rather than writing rules or dragging sliders around to find the right numbers, you can use the intuitive interface of painting what you want the thing to look like. In practice it’s a little trickier than just painting an example, since it learns long-distance relationships and particular constraint rules from the image, which can take a little getting used to. But the main point is that an artist, with no understanding of the code, can start playing around with it and gain an intuitive understanding. At the same time, an expert can fine-tune the output with the same image-based interface.

Being able to play with the inputs to a generator is a massive productivity boost. We go from painstaking experiments, moving one knob at a time, to trying whimsical combinations that open new possibilities.

At the same time, the image-based interface does have its limitations: some things are more easily expressed in other ways. We still want to use the image-based interface, but at the same time we want our images to have an additional layer of information: for example, making sure that the rooms we generate are eventually connected with the front door. In this case, some of the added rules were removing the fully-white tile from the adjacency rules and adding some additional border-selection logic. These can be added, and I’ve implemented variations on this myself–but, of course, one of the strengths of WFC is that you don’t need to know the code. (Which is why one of the things I’m working on is trying to find effective ways to express new constraints in WFC, to make it integrate better with a pipeline. But that’s a topic for another day.)

https://gridbugs.org/7drl2019-day1/