Wave function collapse Tutorial 17 Coding - Core algorithm Part 1

preview_player
Показать описание

Wave function collapse is an algorithm that can proceduralny generate a much bigger output - be it an image or in our example a tilemap, that resembles a smaller input tilemap in its overall structure.

This video we start implementing Core solver classes.

Useful links:

I will try to upload as much episodes as I can but if I can't I will have them all done in a day or 2. So just check back in few days. Thanks!

Project files:

Reference Materials:

Patreon:

Рекомендации по теме
Комментарии
Автор

In your GetSolvedOutputGrid() function, it would be better to do the solve check first, before creating the returnGrid. That way, you are not creating an array that you will not be using, and will also save some time because the CreateJaggedArray is O(height * width) and uses reflection which is inherently slow. You should also create the empty grid manually (not using your extension) and keep a global copy instead of creating it every time the check is done and the grid is not solved.

bixarrio
Автор

I may be wrong, but I think GetCoordsFromIndex has a mistake in it.
I think you need to get X through index % Width and Y through index / Width.

NoArtistAvailable
welcome to shbcf.ru