Add new types rocks, add test gradient mapgen

This commit is contained in:
Van
2026-01-22 21:45:40 +03:00
parent 966af2328a
commit 6332f23bf3
3 changed files with 34 additions and 12 deletions

View File

@@ -16,6 +16,8 @@ local MapGen = mapGenRequire('MapGen')
-- Rocks -- Rocks
sylite = 'rocks:sylite', sylite = 'rocks:sylite',
syliteGray = 'rocks:sylite_gray',
syliteBlack = 'rocks:sylite_black',
tauitite = 'rocks:tauitite', tauitite = 'rocks:tauitite',
iyellite = 'rocks:iyellite', iyellite = 'rocks:iyellite',
falmyte = 'rocks:falmyte', falmyte = 'rocks:falmyte',
@@ -219,8 +221,8 @@ local function generateRock(biome, mapGenerator, data, index, x, y, z)
rocksNoise = core.get_value_noise(rocksNoiseParams) rocksNoise = core.get_value_noise(rocksNoiseParams)
end end
local noiseRocksValue = mathRound(rocksNoise:get_3d({x = x, y = y, z = z})) local noiseRocksValue = (rocksNoise:get_3d({x = x, y = y, z = z}))
if noiseRocksValue == 1 then --[[if noiseRocksValue == 1 then
data[index] = ids.malachite data[index] = ids.malachite
elseif noiseRocksValue == 2 then elseif noiseRocksValue == 2 then
data[index] = ids.hapcoryte data[index] = ids.hapcoryte
@@ -236,6 +238,13 @@ local function generateRock(biome, mapGenerator, data, index, x, y, z)
data[index] = ids.burcite data[index] = ids.burcite
elseif noiseRocksValue == 8 then elseif noiseRocksValue == 8 then
data[index] = ids.felhor data[index] = ids.felhor
end--]]
if noiseRocksValue > 5 then
data[index] = ids.syliteBlack
elseif noiseRocksValue > 4.5 then
data[index] = ids.syliteGray
else
data[index] = ids.sylite
end end
end end
@@ -246,9 +255,13 @@ local function generateSoil(biome, mapGenerator, data, index, x, y, z)
rocksNoise = core.get_value_noise(rocksNoiseParams) rocksNoise = core.get_value_noise(rocksNoiseParams)
end end
local noiseRocksValue = mathRound(rocksNoise:get_3d({x = x, y = y, z = z})) local noiseRocksValue = (rocksNoise:get_3d({x = x, y = y, z = z}))
if noiseRocksValue > 4 then if noiseRocksValue > 5 then
data[index] = ids.syliteBlack
elseif noiseRocksValue > 4.5 then
data[index] = ids.syliteGray
elseif noiseRocksValue > 4 then
data[index] = ids.sylite data[index] = ids.sylite
else else
data[index] = biome.groundNodesIDs.soil data[index] = biome.groundNodesIDs.soil
@@ -262,9 +275,13 @@ local function generateTurf(biome, mapGenerator, data, index, x, y, z)
rocksNoise = core.get_value_noise(rocksNoiseParams) rocksNoise = core.get_value_noise(rocksNoiseParams)
end end
local noiseRocksValue = mathRound(rocksNoise:get_3d({x = x, y = y, z = z})) local noiseRocksValue = (rocksNoise:get_3d({x = x, y = y, z = z}))
if noiseRocksValue > 4 then if noiseRocksValue > 5 then
data[index] = ids.syliteBlack
elseif noiseRocksValue > 4.5 then
data[index] = ids.syliteGray
elseif noiseRocksValue > 4 then
data[index] = ids.sylite data[index] = ids.sylite
else else
data[index] = biome.groundNodesIDs.turf data[index] = biome.groundNodesIDs.turf

View File

@@ -30,12 +30,17 @@ local function registerRocksTypes(postfix, x)
{"sylite_gray"..postfix, {ts:t(x, 1)}}, {"sylite_gray"..postfix, {ts:t(x, 1)}},
{"sylite_black"..postfix, {ts:t(x, 2)}}, {"sylite_black"..postfix, {ts:t(x, 2)}},
{"tauitite_light"..postfix, {ts:t(x, 3)}}, {"tauitite_light"..postfix, {ts:t(x, 3)}},
{"tauitite"..postfix, {ts:t(x, 4)}}, {"tauitite_pink"..postfix, {ts:t(x, 4)}},
{"iyellite"..postfix, {ts:t(x, 5)}}, {"tauitite"..postfix, {ts:t(x, 5)}},
{"falmyte"..postfix, {ts:t(x, 6)}}, {"falmyte_light"..postfix, {ts:t(x, 6)}},
{"hapcoryte"..postfix, {ts:t(x, 8)}}, {"falmyte_yellow"..postfix, {ts:t(x, 7)}},
{"burcite"..postfix, {ts:t(x, 10)}}, {"falmyte_red"..postfix, {ts:t(x, 8)}},
{"felhor"..postfix, {ts:t(x, 12)}}, {"falmyte_dark"..postfix, {ts:t(x, 9)}},
{"iyellite"..postfix, {ts:t(x, 14)}},
{"falmyte"..postfix, {ts:t(x, 14)}},
{"hapcoryte"..postfix, {ts:t(x, 14)}},
{"burcite"..postfix, {ts:t(x, 14)}},
{"felhor"..postfix, {ts:t(x, 14)}},
{"malachite"..postfix, {ts:t(x, 14)}} {"malachite"..postfix, {ts:t(x, 14)}}
}) })
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB