Hacker News
Building a Procedural Hex Map with Wave Function Collapse
porphyra
|next
|previous
[-]
Furthermore, various heuristics can speed up the backtracking a lot compared to a brute force approach. As anyone who has implemented a Sudoku solver can attest, a brute force backtracking is easy to implement but will immediately get bogged down with slowness.
rhdunn
|next
|previous
[-]
jcalx
|next
|previous
[-]
jbmsf
|next
|previous
[-]
jesse__
|next
|previous
[-]
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.
OscarCunningham
|next
|previous
[-]
teamonkey
|root
|parent
[-]
WFC is brute-force-simple, but because it’s simple it’s quite computationally inexpensive (unless it hits a lot of dead-ends) and I wouldn’t be surprised if it could often find an adequate solution quicker than a SAT solver. At least for games, where a result doesn’t need to be perfect, just good enough.
xipho
|next
|previous
[-]
schemathings
|next
|previous
[-]
tomtomistaken
|next
|previous
[-]
[0] https://store.steampowered.com/app/1455840/Dorfromantik/
bhaak
|root
|parent
[-]
https://boardgamegeek.com/boardgame/370591/dorfromantik-the-...
ionwake
|next
|previous
[-]
btbuildem
|next
|previous
[-]
westurner
|next
|previous
[-]
> Model synthesis (also wave function collapse or 'wfc') is a family of constraint-solving algorithms commonly used in procedural generation, especially in the video game industry.
> [...] One of the differences between Merrell & Gumin's implementation and 'wave function collapse' lies in the decision of which cell to 'collapse' next. Merrell's implementation uses a scanline approach, whereas Gumin's always selects as next cell the one with the lowest number of possible outcomes
And then `## Developments` mentions:
"Hierarchical semantic wave function collapse" (2023) Alaska, Bidarra: .. citations of: https://scholar.google.com/scholar?cites=1671019743611687613...
kevinsync
|next
|previous
[-]
I was also wishing I could zoom in to human size and run around HAHAHA
contextfree
|next
|previous
[-]
behnam_amiri
|next
|previous
[-]
verdverm
|next
|previous
[-]
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.
moi2388
|previous
[-]
imadr
|root
|parent
[-]
zparky
|root
|parent
[-]
"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