#wavefunctioncollapse
Explore tagged Tumblr posts
avgdvl · 2 years ago
Text
Zsírmókus!
ajánlom OP figyelmébe a "Wave Function Collapse" algoritmusok azon fajtáját, ahol az algoritmus a képet elemekre bontja, az elemek között feltérképezi a szomszédossági szabályokat, majd a szabályokkal és az elemekkel új képet konstruál, véletleszerűen.
Írtam egy festő stílusát utánozó programot
Kb. 1 éve szembe jött ez a kép, és eléggé megtetszett a stílusa, szóval kicsit utánanéztem, és elég szép áron adta el az eredetiket a festője
Tumblr media
Aztán eszembe jutott, hogy ezt aránylag könnyű lenne megírni algoritmikusan gyakorlásképp, szóval még tavaly össze is raktam egy proof of concept kódot, ami működött, de nagyon nem volt hatékony, sem időben, sem memóriában. Azóta Pythonban azért sikerült fejlődni, szóval kb egy 10-100x olyan gyors megoldás most újraírtam, meg összeraktam hozzá egy gány Flask frontendet is, szóval egész felhasználóbarát is lett.
Ezt az eredeti kép alapján generálta, ami kicsit hálátlan, mert a mintavételezési hálót nem nagyon lehet összepárosítani az eredetivel (az enyém egy meghatározott felbontású hálót ráilleszt a képre és az egyes pöttyöket a körülötte lévő színek alapján átlagolja):
Tumblr media
Viszont normális képekkel már jobban működik:
Tumblr media Tumblr media Tumblr media Tumblr media
133 notes · View notes
procedural-generation · 4 years ago
Video
youtube
Explaining WaveFunctionCollapse
This video from Martin Donald is a great explanation of the WaveFunctionCollapse algorithm. I particularly appreciate that it also talks about calculating the adjacency constraints, which often gets overlooked when talking about WFC: There are many ways to implement both the solver and the adjacency calculations.
I also appreciate that Martin’s description digs into some of the data structure thinking that goes into actually implementing a version of WFC. I find that tends to trip many people up when they try to actually program the thing.
12 notes · View notes
renovatio06 · 2 years ago
Text
How We Need to Radically Rethink Conscious Awareness | Psychology Today
Charles M. Johnston, MD, is a psychiatrist, writer, and futurist. He is the author of numerous books and articles on the future and how we can best prepare to meet it. Online: Charles Johnston’s Author Page, LinkedIn Source: How We Need to Radically Rethink Conscious Awareness | Psychology Today I feel compelled to thank MD Mr. Johnston for better elaborating on an underlying assumption I’ve been…
Tumblr media
View On WordPress
0 notes
bymagda30f · 2 years ago
Text
Wave Function Collapse
Monoceros is an implementation of the Wave Function Collapse (WFC) algorithm developed for game design by Maxim Gumin and extended and promoted by Oskar Stålberg with his game Townscaper.
WFC is a procedural generation algorithm that essentially attempts to satisfy constraints on a world.
WFC initializes output bitmap in a completely unobserved state, where each pixel value is in superposition of colors of the input bitmap (so if the input was black & white then the unobserved states are shown in different shades of grey). The coefficients in these superpositions are real numbers, not complex numbers, so it doesn't do the actual quantum mechanics, but it was inspired by QM. Then the program goes into the observation-propagation cycle:
On each observation step an NxN region is chosen among the unobserved which has the lowest Shannon entropy. This region's state then collapses into a definite state according to its coefficients and the distribution of NxN patterns in the input. On each propagation step new information gained from the collapse on the previous step propagates through the output. On each step the number of non-zero coefficients decreases and in the end we have a completely observed state, the wave function has collapsed.
It may happen that during propagation all the coefficients for a certain pixel become zero. That means that the algorithm has run into a contradiction and can not continue. The problem of determining whether a certain bitmap allows other nontrivial bitmaps satisfying condition (C1) is NP-hard, so it's impossible to create a fast solution that always finishes. In practice, however, the algorithm runs into contradictions surprisingly rarely.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
0 notes
visibledamage · 7 years ago
Photo
Tumblr media
...Superposition... #vsbldmg #visibledamage #drivenbymadness #superposition #wavefunctioncollapse #electrons #quarks #quantummechanics
1 note · View note
whiteladysmuses · 5 years ago
Photo
Tumblr media
Gamma-ray space telescope study may have spotted dark matter ⠀ https://buff.ly/2JBeljM⠀ #quantumphysics #quantumphysicsforbeginners #quantummechanics #quantummechanicslover #wavefunctioncollapse #uncertaintyprinciple #darkmatter #untoldnewsuk https://www.instagram.com/p/B-k2xYDADvM/?igshid=de8v3n5zaa2m
0 notes
altsoph · 6 years ago
Photo
Tumblr media
Today I want to write about the WaveFunctionCollapse algorithm, somehow similar to the Wang tile class of formal systems. Maxim Gumin came up with this cool approach that allows you to generate new samples locally similar to an input image. The algorithm has become quite popular, it works in generative games, ported to a bunch of languages (and unity plug-in), and also generalized in different ways, for example, for 3d cases.
Above is the original gif from the author with examples of the algorithm.
0 notes
andymakesgames · 6 years ago
Video
tumblr
Global Game Jam 2019: Maureens’ Chaotic Dungeon
You can play it here: http://andymakes.com/extras/ggj19/maureen.html
A few notes: 1) It is super unstable and will crash 2) It’s not that fun!
That’s how experimentation goes! Even if this one isn’t perfect, it was a fun project. I tell my students that game jams are a great place to try things and fail, so in that spirit, here was my process. I think there are some fun ideas here even if it didn’t come together into a killer game.
I often go into GGJ knowing some tech I want to work with. Last year it was the MPR121 capacitive touch sensor. This year it was Pico-8. I also had an inkling that I wanted to try and port ExUtumno’s Wave Function Collapse algorithm to the platform. Astute readers will note that this is my third time porting it. It’s a really fun tool and I still haven’t found a personal project for it!
What I really wanted to do was use WFC to build a level, but then allow the player to move around, having part of the level despawn and a new part be generated using the existing rules. Infinite scrolling with procedural tiles that felt coherent. This breaks a few rules with WFC, but I figured I could fudge it. I spent all Friday and a lot of Saturday chasing down bugs. I had a demo using this sprite sheet by FisherG. It worked sometimes but would get hung up and freeze in pretty catastrophic ways. 
Tumblr media
I hadn’t added a player or even really figured out what the game would be and the tech issues were obviously more than I could deal with in the time I had. The generator ran into issues with complex parts of the map, and this sheet has lots of unique tiles to handle nice-looking edges on corners. I decided to switch to a simpler set that I used on some previous WFC ports:
Tumblr media
This sheet by OpenGameArt users surt, Sharm & vk is really lovely. I downsampled and played with the pixels a bit to resize the 16x16 sprites into 8x8 and to match the pico-8 color palette.
Tumblr media
Dungeon crawler it is!
Since I was bending WFC by asking it to refill empty sections on the fly for the level generation, I wanted this to be the main mechanic as well. I put all this work into getting the thing to mostly work, I wanted to showcase it! I thought it would be interesting if the player’s main way of interacting with the world was to empty part of it and let the level generator fill it back in. The theme this year was “what home means to you” and I liked the idea of treating this as renovation. It brought a calm to my character that I liked!
Tumblr media
So her two attacks “reset” a portion of the level, allowing it to be refilled with new tiles. This might cause new enemies to spawn in, but it may also trap existing enemies, killing them. It is also how you can carve your way through the level to get keys and reach the exits.
It’s a fun idea, but in practice it’s pretty random and not very satisfying. Nine out of ten times, it is being used to advance through the level, but it is as likely to block a path as it is open one up.
I think something can be done with this mechanic, but the player needs a bit more agency.
It also still crashes. A lot. So it goes! At the very least, I’m feeling much more confident in Pico-8, which is a fun new toy!
I ran the jam site at LIU Post, and I’m incredibly proud of the work my students did this year. You can see all the games on the jam site’s page.
Here are the full credits for the game:
Game by Andy Wallace andymakes.com https://twitter.com/Andy_Makes
Game Repo: https://github.com/andymasteroffish/wfc_pico8
Sprites from or based on sprites by surt, Sharm & vk https://opengameart.org/content/simple-broad-purpose-tileset
font: Lazytown by Chvy Ray https://chevyray.itch.io/pixel-fonts
some code from  this collision tutorial by Zip: https://www.lexaloffle.com/bbs/?tid=2119
WFC by ExUtumno https://github.com/mxgmn/WaveFunctionCollapse
3 notes · View notes
justinseibert · 3 years ago
Text
Tumblr media Tumblr media Tumblr media
1 note · View note
iromi · 4 years ago
Text
Houdini習得日記_7
2021.1.3
あけましておめでとうございます。今年もよろしくおねがいします。
昨年12月末はあんまり元気なかったので制作が全然進まなかったが、今年に入ってからはそこそこ進んだ。
ビルの作り方の骨組みはできたので、あとはどのようにして都市の形にビルを配置するかだ。Youtubeでいくつかチュートリアルを探していたらwave function collapseノードが役立つ事がわかったので、早速活用してみることにした。
Houdiniを用いた簡易的な都市制作 https://www.youtube.com/watch?v=6jVk4tLTVjQ&t=1229s
直訳すると波動関数の崩壊。日本語での情報が余り載っていなかったので具体的な原理は不明だが、以下の画像の用に一部のピクセルパターンをベースに、そのピクセルパターンの法則を繰り返すことで様々な模様を生み出すアルゴリズムであるようだ。以下の画像が参考になるだろう。
Tumblr media
引用元:https://github.com/mxgmn/WaveFunctionCollapse
参考:https://robertheaton.com/2018/12/17/wavefunction-collapse-algorithm/
チューリングパターンのようであるが少し違うのだろうか?詳細な原理は自分には難解な関数が多々出てきたので、とりあえず置いておく。これを簡単に扱えるようにしたノードがあったので、以下のサイトを参考に導入した。
http://ikatnek.blogspot.com/2020/06/wfc.html
実際導入するとSide Fxのツールをインストールし忘れてエラーを吐きまくった。こういったアルゴリズム系の制作はツールの仕様によりちょっとした小石のような問題でも盛大に時間を浪費するのが困る。
導入が済むと早速最初の都市制作チュートリアルに戻り、制作を再開する。 途中で気がついたが、この方はほとんどの建物の造形にVEXを用いており既存のノードをほとんど使用していない。VEXの挙動に関してほとんど理解ができていないときにVEXを用いたプログラミングを行っても発展させることが難しくなってくる。VEXはC言語ライクだし…processingはJavaベース...。そこで、途中の都市の形を決めるまではチュートリアル通り進めて、途中からノードで建物の構築に移行することにした。
https://www.youtube.com/watch?v=JpvQDLAr_5I
これを参考に建物の高さを地面の面積と連動させることに成功した。 VEXを使用したが、いまいちこれの仕様が未だによくわからない。Houdiniは座標(point)、線(vertex)、面(primitive)で管理しており、それぞれの情報をアトリビュートと呼ぶ。ややこしいのがここに例えば100個の座標に属性、例えばAグループといった情報を付与した際も、まとめてアトリビュートと呼んでいる。座標であろうが付加情報であろうが結局は数値の集合体であることには変わりないということだろう。苦戦したのがこのアトリビュートの扱いであり、どのように呼び出すのかがさっぱりわからなかった。アトリビュートにも先程述べたように座標、線、面によって格納されている場所が異なっているためにそれがより呼び出しを複雑にしている。
VEXで収穫があったのが、printfの使い方。printf(”文字”);はデフォルトでString型が指定されているために文字を出力することはできるが、float h=1としたときにprintf( h );とそのまま出すことはできず、print(”%f”,h);と出力する情報の型を指定してあげる必要がある。C言語はさっぱりなのだがこれはVEXの独自仕様なのだろうか…
mergeノードを���用するたびに”A mis-match of attributes on the inputs was detected.”と度々出てくる。要はアトリビュートがねぇ!って警告なのだが、海外のフォーラムを見ると無視しても良いらしい。Houdiniの情報、明らかに日本語より英語のが充実しており、この業界を目指すなら英語力は必須なのだとひしひしと感じる。日本語の情報も二番目くらいに充実している気がするのは救い。日本人はトップアーティストから個人クリエーターレベルまで、ブログなどで知識を共有する習慣があるのかもしれない。
まだまだこれから建物の形を作っていくが、クオリティをどこまで上げられるかが勝負であろう。テクスチャをどうするか無限に悩むが、残り時間的に厳しいかもしれない。せっかくSubstance Designerを使えるようになったのに、適用のさせ方がわからないというオチ。
Tumblr media Tumblr media Tumblr media
0 notes
hackernewsrobot · 7 years ago
Text
Tilemap generation from single example using ideas from quantum mechanics
https://github.com/mxgmn/WaveFunctionCollapse Comments
0 notes
procedural-generation · 6 years ago
Photo
Tumblr media Tumblr media
WaveFunctionCollapse and You
I recently put together a zine explaining how WaveFunctionCollapse works. It’s a very high level overview, so you’ll probably need a little more information to actually implement it, but I think the explanation has helped people understand it a bit better.
The basic metaphor for how the observation and propagation work is that each tile in your input image is a puzzle piece. (The first tricky step: figuring out which pieces can fit together.) You stack a complete set of possible puzzle pieces on each square on a chess board. Then you pick a square and toss out all pieces from these except one. Now the neighboring cells have pieces that can’t possibly fit with the remaining piece, so go through those and toss them out. (Second tricky step: this is tedious unless you’ve got a computer to do the number crunching.)
If you’d like a more in-depth look at how WFC is implemented, I’d recommend reading the paper I co-wrote about WFC, or browsing the many examples found on @ExUtumno’s GitHub page.
https://isaackarth.com/files/WaveFunctionCollapseAndYou.pdf
16 notes · View notes
radiumsoftware · 8 years ago
Text
The WFC (Wave Function Collapse) procedural content generation algorithm
The original code and article
https://github.com/mxgmn/WaveFunctionCollapse
https://selfsame.itch.io/unitywfc
Author
https://twitter.com/ExUtumno
Remarkable applications
https://twitter.com/jplur_/status/784820087542906880
https://twitter.com/OskSta/status/784847588893814785
https://twitter.com/dwtw/status/810166761270243328
8 notes · View notes
riggingdojo · 5 years ago
Text
riggingdojo
RT @ambrosiussen_p: Another @sidefx #Houdini for #GameDev teaser for our #GDC20 talk about using #WaveFunctionCollapse for Level Generation in Houdini. Schedule online soon! #techart #3dart #procedural #leveldesign #pdg #talk @sidefxlabs @polycount https://t.co/l9HFUPZiYN https://t.co/4Pe2ucOJ7s
0 notes
visibledamage · 7 years ago
Photo
Tumblr media
"The Observer" , 14"x17" my largest piece for @driven.by.madness group show opening this Saturday nite June 9th, 7-10pm at @63bluxomestgallery - I will have 8x10 giclee prints of this piece available at the show for $15!! #vsbldmg #visibledamage #observer #drivenbymadness #consciousness #quantumsuperposition #measurementproblem #inkonpaper #wavefunctioncollapse #quantumfieldtheory
0 notes
whiteladysmuses · 5 years ago
Photo
Tumblr media
How a new twist on quantum theory could solve its biggest mystery https://buff.ly/2V4bzZw⠀ #quantumphysics #quantumphysicsforbeginners #quantummechanics #quantummechanicslover #wavefunctioncollapse #uncertaintyprinciple #darkmatter #untoldnewsuk https://www.instagram.com/p/B-k2gsyA4kT/?igshid=1l4r73pzj2dli
0 notes