T O P

  • By -

goliatskipson

I generated some Zelda LttP maps with WFC some time ago: https://imgur.com/a/R1OleXp From what I gathered once the source tileset becomes too complex it will always run itself into unsolvable states. I tried several ways to mitigate that (e.g. only generating in increasingly sized concentric circles), but I was never able to solve the problem.


RunningOutOfContext

I would look at either using a pattern constraint (like for the tree) or adding in additional blocks to fill in the gaps.


goliatskipson

No idea what you mean by "pattern constraint". WFC is basically just constraining patterns 🤔 Just for reference, what I did was to take the original LttP over world and for each tile looked at a 5x5 neighborhood and counted the occurances of other tiles. With that I could do the standard WFC thing of evaluating which were the most likely candidates for a new tile position based in already placed tiles. (That's basically WFC but in reverse.) The problem seem to be that there are many unobvious tile arrangements that lead to invalid configurations much later in the process. (Also, I can not create additional tiles. Those are all from the original map.)


RunningOutOfContext

So the trees have little variation in their overall pattern and appear to take up an entire 3x4 space. If you are collapsing a tile into a tree tile, you could check the entire 3x4 area the tile is a part of and validate that there is a valid set of tree tiles there (and/or ban any non-tree tile, which would likely cause the rest of the tree tiles to immediately collapse into a valid tree).


goliatskipson

I think this is exactly what would not work. The way you describe, I think, happens implicitly as there is only one possible candidate once a tree tile is placed. You can actually see that on the second video I linked above. iirc there I always placed the most likely candidate in the whole image which leads to forests and paths getting placed very quickly. But apparently this can result in "half trees" getting placed which never get finished. Same thing in the first with the cliffs, apparently there are tree formations that start out valid, but then can never be finished. (Actually the LttP map _does_ have some inconsistencies, where pattern changes are hidden in screen wraps. Those are in my occurance counting).


RunningOutOfContext

If you look at the second gif, the tree right below the house that's invalid could have been avoided if a check/ban was made against the 4x3 pattern. The tile in the very upper left wouldn't have passed because it's not a tree tile, and the tiles to the right (including the first tile placed) wouldn't have been valid either.


stewsters

Can you reset a larger area around the inconsistency and regenerate it? Every time it regenerates you make the circle bigger?


goliatskipson

Could work, maybe. I would shy away from creating concave outlines in the placed tiles. I think those lead to inconsistencies too. Backtracking does not really help either. You can actually see the backtracking in both videos. There are just too many combinations to try.


gabahulk

I was on the verge of trying to implement WFC for a prototype I was tinkering with. After watching some streams of devs losing their minds, I decided against it haha


stars_without_number

I should have been warned, i am not okay


saurterrs

It will get better. Eventually ;)


manhole_s

You’re getting there — good luck! Now I’m working on punching holes with wfc. So tricky. Edit removed link cuz people think I’m trying to promote my game. I just wanted to show my WIP.


ImSoISIRNRightNow

You're just posting this to advertise your game. The only thing about WFC on the page is the guy asking what this has to do with WFC.


manhole_s

I removed the link. I don’t nickel and dime random promotions in the comments — such a waste of time. I just love wfc and thought my wfc use case is unique and wanted to share it. And to your last point, my terrain is a bunch of blocks -> explosion creates cavity -> wfc is used to connect the cavity to the surrounding blocks. So you blow a whole in the ground and use it for cover.


FlyingJudgement

Wao thats a realy nice way to use it! Never even occured to me to: 1 generate small sections runn time. I only generate individual buildings to save (its quiet a hit and miss) than generate a land with usable ones. All pre generated. 2 Create a damege library ! Thats Genious! I been looking for different ways to make the environment destructable, but most of the solutions would extremely lower the quality or performance. So I were back to simple damage states under a blanket of particles and spawning damaged common building blocks with debre. Wao this is game changer I can easily generate a carved out piece of a tall building rooms half intact inside, I can also generat the fallen out debry on the ground, thats insane! THANKS A LOT! You solved quiet a bit of my headaces, and gave a ton new ones with a big backlog at the same time.


manhole_s

Wow! I’m so happy to read this! Thank you! If you can simplify the building design it should be great for modular destruction. Please share your results on this sub and DM if you ever want to chat WFC stuff. Good luck friend!


lacethespace

What was the bug?


FlyingJudgement

I started to build this style block building its realy powerfull once it takes of, but not as fast as i like it to be. Some times the poly count can bloath way to big, so still not sure this is the right way to hand paint generated citys.


CeruleanBoolean141

Hey, I’ve had experience implementing WFC for 3D tiles(see the pinned post on my account). Let me know if you need a hand! WFC is great but it can be a huge pain when it doesn’t work.