HNHacker News
TopNewBestAskShowJobs

marian42

31 karma · joined November 13, 2018

submissionscomments
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
If you have two adjacent chunks, collapsing one will impose constraints on the other one. Even if the RNG part is deterministic, as you suggested, the result will be different depending on which chunk you collapse first.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
Each block has a probability of being selected. You could make this probability location dependent, for example by sampling a noise function. That way you get something like biomes.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
In the algorithm as it's described on that page, nothing is returned in case of a failure. I first implemented it so that single blocks would fail and a white cube would spawn at that position. Now, it uses backtracking. It keeps a history of its decisions and removes some whenever it reaches a contradiction.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
If you (or someone with a Mac) wants to create a build with the Unity Editor, I'll add it to the itch.io page.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
This is exacly it. Collapsing one area changes the possible blocks for nearby areas. If you use the same seed, you can still get different results by exploring places in a different order. Maybe there is a way to get around this though.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
My implementation keeps the entire world in memory, forever. This is obviously not desirable, but I didn't figure out a way around it. You can't generate a place again that you have been to because the result would be different.

If you do chunks and generate the edges first, you could run into a situation where it's impossible to fill the chunk based on it's edges.

For generating terrain, using noise functions makes a lot of sense since they are local (= don't need to know nearby values to evaluate) and deterministic.

marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
Since the algorithm is not deterministic I imagine it would be a nightmare to make all clients see the same world. But I agree it would be fun!
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
I don't currently have access to a Vive, but I worked with it earlier. All that needs to be done is add SteamVR to the project and hook up teleportation. That's it.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
Yes, it does. However the algorithm is not deterministic. If you close the game and start it again, you will see a different world.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
You're right. There is backtracking in the demo and when it happens it looks quite eerie. The world around you just decides it wants to look different and changes.
marian42··on Infinite procedurally-generated city with the Wave Function Collapse algorithm
In my case, the probabilites for each block are supplied manually.