frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Building a Procedural Hex Map with Wave Function Collapse

https://felixturner.github.io/hex-map-wfc/article/
146•imadr•2h ago

Comments

MattDamonSpace•2h ago
Gorgeous
gedy•1h ago
Real engineering skills, I love it.
contextfree•1h ago
"Stop playing your AI garbage and get to bed!" "Mooooom! It's not AI garbage, it's classical procedurally generated content!"
xipho•1h 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/. ;)
verdverm•1h 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.

nickandbro•1h ago
This looks amazing man, seriously good job with this.
jesse__•1h 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.

bobek•1h ago
Made me smile. Thank you!
moi2388•1h ago
This entire article reads like it was fully written by AI unfortunately
imadr•1h ago
Is it the em dashes? I didn't get the feeling it was AI generated at all
zparky•57m ago
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

ArcaneMoose•1h ago
Beautiful work!
tomtomistaken•1h ago
Reminds me of Dorfromantik[0].

[0] https://store.steampowered.com/app/1455840/Dorfromantik/

bhaak•56m ago
Which is based on the board game of the same name.

https://boardgamegeek.com/boardgame/370591/dorfromantik-the-...

the_mitsuhiko•44m ago
The other way around.
kevinsync•1h ago
Super awesome, love the tilt-shift camera effect!

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

schemathings•1h 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•1h ago
They link to that site in the post
schemathings•58m ago
Ah I read it but missed it!
behnam_amiri•1h ago
This is cool. Curious if you plan on keep it as a map generator or turn it into something more interactive too.
rhdunn•1h 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).
jcalx•1h 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/

jcul•1h ago
That "Carcassonne" game sounds really fun. I'd never heard of it before.
porphyra•52m ago
The 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's "Layer 2" with a higher success rate as opposed to 86%.

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.

[1] https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X

westurner•48m ago
Model synthesis: https://en.wikipedia.org/wiki/Model_synthesis :

> 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...

ionwake•27m ago
This is absolutely beautiful, I could even tell I was going to like it from the title. Good job.
btbuildem•16m ago
I really like the part where you can "reroll" sub-areas of each tile. Consider exposing some of the weight knobs (eg, I'd like to tweak it to favour mountainous terrain)!
OscarCunningham•9m ago
It seems like a lot of the difficulty is in finding arrangements that satisfy constraints. I wonder if an alternative approach would be to use a SAT solver. I suppose the problem with that approach would be that the solver might always find an 'easy' solution that doesn't look random. I know that some SAT solvers let you randomly assign the initial assignments of the variables, but that doesn't mean you get a random solution. Has anyone tried a similar approach?

Iran Transformed

https://www.nybooks.com/online/2026/03/08/iran-transformed/
1•mitchbob•14s ago•1 comments

Agent Skill to Use a Debugger

https://github.com/AlmogBaku/debug-skill
1•talolard•39s ago•1 comments

EU publishers won a piece of a shrinking pie

https://mediaindustryshift.substack.com/p/eu-publishers-won-a-piece-of-a-shrinking
1•taubek•1m ago•0 comments

Fukushima at 15: Living with radioactive hot spots and stigma

https://thebulletin.org/2026/03/fukushima-at-15-living-with-radioactive-hot-spots-and-stigma/
1•CqtGLRGcukpy•2m ago•0 comments

Show HN: ChopChopGo – Sigma-based threat hunting for Linux forensic artifacts

https://github.com/M00NLIG7/ChopChopGo
1•M00NL1G7•3m ago•1 comments

Animator Pro (Autodesk Animator) Source Code

https://github.com/AnimatorPro/Animator-Pro-C
1•reconnecting•3m ago•1 comments

We strongly oppose the Unified Attestation initiative

https://xcancel.com/i/status/2031041385554386960
2•ledoge•3m ago•2 comments

Oscar Pool Ballot, 98th Academy Awards

http://fxrant.blogspot.com/2026/03/oscar-pool-ballot-98th-academy-awards.html
1•speckx•5m ago•0 comments

Advanced Pet Screen Drawing Techniques

https://retrogamecoders.com/advanced-pet-screen-drawing-techniques/
1•ibobev•5m ago•0 comments

The Reviewer Isn't the Bottleneck

https://rishi.baldawa.com/posts/review-isnt-the-bottleneck/
1•timbray•5m ago•0 comments

Apple in 2025: The Six Colors report card

https://sixcolors.com/post/2026/02/2025reportcard/
1•akyuu•6m ago•0 comments

Show HN: ContextForge now supports Cursor IDE – persistent AI memory

https://contextforge.dev/blog/contextforge-now-supports-cursor-ide-persistent-ai-memory-everywhere
1•alfredoizjr•6m ago•1 comments

Show HN: A2UI for Elixir/Phoenix/LiveView

https://github.com/actioncard/a2ui-elixir
1•maxekman•6m ago•0 comments

Reasoning boosts search relevance 15-30%

https://softwaredoug.com/blog/2025/10/06/how-much-does-reasoning-improve-search-quality
1•gmays•7m ago•0 comments

Specimen Gallery – CC0 transparent specimen PNGs organized by taxonomy

https://specimen.gallery/
1•eclectic_mind05•10m ago•1 comments

Show HN: An AI system that pushes political reform

https://twitter.com/AshtonBars/status/2031082203418079664
1•sagebowsystem•10m ago•1 comments

Price-Checking Zerocopy's Zero Cost Abstractions

https://jack.wrenn.fyi/blog/price-check/
1•todsacerdoti•10m ago•0 comments

Uber reported to the state that I was fired for "annoying a coworker."

https://anon-ex-uber.medium.com/uber-reported-to-the-state-that-i-was-fired-for-annoying-a-cowork...
3•anon-ex-uber•10m ago•0 comments

Things I've Done with AI

https://sjer.red/blog/2026/built-with-ai/
2•shepherdjerred•11m ago•0 comments

Ask HN: What apps have you created for your own use?

2•koconder•11m ago•2 comments

Sam Kriss on AI's false starts, doomsday scenarios, and eccentric proponents

https://harpers.org/2026/03/general-interest-agents-of-chaos-sam-kriss-will-stephenson-future-ai/
2•YPGolyadkin•13m ago•0 comments

Ask HN: How does one review code when most of the code is written by AI?

2•daemon_9009•13m ago•0 comments

Code-review-graph: persistent code graph that cuts Claude Code token usage

https://github.com/tirth8205/code-review-graph
1•tirthkanani•13m ago•1 comments

Latent Context Compilation: Distilling Long Context into Compact Portable Memory

https://arxiv.org/abs/2602.21221
1•PaulHoule•13m ago•0 comments

AluminatiAI – per-job GPU cost tracking (Nvidia-smi shows watts, not dollars)

1•AluminatiAi•14m ago•0 comments

Hono js

https://hono.dev/
2•dtj1123•14m ago•0 comments

Code-review-graph: persistent code graph that cuts Claude Code token usage

2•tirthkanani•14m ago•0 comments

Andrew Ng Just Dropped Context Hub – GitHub for AI Agent Knowledg

https://github.com/andrewyng/context-hub
2•v-mdev•16m ago•0 comments

Toni Schneider (New Bluesky CEO) - Coming Off the Bench for Bluesky

https://toni.org/2026/03/09/coming-off-the-bench-for-bluesky/
3•aghuang•16m ago•0 comments

Software Architecture in the Era of Agentic AI

https://www.exploravention.com/blogs/soft_arch_agentic_ai/
2•walterbell•17m ago•0 comments