DV Gen
DV Gen
  • 3
  • 1 287 022
Procedural Generation with Wave Function Collapse and Model Synthesis | Unity Devlog
In this video, I discuss the technical details of the Wave Function Collapse algorithm, and the closely related predecessor, Model Synthesis. I really enjoy both of these algorithms, and like many, I actually use parts of both in my projects. Stick around for more details on implementation in later videos. For now check out the resources below.
Follow me on Twitter.
_DV_Gen_
Constraint satisfaction wikipedia article.
en.wikipedia.org/wiki/Constraint_satisfaction
Sudoku as a constraint satisfaction problem.
medium.com/my-udacity-ai-nanodegree-notes/solving-sudoku-think-constraint-satisfaction-problem-75763f0742c9
Minesweeper as a constraint satisfaction problem.
lvngd.com/blog/solving-minesweeper-python-constraint-satisfaction-problem/
Wordle as a constraint satisfaction problem.
towardsdatascience.com/how-to-guess-well-in-wordle-d21167aae444
Constraint satisfaction techniques in planning and scheduling.
link.springer.com/article/10.1007/s10845-008-0203-4
Cognitive dissonance reduction as constraint satisfaction.
psycnet.apa.org/record/1996-01742-001
BenzAI: A program to design benzenoids with defined properties using constraint programming.
www.researchgate.net/publication/360856107_BenzAI_A_Program_to_Design_Benzenoids_With_Defined_Properties_Using_Constraint_Programming
Harnessing constraint programming for poetry composition.
helda.helsinki.fi/bitstream/handle/10138/42894/toivanen_constraints_poetry_iccc2013.pdf?sequence=2
Finding alternative music scales.
public.tepper.cmu.edu/jnh/scales2.pdf
Texture synthesis wikipedia article.
en.wikipedia.org/wiki/Texture_synthesis
Alexi A. Efros's page on texture synthesis.
people.eecs.berkeley.edu/~efros/research/synthesis.html
Michele Conni's review of recent advances in texture synthesis.
ua-cam.com/video/Kpf-IIEenjo/v-deo.html
Paul Merrell's website on model synthesis.
paulmerrell.org/model-synthesis/
Maxim Gumin's wave function collapse github.
github.com/mxgmn/WaveFunctionCollapse
Cainos pixel art tiles.
cainos.itch.io/pixel-art-top-down-basic
Wikipedia article on Shannon information entropy.
ua-cam.com/video/NZ5IJTuTl00/v-deo.html
Paul Merrell's video on thermodynamic entropy.
ua-cam.com/video/NZ5IJTuTl00/v-deo.html
Wikipedia article on arc consistency.
en.wikipedia.org/wiki/Local_consistency#Arc_consistency
Boris the Brave's article on arc consistency.
www.boristhebrave.com/2021/08/30/arc-consistency-explained/
Wikipedia article on backtracking.
en.wikipedia.org/wiki/Backtracking
Boris the Brave's article on modifying in parts.
www.boristhebrave.com/2021/10/26/model-synthesis-and-modifying-in-blocks/
Marian Kleineberg's article on infinite wave function collapse.
marian42.de/article/wfc/
Marian Kleineberg's twitter.
marian42_
Rob Lang's Clomper devlog discussing infinite wave function collapse.
ua-cam.com/video/DrTYmUtWWw4/v-deo.html
Boris the Brave's wave function collapse / model synthesis asset for Unity. This was used to demonstrating some features I have not yet implemented.
assetstore.unity.com/packages/tools/level-design/tessera-procedural-tile-based-generator-155425
Boris the Brave's DeBroglie wave function collapse / model synthesis C# library.
github.com/BorisTheBrave/DeBroglie
Music:
Pamgaea by Kevin MacLeod
Free download: filmmusic.io/song/4193-pamgaea
License (CC BY 4.0): Standard License
Out Of The Blue by Purrple Cat | purrplecat.com
Music promoted by www.free-stock-music.com
Creative Commons / Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
creativecommons.org/licenses/by-sa/3.0/deed.en_US
The Life and Death of a Certain K. Zabriskie, Patriarch by Chris Zabriskie is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/by/4.0/
Source: chriszabriskie.com/vendaface/
Artist: chriszabriskie.com/
Moonrise by Reed Mathis
UA-cam Audio Library
Music: Floating Cities by Kevin MacLeod
Free download: filmmusic.io/song/3765-floating-cities
License (CC BY 4.0): Standard License
Jellyfish in Space by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. Creative Commons - Attribution 4.0 International - CC BY 4.0
Source: incompetech.com/music/royalty-free/index.html?isrc=USUAN1500030
Artist: incompetech.com/
Intuit256 by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. Creative Commons - Attribution 4.0 International - CC BY 4.0
Source: incompetech.com/music/royalty-free/index.html?isrc=USUAN1100193
Artist: incompetech.com/
Music: Deep Haze by Kevin MacLeod
Free download: filmmusic.io/song/3633-deep-haze
License (CC BY 4.0): Standard License
Переглядів: 180 476

Відео

Why I'm Using Wave Function Collapse for Procedural Terrain | Unity Devlog
Переглядів 1,1 млн2 роки тому
In this devlog, I talk about my experiences using Wave Function Collapse to generate procedural terrain in Unity. Voxel worlds are great, but I'm really enjoying this algorithm. Stick around for more details on using Wave Function Collapse in later videos. For now check out the resources below. Follow me on Twitter: _DV_Gen_ Marching Cubes Wikipedia page: en.wikipedia.org/wiki/March...
Simulating Animal Behavior - Wandering, Kinesis and Slimes
Переглядів 20 тис.3 роки тому
This video shows a simulation of animal behavior in the Unity game engine. Specifically it discusses kinesis, one of the simplest behaviors. Using kinesis, animals sometimes appear to have a goal directed behavior, but actually are just wandering into good areas. Wikipedia entry on Kinesis: en.wikipedia.org/wiki/Kinesis_(biology) Twitter: _DV_Gen_

КОМЕНТАРІ

  • @andressmartin8410
    @andressmartin8410 10 днів тому

    Hi there! I wish you were still making videos. Your game is turning out great and the information you show in your channel is priceless. I like your teaching technique and everything is super interesting. I hope everything's alright, take care.

  • @4984christian
    @4984christian 22 дні тому

    How would you do a river?

  • @sebastiendeseille9890
    @sebastiendeseille9890 Місяць тому

    Hello, I just finished your vlog on Procedural Generation. I really appreciated your explanation of the algorithm. Thank you very much.

  • @romeolz
    @romeolz Місяць тому

    Microtonal jumpscare

  • @paulbarth3851
    @paulbarth3851 Місяць тому

    i thought this was about bloons td the maps looks just like something out of btd battles

  • @TheHombresinombre
    @TheHombresinombre Місяць тому

    Woah, this video is awesome. I am starting to learn about procedural generation methods and this video rocks. I would love to watch the next ones, but sadly they seem deleted.

  • @TheGreatLaveen
    @TheGreatLaveen Місяць тому

    Love the video, you are great at explaining! Thank you for teaching us!

  • @unluckyyooo6598
    @unluckyyooo6598 2 місяці тому

    I wish I can cite this video somehow. So much juice.

  • @wakkosick6525
    @wakkosick6525 2 місяці тому

    wave function collapse is how god does it.

  • @JakubSK
    @JakubSK 2 місяці тому

    Just use prefabs.

  • @CadeVoidlighter
    @CadeVoidlighter 3 місяці тому

    Excellently made video!

  • @OxAA00
    @OxAA00 3 місяці тому

    Wow great video! I was looking for a general introduction into Wave Function Collapse and came across your video. Very well put together. Thank you so much for taking your time to make this great video!

  • @radivarig
    @radivarig 3 місяці тому

    Could you set the seed of each tree to depend on the neighbor cells so it stays the same once all the neighbor cells are generated?

  • @chtechindustries4174
    @chtechindustries4174 3 місяці тому

    I see why it’s called wave function collapse. Each tile has multiple possibilities, but then it becomes one, influencing other probabilities. With a quantum particle, it can have many possibilities, until it collapses into one of them, effecting other states. So, ultimately, this is the same, and could be a good method for large-scale modeling of quantum systems. While not as accurate (less domains), it could be used to approximate what you can do. With simple atoms, you can even have the same domain, and using this simulate different pours probabilistic outputs. From there, try to change starting conditions unti it does what you want. You now have a general idea of what to do to make a similar system. Wouldn’t design a quantum computer, but could provide a starting point, and that’s a start!

  • @AuditorsUnited
    @AuditorsUnited 3 місяці тому

    i made a system that you run in any unity scene and it it makes a database on gameobjects relationships with other game objects. and can be used in a none tile based system .. all you have to do is choose a gameobject and use the database to statistically see what's connected to it or near it and where and how many objects and can be used in procedural generation i can give you the link to the code if you wanna experiment

  • @Karlthuluu
    @Karlthuluu 3 місяці тому

    Great video! Looking forward to seeing your code and implementation! Especially looking forward toward how you handle entropy!

  • @JiggyQ12
    @JiggyQ12 3 місяці тому

    These algorithms necessarily create random patterns that won't be recreated even with the same input. I wonder if there is a way to use these methods while also getting re-creatable patterns you get from perlin noise synthesis

  • @cjhacker8367
    @cjhacker8367 4 місяці тому

    hi dad

    • @dvgen
      @dvgen 3 місяці тому

      hi son

  • @AnotherDuck
    @AnotherDuck 4 місяці тому

    I'm not even close to start writing code for generated areas (and what I'm currently working on is text-based anyway), but learning new stuff is always interesting.

  • @xylvnking
    @xylvnking 4 місяці тому

    10/10 video

  • @BismuthBorealis
    @BismuthBorealis 4 місяці тому

    overlapping method reminded me a bunch of markov chains, where higher chain lengths are more similar, and lower less so. ... although from another perspective perhaps markov chains would simply be a 1d equivalent to the 2d overlapping bushes

  • @PsiborgJhin
    @PsiborgJhin 4 місяці тому

    this is cool, it feels like a step up from a Perlin noise generator, but personally, I want to see more logical procedural generation that generates more coherent structures (shear-face cliffs that overlook oceans, cities that have roads to support infrastructure like a mountain passes that connect to mines). or an inland city without a body of water having water towers or wells.

  • @rainbrain8460
    @rainbrain8460 4 місяці тому

    2:33 Yes, I know what you're talking about😆

  • @Jebula999
    @Jebula999 4 місяці тому

    I've climbed on the game dev bandwagon quite recently, Fell down the rabbit hole of world gen. Came across your video and the result you get at 23:40 is AMAZING and would love to have something similar in Godot. Been trying to find information on how to implement on Godot but the info is scarce. I got excited when you mentioned you will do a walkthrough and share your code in your next video, then I saw this was posted +- 10 months ago 😭 Will an update to this video still be coming out?

  • @user-fn8wl8de9f
    @user-fn8wl8de9f 4 місяці тому

    Amazing! Waiting for the next video

  • @MrSpaceMees
    @MrSpaceMees 4 місяці тому

    i had the idea that they could use this to generate the base plate/bedrock in minecraft. this way you could get more height in the terrain generation without having to render more vertical chunks to get higher terrain

  • @nil0bject
    @nil0bject 4 місяці тому

    how to add a seed(or something?), so that generation is reproducible?

  • @PicturesqueGames
    @PicturesqueGames 4 місяці тому

    2:00 i'm gonna stop you right there buster. only thing you need for that angling is an oblique camera projection with Y axis being tilted.

  • @matthewboyd8689
    @matthewboyd8689 4 місяці тому

    The maximum artistic control for procedural generation is training an AI in how you want your tiles to be set up and grouped by giving it a few examples and then letting it do its job and then if it ever deviates from what you want, you just need to give it a few more examples until it works right. Or at least thats my plan.. (said the ambitions of a non coder using Chat GPT 4)

  • @newogame1
    @newogame1 4 місяці тому

    Still scratching my head

  • @FH-cn3mg
    @FH-cn3mg 4 місяці тому

    Wow, I am wondering if you could take a sample of perlin noise and add constraints for color connections at some large interval, to make large shapes, something that might be considered continents or fault lines, then use those pre-gen'd lines to set the initial tilesets for any tiles they overlap. This could set the initial constraints and then create interesting land features like canyons or mountains in a way that looks like mountain chains or large canyons from rivers. Then layer in the types of 'terrain' or 'biome' or whatever type of texture you want after the initial landforms are generated. It gets me to thinking if you could transform these from cubes into triangles to get a more natural feel to terrain, a more rounded mesh or whatnot, or maybe generate the mesh at a high resolution and then add a smoothing modifier at the end to make nice curves for things like mud, sand, or earth, and keep it blocky for things rock or sandstone.

  • @iskamag
    @iskamag 4 місяці тому

    the code at 4:18 is too cursed

  • @noahk3496
    @noahk3496 4 місяці тому

    So basically minesweeper

  • @bikgamer
    @bikgamer 5 місяців тому

    Minecraft doesn't use voxel based rendering technic. It uses polygon rendering to display each voxel as a cubic "block"

  • @resdek2246
    @resdek2246 5 місяців тому

    This video is awesome. Please keep making them.

  • @mrkefirek9
    @mrkefirek9 5 місяців тому

    I didnt understand anything :(

  • @timtam3262
    @timtam3262 5 місяців тому

    Need the next video and the code

  • @lilithstardust7359
    @lilithstardust7359 5 місяців тому

    I can't help but imagine what layers of this algorithm might turn out like; general environments and landmasses picked like modules to adhere to realistic rules, then those modules themselves turned into smaller collections of tiles that have rules for creating gradients between environment tiles, then the actual map tiles could be inside of those tiles. If done properly it could be a really fast way to procedurally generate planets and still have a lot of creative control over the player's experience. I'm definitely gonna have to play around with this when I get a chance.

  • @clamhammer2463
    @clamhammer2463 5 місяців тому

    you can als use dynamic rarity. Depending on the count of ajdacent twin, the spawn chance is lowered. so you can turn up or down features ponds and lakes filling up your whole terrain. You could also use that to generate more realistic biomes like sandy deserts or forrested areas.

  • @Knight_Kin
    @Knight_Kin 5 місяців тому

    Really interesting stuff. Thank you for this.

  • @Suzuki_Hiakura
    @Suzuki_Hiakura 5 місяців тому

    8:45 I understand your interest in pixel art. I actually drew, with MS Paint and a regular mouse, some pixel art trees for my game project back in high school. Looked amazing, but I struggled making altered ones to "animate it", so I never finished that game project assignment... it was like that with all my assignments actually... eventually took advantage of how the teacher would let us play games "after" we finished our work. Grade suffered, life went to **** after graduation, now in college with no scholarships yet and already part way through my second year. Had a 4.0 GPA though, for the first 4 classes... got a B- on some assignment as the teacher basically altered what they wanted (required examples from the textbook, not personal ones from me, like all classes before and after that one require)... then another B- later on a test which got the GPA down to 3.93... now it sits there... got all my eggs in the Academic Reprieve basket, so I can strike the 2 -A class grades from my record and restore the 4.0 GPA... would qualify for 4.0 scholarships then, so I could pursue the Engineering degrees I would need to do what I want for a living.

  • @zion6680
    @zion6680 5 місяців тому

    Holy crap I just had an epiphany about how to pull this off in the worst way possible in UPBGE lmao, I'm gonna try it later today. Been struggling for three years trying to do procedural terrain like this inside of blender lol

  • @MagusArtStudios
    @MagusArtStudios 5 місяців тому

    This is funny I post open source code about procedural generation and get this. Fortunately I've already implemented wave-function collapse but not on such a small scale perhaps i should write a new function to generate terrain using that method by generating 8x8x8 grid scale and applying the noise to the cell. Although I now realize i havent fully implemented wave function collapse perhaps by systematically constructing a grid and pick a random point and occupy each neighboring cell until the array is complete

  • @titastotas1416
    @titastotas1416 5 місяців тому

    Idk why is it that people have to compare wave function collapse to voxels, I think they don't even compare. Here is why: voxels are simply a way to represent spatial data, like pixels but just with an extra dimension. Wave function collapse is an algorithm that takes an example set of data 2d or 3d and generates more of it. Voxels are a way to represent 3d data, and wave function collapse is an algorithm that can be used to generate this 3d data. The algorithm used in Minecraft to generate the world is Layered noise, and that is what can be replaced with the wave function collapse algorithm, you cant toss out voxels and in its place put WFC. Btw your video is great at explaining WFC.

  • @jarrettonions3392
    @jarrettonions3392 5 місяців тому

    This is an amazing video on such an interesting topic!

  • @etmasikewo
    @etmasikewo 5 місяців тому

    I messaged her to check in on her and she said okay. I asked if she was busy and she said game. I asked if I could join and she said

  • @xaracen7207
    @xaracen7207 5 місяців тому

    i wonder if itd be beneficial to try perlin or other orderly noise generation to assign or adjust weights for various modules, for example if you use three channels for biomes and three different seeded noise maps for, oh, 5 biomes, 3 borders types for when two noise clouds meet, 2 rare biome type for when all three are present or not... biome 0,0,0 would be some empty barren landmass, biome 1,0,0 a lush plain, 0,1,0 a desert, 0,0,1 an ocean, 1,1,1 dense unpassable forest, with each channel influencing biome specific modules...

  • @kanashibarixperience
    @kanashibarixperience 5 місяців тому

    cool!

  • @shehackedyou
    @shehackedyou 5 місяців тому

    Ive heard this as monte carlo but I the name wave function collapse does sound cooler, would make a better band name for sure. I had already been experimenting with similar concepts for building p2p networks, and experimenting with bevy to help illustrate complex networks when streaming protocol development tutorials. I appreciate the guide, it will be helpful in creating a better educational vspace to work in. I guess like a whiteboard but 3D?

  • @juniperbelmont
    @juniperbelmont 5 місяців тому

    The AI generated puzzle graphic at 0:46 is a beautiful disaster!! 😫

    • @dvgen
      @dvgen 5 місяців тому

      "Beautiful disaster" seems like a good term for procedural generation too.