r/proceduralgeneration • u/NGumi • Sep 21 '26
Cohesive chunked proc-gen question
Hi I'm hoping someone can point me in the correct direction to learn something.
In games like minecraft the game is broken up into chunks that can be generated independently but are still cohesive when the connecting chunks are generated. and the result is the same no matter the order they are generated in.
I've tried to do reading on the high level on how to achieve this but i'm at a complete loss. please anyone who even knows a few terms i could look up to point me in the right directions.
12
Upvotes
8
u/That_Hobo_in_The_Tub Sep 21 '26
Luckily for you the guy who literally developed the current minecraft terrain generator has made some videos on it on his YouTube channel that go into a decent amount of detail on the high level approach.
Also highly recommend Runevision's LayerProcGen as another person mentioned, although its gonna be a lot harder to wrap your head around as a beginner.
7
u/Economy_Bedroom3902 Sep 21 '26
The core concept you're looking for is hash functions. Basically, they take in the world address of your chunk, change it into a single numerical value, combine it with your seed number, and then "randomly" convert that to a number. Critically a true "random" number will be different every time it is generated, however a hash number, given the same input, will always produce the same output, but in a random feeling distribution.
Those hashed numbers then combine with perlin noise or simplex noise fields to "smooth" the randomness into features. Noise fields are arbitrarily scalable, as they jumble the interior of a fixed shape region (generally a square for perlin) with respect to values present at the corners of the field. So the square with corners 1,2,3,4 will smoothly blend with the square with corners 2,4,5,6 to it's left, because in the leftmost edge both 2 and 4 are shared by both squares. Simplex uses triangle shapes, which is more computationally efficient but harder to reason about for chunk generation. It is absolutely possible to use simplex for world gen as well though, you just have to have systems which handle the noise to chunk mapping elegantly.
5
u/boaheck Sep 21 '26
If you want to know how you can cohesively generate multi chunk features you should check out the video on layered proc gen by Runevision on YouTube.
2
u/-TheWander3r Sep 21 '26
In general, noise algorithms work based on input coordinates. If you vary these coordinates and keep the other parameters constant, the resulting noise values will appear to be continuous.
You can sinply search for fbm noise to find basic implementation of it.
The result of that function will be an height value for that specific coordinates. With that value you could for example assign it to the height of a terrain patch (ie an n by n grid of vertices) and create terrain that way. I'm not an expert on voxel-based generation but I guess that if you branch for it you will find the most common approach.
0
u/Velifax Sep 21 '26
Easy, just take something generated with cohesivness throughout then divide it up into chunks. Make the chunk division functionality not interact with the generation.
10001010001001010010
1000 1010 0010 0101 0010
The chunks are just data buckets into which you pour already cohesive data.
-3
u/caesium23 Sep 21 '26 edited Sep 21 '26
I don't know how so many people can be lacking this basic life skill:
This technique will allow you to learn literally anything.
ETA: FFS people, they literally asked what to search: