A.I. Texture Generation (via Wave Function Collapse #1)

Subscribers:
822
Published on ● Video Link: https://www.youtube.com/watch?v=0fO9LicI6ao



Duration: 4:23
563 views
19


2022-05-26. This is my own implementation of an algorithm that is inspired by, and almost certainly very similar to, the Wave Function Collapse algorithm made by Maxim Gumin: https://github.com/mxgmn/WaveFunctionCollapse

I am implementing my own solution as I wanted a better way to draw tiling pixel art than me foolishly doing it by hand. I wanted tiles that differed but always wrapped with each other, regardless of which ones touch. This is not a demonstration of that, since it turns out this algorithm does not work well for many colors -- since it is too restrictive on the possible quantum states. It is still very un-optimized, so the slowness is partially from the collapsing states and also from the desired 60 Hz rendering, which is collapsing colors for visualization -- all running on one CPU thread and no GPU.

These are my first few test images, and it shows off multiple cell sizes (2x2, 3x3, and even a 4x4 that works very well!), along with various wrapping in X and Y or none, and there is also 8-way symmetry optional, which is mostly unused -- since it creates too many states, and also ruins the "personality" of the input texture.

Further, there is no density control, as you can see by my first image, where it can decide to draw all of the red. The "evolution" of the procedural image is not controlled by an external constraint (such as density), and can just run off into an undesired direction, and without maintaining the consistency of the original input image. Sometimes this is desirable, so it will go off and render many extra elements, and sometimes it skips entire sections of the input that you'd prefer it to focus on.

I love the visualization of the quantum states showing the little hints of what this A.I. is "thinking" -- i.e. the left-over possible states that may be chosen.

Enjoy!

More to come later.

Playlists:
--------------------
- Wave Function Collapse: https://youtube.com/watch?v=iHaiVX8k740&list=PLjnbT4UISq0Y8vYnrSauHkBKgOBHXFFdf
- Voxel Software 3D: https://youtube.com/watch?v=uadGU-stF-w&list=PLjnbT4UISq0bQF1g85tE9jTrKfEtdRYlY
- Ray Casting 3D: https://youtube.com/watch?v=SkaPYZOKPQg&list=PLjnbT4UISq0YcFtRFjFQqK0g6ONNCtrvY
- Graph-All Calculator 2D: https://youtube.com/watch?v=kLSc7bZW2Bs&list=PLjnbT4UISq0YLgynFSpLzml4BMC6TDZL2
- Parallax Side-Scroll Shooter 2D: https://youtube.com/watch?v=l9bIYkZepPo&list=PLjnbT4UISq0Y_7IAN_zUzxgZnfhXxo_0Q
- Road Pseudo 3D: https://youtube.com/watch?v=rA4g4VX7ys8&list=PLjnbT4UISq0bnfd1RC3M4PgTgkmhlkikV
- Arena Shooter 2D: https://youtube.com/watch?v=VKjiuq437t0&list=PLjnbT4UISq0adw__Y9B2eXA0LL35TyORU

Websites:
---------------------
- GitHub: https://github.com/JDoucette
- Indie Game Studio: http://xona.com
- Blog: http://thefirstpixel.com







Tags:
gamedev
monogame
indie
development
graphics
engine
xona
firstpixel
pixel
pixelart
retro
coding
wolf3d
raycast
raycasting
software
custom
shader