Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Using Wave Function Collapse to create a 2D map (github.com/victorqribeiro)
4 points by atum47 on May 7, 2022 | hide | past | favorite | 1 comment


Hi everyone, I finally got around to implement my version on the wave function collapse algorithm. WFC uses rules to define what tiles can be placed around each other. In order to achieve this rules, I wrote I simple tool that helped me to visualize every tile and all the tiles that can be placed around it (top, right, bottom and left sides).

My code is very simple, I haven't looked at the original WFC code at all, I just "learned" the concepts.

So, first I place a random tile at a random position, from that I grow the map chosing the neighbor with the lowest entropy (smallest number of possible tiles).

Hope you like it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: