I am currently following a tutorial for terrain generation for Minecraft from Henrik Kniberg (Minecraft terrain generation in a nutshell - YouTube) and while doing this I am trying to implement these concepts into Roblox for terrain generation. Right now I am struggling with how to make, what he calls a “squashing factor” (from 18:12 to 19:50 in the video) for the base/general terrain generation.
I am using an OpenSimplex Module from Feedekaiser: OpenSimplex Noise in Lua!
(i am using this module because it has support for 4D (which is required for the purposes of this mechanic, for seeds, which is actually pointless with this module because you have to “seed it” in the beginning and so you should just use the 3D functions for it) and it’s SIMPLEX, not Perlin so its better)
The problem now is that I here I am supposed to put some code to show my progress and more specific problem, but I can’t, because I have no idea how to approach the problem. (well ofc I did had ideas, but they didn’t show the desired results, so i just scrapped them)
But the general understanding of what should happen is that with the 4D noise you create these “cheese holes patterns” by getting the value for each X, Y and Z axis from the noise and check if the value is positive or negative (if negative or 0 = air, if > 0 = fill).
Then the next step is to use this squashing factor in order to… squash the terrain, by using a center point which keeps the terrain the same there.
One of my ideas was to make the terrain more sparse as the Y/height value increased and more dense as it was getting more negative. This might be the right way to think about it and do it, but I just couldn’t figure it out in code. I did try certainly, I tried by either changing the frequency/lacunarity and amplitude/persistence, or checking if the Y/height value was over/under a certain threshold and do changes accordingly or mixed them both, without success.
He does mention that these values for the squashing are controlled by spline points from the previous chapter of the video. Which spline points, control the continentalness, erosion and peaks and valleys, so maybe when I combine them all… it, may work?