This is quick simulation of a WFC (simple tile-based approach) simulation.  The terrain is generated with WFC, using three different tiles.

Also the two buildings are generated with WFC as well.

If possible, a road is drawn between the two doors of the buildings using an A* pathfinding algorithm i developed.

Spacebar or pointer click re-runs the simulation


This is tied to an article posted at https://dev.to/excaliburjs/wave-function-collapse-d3c for more information on Wave Function Collapse

Comments

Log in with itch.io to leave a comment.

https://dev.to/excaliburjs/wave-function-collapse-d3c

Got here from the article found here. Wanted to create a link in case people find the itch page without context.

This is a very nice demo and explanation of the wave form collapse method! Thank you for writing and making it. The algorithm always seemed kind of mysterious, but now I understand it a lot more! For me, the missing link was the database of tile rules. A lot of other demos have too much logic going on there, you kept your explanation very simple. Thank you!

Thank you very much, that's awful kind of you to say.  Don't hesitate to ask any questions if they come up!