"WebGPU is not available on your device or browser.". Other 3d demos works fine though. Tried Firefox and Opera on mobile.
Building a Procedural Hex Map with Wave Function Collapse
51–60 of 92 posts
Re: Building a Procedural Hex Map with Wave Function Collapse
#52This is fun and neat, and looks fantastic, but the generated maps are basically nonsensical, aren't they? Landmasses and waterways and roads and buildings and forests and so on that don't make any logical sense for their placement. I say this having had a couple of fun "hex-based strategy game hobby projects" over the years (sidenote -- trying to cover a sphere in hexes is actually a non-trivial matter). Invariably I…
> This is fun and neat, and looks fantastic, but the generated maps are basically nonsensical, aren't they? WFC lets you address that though with extra constraints. e.g. my bot today generated a church inside a river loop[0] - completely useless! But I could add a rule that says "if you place the church-above-river tile, the tile above that cannot be anything horizontally blocking" (obviously after tagging any releva…
That said, there's an Apple TV video of a castle on an island where my first thought was "why does this exist?"
Re: Building a Procedural Hex Map with Wave Function Collapse
#53Earlier quoted context omitted.
Is it the em dashes? I didn't get the feeling it was AI generated at all
It's current year, of course they used AI to help [0], and it does feel like the article was AI assited. "This map isn't flat — it has 5 levels of elevation." "The ocean isn't just a blue plane — it has animated caustic sparkles" "The fundamental issue:" and "The key constraint:" I still enjoyed the article. [0] https://github.com/felixturner/hex-map-wfc/commit/1679be
Re: Building a Procedural Hex Map with Wave Function Collapse
#54Re: Building a Procedural Hex Map with Wave Function Collapse
#55Re: Building a Procedural Hex Map with Wave Function Collapse
#56Earlier quoted context omitted.
> This is fun and neat, and looks fantastic, but the generated maps are basically nonsensical, aren't they? WFC lets you address that though with extra constraints. e.g. my bot today generated a church inside a river loop[0] - completely useless! But I could add a rule that says "if you place the church-above-river tile, the tile above that cannot be anything horizontally blocking" (obviously after tagging any releva…
not trying to be contrarian but a church inside a river loop sounds like a super sacred church that requires a pilgrimage to visit. That said, there's an Apple TV video of a castle on an island where my first thought was "why does this exist?" https://vimeo.com/657386068
"Though hidden from the sea, the castle controls access to Loch Shiel" says Wikipedia. Which is a sensible thing for a castle to do back in the olden times.
Plus it's a tidal island - you can just walk across. Don't even need a drawbridge (although I guess that makes defending attacks from inland a bit tricky.)
Re: Building a Procedural Hex Map with Wave Function Collapse
#57The goal of the original algorithm ( https://github.com/mxgmn/WaveFunctionCollapse ) is to infer the constraints from a sample, and then run a constraint solver.
Hard-coding the constraints skips the whole point of the algorithm (which is also badly named by the way).
Re: Building a Procedural Hex Map with Wave Function Collapse
#58In the level data, the start/goal tiles (approx 10x10 blocks of solid ground under the player and goal) and slopes aren't represented by their tile offset in the level data -- whilst all other "ground" tiles are. Instead, for slopes you're only told the start and end coordinates, and they often overlap.
So to render the slopes correctly I had to work out all the rules for which tiles were allowed next to each other, and solve some ambiguity rules -- I figured out that shallow slopes take precedence over steep ones. Eventually I cracked it, but it took quite a week or so of iteration to figure it out.
Re: Building a Procedural Hex Map with Wave Function Collapse
#59Reminds 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/
Re: Building a Procedural Hex Map with Wave Function Collapse
#60The post glosses over the "backtracking" and says they just limit it to 500 steps but actually constraint programming is an extremely interesting and complicated field with lots of cool algorithms and tricks. In this case we could solve it with Knuth's Algorithm X [1] with dancing links, which is a special kind of backtracking. Algorithm X should, in theory, be able to solve the border region described in the article…