EASY Wave Function Collapse Tutorial for Unity Games! [Unity Tutorial]

preview_player
Показать описание
This video is a quick overview of the Wave Function Collapse algorithm and how we can apply it inside of our very own Unity Project!

Some useful resources:

Music used in video:

Chapters:
0:00 Introduction
0:58 WFC Theory
5:53 WFC Unity Tutorial
18:30 Github download
Рекомендации по теме
Комментарии
Автор

Brilliant video! Just one problem. In the CollapseCell method, I sometimes get an ArrayOutOfBounds Exception. Any possible idea why that is? Thanks for the vid btw.

Edit: I figured it out. You have to make sure you set up the rules for your tiles such that there are no conflicts when the system wants to place a tile. For example, let's say you have a rule that only a grass tile can spawn above a road tile. And you have another rule that says only a water tile can spawn under a road tile. Now if there are 2 road tiles placed vertically next to each other with a free empty tile beneath them, then the system can't figure out which tile (grass or water) to place in this empty spot since the rules contradict in this moment. At least this is what I think the issue is. Once I started creating more reasonable and comprehensive rules for my 12 tiles, then it all came together perfectly. Before that I kept getting the error cause the number of possible tiles in some locations was 0, meaning the system couldn't place any tile and hence the array was empty, leading to the error. You can either reduce the number of tiles to a more fundamental, non-redundant set, or you can improve the rules for how the different tiles are supposed to be placed next to each other such that there are no possible contradictions between them. All the best!

apeerzada
Автор

Nice video but the music is a bit too loud and distracting in my opinion

unknownunknown
Автор

Thanks for that well-detailed tutorial! Best one so far!

jaume
Автор

Very interesting video! I would love to see you code while explaining, since I think sometimes your explanations were a bit fast and confusing

vitoramr
Автор

Thankfully the music softened. It was tough to hear you at first.

gamesthatiplay
Автор

Great tutorial! But I think your CheckValidity method can have some unexpected behavior since you are looping over a shrinking list.
I propose to loop over the validOptions instead and adjust the check. Alternatively you might be able to do something like: optionList.RemoveAll(item =>

Edit: Also there are some small things to simplify the code a bit. For instance instead of looping over the options to convert it to an array at the end of UpdateGeneration. You can simply do a ToArray() on the list.

Patrick-.-
Автор

Very nice video!!! Look forward to the algorithm in 3D

highplayer
Автор

Hey bro. Can we get video about how to make an object follow these resulting paths

alextravine
Автор

drop the background music. it annoying ... beside that - good video. thanks!

haim
Автор

hi can i use 3d prefabs with this same method to create a 3d procedurally generated city?

blop
Автор

Now a version that is better optimized! It's very slow and memory heavy, even if the dimensions is only set to 50.

isleeg
Автор

Awesome video! How would you define certain cell as say the “blank” tile? You eluded to this in the beginning but said you were going to skip over that. Lol. For example, if this were for an RTS game and you want two corners as always blank as a starting point.

DustinjBailey
Автор

How do you make a wfc work inside a box or not having openings leading to nowhere?

ludomancerstudio
Автор

I'm making an undergrad thesis about this. How do you suggest to write the whole thing from the beginning?

trevorfranks
Автор

Great video, would love to see this in 3D!

scruff-duff
Автор

Sound mix/production/levels were just too bad for me to listen past half a minute.

chaosordeal
Автор

Tutorial is great, but the music is way too loud. It's really distracting and annoying while trying to take in the information you are providing. Lower it by 70% and you are good.

adamarzo
Автор

"Where to watch woman world cup in Australia" xD

pablo
Автор

Make a thumbnail from the actual project.

Johan-rmec
Автор

Whats wrong with you voice? Barely possible to hear the last word for each sentence...
But nice tutorial

EdsonFranceschini
join shbcf.ru