How can I use the Wave Function Collapse functionality?

I saw this during the state of unreal talks and got excited about it. The documentation on this seems sparse, and I can’t find any tutorials on it. I’ve enabled the plugin, but I can’t figure out how to make a WFCModel instance, which appears to be the first step. I tried making a blueprint with WFCModel as the parent class, but I can’t then use that to in these dropdowns:

image

Has anyone managed to get further than this?

Look at World’/WaveFunctionCollapse/Sample_Pipes/L_WFC_Sample_Pipes.L_WFC_Sample_Pipes’
and WaveFunctionCollapseModel’/WaveFunctionCollapse/Sample_Pipes/WFCM_Sample_Pipes.WFCM_Sample_Pipes’

You need to start EditorUtilityWidgetBlueprint’/WaveFunctionCollapse/Core/WaveFunctionCollapse.WaveFunctionCollapse’ in order to populate your own WFC Model via INPUT

And use Output to generate from your model to Blueprint’/WaveFunctionCollapse/Core/WaveFunctionCollapseGridActor.WaveFunctionCollapseGridActor’

1 Like

I did manage to figure out what to do to use this plugin.

As a note [BloodyPun] up top did answer this it was just hard to understand for me, I’m not an expert in using unreal so it took me a lot longer then i would have wanted to figure out how to use this plugin.

so anyone who is looking to mess around with this here are the steps that I have found.

1: enable the plugin, under the edit menu go to plugins, then type in wave function collapse and enable the plugin.
2: reveal the sample content. after you restart unreal open the content browser and in the top right corner of that browser is a settings tab, open that and click on show plugin content.
3: open the widget. back in the content browser you will have a new folder called “Engine” open that and find the following [Engine > Plugins > Wave Function Collapse > Core]
4: in this folder you will se something called “WaveFunctionCollapse” it is an editor utility widget, right click on that and select “Run Editor Utility Widget” from that menu.
5: With the widget open you will have an “output” and “input” option available to you at the top of the widget, stay in the output for now. the two main settings to mess around with are “WFC Model” and “Output Settings” under “WFC Model” click the dropdown menu and the two premade WFCM samples will be available, click on either one. next you want to change the “Resolution” you will see 3 fields next to that option, they represent X, Y & Z respectivly, change these to suit what you want to do and then press the “COLLAPSE” button. this will spawn in the model based on the parameters you gave it.
6: make it your own. once you have done that go back to the content browser and have a look at the “Sample_Buildings” and “Sample_Pipes” folders in those you will find Sample levels as well as data assets. open up one of those data assets.
7: study and understand. there is a lot of information in these data assets and im not going to cover all of it but the basics are that each “Element” has a model and the information about what neighbors it can have in it. the big ones to keep in mind are the “Base Object” this is where you place the desired model tile and the “Adjacency to Options Map” this will hold all of the information about what tile(s) can be in which adjacent space.

that is how far I’ve gotten in this plugin and I am just starting on making my own tile set for it so I may update as I discover new information.
Hope this helps anyone who might have been trying to use this but was struggling to figure it out. again id like to point out that [BloodyPun] did post the right answer, it just took me a bit longer to decipher it than I would have liked so I thought I’d post the extended version for people like myself who aren’t Unreal Engine Veterans.

19 Likes

Wow thank you so much for this break down. I have seen no info on this I found out about WFC a few weeks ago and just learned UE5 implemented it. This is great timing :smiley:

2 Likes

Cool! Thanks so much. Just watched the unrealfest where he spoke about this very briefly and as it so happens I’m in need of making a distant cityscape so I’ll think I’ll give it a go.

One thing I’m still confused about - Are these elements setup manually, would I add each one or is there a way to sample the level into the data asset? I ask because from the few posts I could find that had any relevance, this elluded to be something that was possible. I’m completely new to data assets so it’s quite confusing :slight_smile:

Just a small heads up to this awesome breakdown.
The WFC widget can be opened in the Window menu (no need to find the Core folder). Anyway, thanks for sharing!

2 Likes

Is there a way that we can call WFC with a blueprint? That way we can make a game where the player can have a newly generated world for every playthrough (like minecraft).

2 Likes

yeah. any integration into level generation would be good.
blueprints