DEV Community

Daniel Neveux
Daniel Neveux

Posted on • Edited on

Wizar devlog 17 - first step with Wave Function Collapse

I spent the week on Gatsby and struggle around how to decouple my boilerplate into themes... 60% successful. Not very exciting stuff.

I found joy into this little code sandbox to begin my procedural generation of Wizar maps. It will be first used for dungeon generation into our level editor.
For now it just handle some ascii to render a map, but it already can to "guess" how arrange tiles arounds.
If you click multiple time into the same cell it will get the next pattern available following this enumeration: water -> sand -> land -> forest -> mountain
Internally it uses a wave function collapse solver algorithm to figure out what tiles need to be updated.
In a reaction of a click, a function will propagate around the clicked cell, and update all the neighbors. The propagation acts like a "ripple". If the last ripple did not trigger any changes, it will stop.

Top comments (0)