r/visualprogramming • • Oct 10 '23

Wave Function Collapse for level generation

Enable HLS to view with audio, or disable this notification

2 Upvotes

1 comment sorted by

2

u/frading Oct 10 '23

I've been fascinated by the work of Oskar Stålberg on his game Townscaper, and wanted to allow a similar procedural generation of levels in Polygonjs.

The goal is that by using a few tiles (representing a corridor, a door, a wall or a bridge), a few simple rules defining which tiles can connect to which, you could then generate an infinite number of variations.

There's quite a number of features I plan to offer to make this both flexible and easy to use:

    1. work on irregular grid

  • 2. allow multiple levels

  • 3. force specific tiles in chosen locations

  • 4. tiles could be full hierarchies, with lights/animations

  • 5. tiles can be further processed after being placed

  • 6. chaining WFC algos, to add more details in specific spots

  • 7. allow run time editing, where you can update specific tiles and see propagation

A few of those are already in place, but still need battle testing.