Building a Procedural Hex Map with Wave Function Collapse

(felixturner.github.io)

97 points | by imadr an hour ago ago

18 comments

  • jcalx a few seconds ago

    Reminds me of Jasper Flick's Unity tutorial on hex terrain [0] which is similarly wonderfully detailed. Interesting contrast: this project uses premade tiles and constraint solving to match tile boundaries, while that one dynamically generates tile boundaries (geometries, blending, etc.) on the fly. Both enjoyable reads!

    [0] https://catlikecoding.com/unity/tutorials/hex-map/

  • contextfree an hour ago

    "Stop playing your AI garbage and get to bed!" "Mooooom! It's not AI garbage, it's classical procedurally generated content!"

  • rhdunn 7 minutes ago

    Oskar Stålberg used wave function collapse for various games, including Townscaper. He talks about it here: https://www.youtube.com/watch?v=Uxeo9c-PX-w&pp=ygUhdG93bnNjY... (SGC21- Oskar Stålberg - Beyond Townscapers).

  • schemathings 16 minutes ago

    OP is probably familiar but this site has a lot of good examples of hex math with code examples - https://www.redblobgames.com/grids/hexagons/

    • zparky 6 minutes ago

      They link to that site in the post

  • xipho 44 minutes ago

    Inspirational stuff, with lots of great references to the OGs at the bottom, and source available. Now can it be merged with the look/feel of https://heredragonsabound.blogspot.com/. ;)

  • tomtomistaken 19 minutes ago
  • jesse__ 33 minutes ago

    Love this.

    As an aside, if the author reads this, did you consider using bitfields for the superposition state (ie, what options are available for a tile)? I did a wfc implementation a while back and moved to bitfields after a while.. the speedup was incredible. It became faster to just recompute a chunk from scratch than backtrack because the inner loop was nearly completely branchless. I think my chunks were 100 tiles cubed or something.

  • kevinsync 18 minutes ago

    Super awesome, love the tilt-shift camera effect!

    I was also wishing I could zoom in to human size and run around HAHAHA

  • nickandbro 37 minutes ago

    This looks amazing man, seriously good job with this.

  • behnam_amiri 16 minutes ago

    This is cool. Curious if you plan on keep it as a map generator or turn it into something more interactive too.

  • bobek 33 minutes ago

    Made me smile. Thank you!

  • ArcaneMoose 27 minutes ago

    Beautiful work!

  • moi2388 31 minutes ago

    This entire article reads like it was fully written by AI unfortunately

    • imadr 3 minutes ago

      Is it the em dashes? I didn't get the feeling it was AI generated at all

  • MattDamonSpace an hour ago

    Gorgeous

  • verdverm 43 minutes ago

    Related (?) has anyone else been following the Hytale Worldgen v2? They've built a visual node editor so anyone can create biomes, structures, or complete worlds. I believe there is a competition going on right now.

    They are essentially making the entire game based on similar concepts and then using them to develop their core content. Simon is an inspiration and has said they won't be taking investor money so they can stay true to the users and creators.

  • gedy an hour ago

    Real engineering skills, I love it.