procedural generation
124 subscribers
5.17K photos
1.64K videos
2 files
10.9K links
Created by @r_channels
Download Telegram
Wave Function Collapse in game dev. - Expectation vs Reality



So for those who wants to try Wave Function Collapse (WFC) algorithm. We at Catiger Studio were inspired by Townscaper success and decided to implement WFC for our game.

Our takeaways:

1. There are a lot of ready made implementations. We tried a couple of them from Unity Asset Store, they are working fine for certain use cases.
2. Even though there are a lot of ready made implementations of WFC, In reality you most likely won't be able to use them out-of-the-box and you will have to modify them for your needs. For example - you may want to limit what tiles will be spawned in a certain area. You also may want to introduce certain player interactions with the map and make sure that whenever there is a local change, that local change stays locally, instead of propagating through the whole map (Default behavior in almost all implementations). Performance is a big issue. Most WFC are drawing random numbers and they are not supporting using previous known solution. (So basically Townscaper's behavior is not typical for most WFC algorithms that are out there).
3. WFC blows the minds of almost all junior developers and what is unfortunate - all artists as well. The artist should be super technical to understand the complexity of the problem and being able to produce required assets. Our live-hack to this problem: the person on your team who understands WFC algorithm produces all necessary assets in a very simple form, makes sure that they are compatible and they covers all required cases, then the artist tries to "beatify" these tiles (Artist still struggled after that because you need to track compatibility of the tiles, keep equal forms and so on).
4. It is really long and difficult. Every single member on our team stacked at least once for several hours starring at "no solution" error to finally find out what tile or case or permutation or connection was missing.

Main Takeaway: think twice if you really need WFC for your project.

Follow us on twitter:

https://twitter.com/catigerstudio

https://redd.it/15i2wyw
@proceduralgeneration
This media is not supported in your browser
VIEW IN TELEGRAM
Valheim style biome generation, multi layered noise with cutoffs and unique seeded offsets per biome layer.
https://redd.it/15jdofc
@proceduralgeneration
Building Room Generator Algorithm

I'm looking for a room generator algorithm for use in the basement areas of my procedural buildings. Something sort of maze-like where it's easy for the player to get lost. I guess it's "backrooms" style. However, the requirements are somewhat different from many of the dungeon generators I see here in this sub.

1. Not (necessarily) grid based. These room networks are huge with thin walls, so it's not practical to create a grid where the walls and objects fit inside grid cells. And connect to other doors, stairs, etc. that aren't aligned to a grid.
2. Maze-like, but not a perfect maze. There can and should be loops, ideally with some way to control their frequency.
3. The rooms fill a rectangular area with no or few gaps/empty regions. I'm looking for something that subdivides an input rectangle rather than creating rooms randomly in space.
4. All areas are reachable. Well, this may be too strong. I at least want a guarantee that a path exists between all entrance doors and most of the area is reachable as well. But it may be okay to remove walls to connect rooms as a postprocessing step.
5. Must be fast. These regions are generated on the fly as the player explores, so let's say 16ms max for subdividing the rectangle. This rules out algorithms with exponential runtime, backtracking, things like WFC, etc.
6. I'm looking for an algorithm that I can implement in C++ for a custom game engine. Not a plugin for an existing game engine or pre-built library.

So far the best I've come up with is placing walls of random position and length in either X or Y with constraints that no two walls can be less than a player diameter apart without touching (so no small gaps). Then I do a Boolean NOT of the walls expanded by the player radius to get the walkable area. I determine the connected components of the graph. Then I remove sections of walls that divide two disconnected components iteratively until all walkable areas are connected. This works and is relatively fast, but doesn't give much control over the number of loops, open areas, rooms vs. hallways, etc. Some results are acceptable, while others are not. For reference, the code I currently have is in the function building_t::add_backrooms_objs() here:

https://github.com/fegennari/3DWorld/blob/master/src/building\_basement.cpp

Any suggestions for alternate algorithms or improvements to what I have would be appreciated.

https://redd.it/15jfkwp
@proceduralgeneration
A random generator for videogame mechanics

As the title says, I've created a quick and dirty combinator of video game mechanics, it's crude and ugly, put if the community has interest on it, it will be expanded.

​

Find it at https://alvarber.gitlab.io/genre-fuser/

https://redd.it/15jst4r
@proceduralgeneration
Oppy - A stylized world generation tool for Unity 3d - Except for the road details & the horse cart figure, it's generated procedurally using seed-based layered Perlin Noise with some basic parameter inputs.
https://redd.it/15k3l9q
@proceduralgeneration
The Art of Procedural Noise

Hi! I’ve created a video about procedural noise that focuses on the relationship between noise and nature, the theory behind noise, and many other exciting topics that go beneath the surface. I hope it will give you a new fresh perspective on noise!

https://youtu.be/erI7k3lt4UY

https://redd.it/15kcv16
@proceduralgeneration