So I redid terrain generation but now with smooth terrain instead of triangle terrain.
Issue now is, biomes appear to be too rare and if they do appear then they’re often way too small.
I’ve tried mudifying the noise functions multiple times but somehow this didn’t do much except make really small patches of sand/snow appear which is not intended, making the numbers large gives bigger biomes but makes them extremely rare (and still too small).
If anyone could help me on this it would be greatly appreciated.
local seed = 59379429379 * 0.69
local posoffset = Vector3.new(5000, 0, 50000) --Center of the terrain.
local amp = 1000
local steepness = 1000
local steepness2 = 2000
local biomechancemultiplier = 1
local biomesize = 10000
local biomerarity = 2000
--Advanced
local biomesnap = 1
local biomes = {
["1"] = {name = "desert";
mat1 = Enum.Material.Sand;
mat2 = Enum.Material.Ground;
};
["0"] = {name = "default";
mat1 = Enum.Material.Grass;
mat2 = Enum.Material.Mud;
};
["-1"] = {name = "snow";
mat1 = Enum.Material.Snow;
mat2 = Enum.Material.Glacier;
};
}
--==[[ No touchy below. ]]==--
local noise = math.noise
local floor = math.floor
local clamp = math.clamp
local mod = {}
local function snap(x, y)
return floor((x / y) + 0.5) * y
end
mod.randomnoise = function(pos)
return pos
end
mod.heightnoise = function(pos) --Basic terrain generation
pos = pos + posoffset
local n1 = noise(pos.x / steepness, pos.z / steepness, seed) * amp
local n2 = noise(seed, pos.z / steepness2, pos.x / steepness2)
return n1 * n2
end
mod.biomenoise = function(pos) --Biome selection and generation
pos = pos + posoffset
local n1 = noise(pos.x / biomesize, pos.z / biomesize, seed * 2) * amp
n1 = clamp(n1 * biomechancemultiplier, -1, 1)
local n2 = noise(seed / 2, pos.z / biomerarity, pos.x / biomerarity)
local r = (n1 * n2) * biomesnap
r = snap(r, biomesnap)
local selbiome = biomes[tostring(r)]
return selbiome.mat1
end
return mod
A second but small issue I have is that a lot of bumps seem to appear in my infinite terrain, I haven’t really looked into that yet but anyone have a idea what could possibly cause that?
(Also, have a good christmas eve.)
Edit: There are absolutely no errors and it runs completely fine, but biomes just appear to be extremely rare and too small.