paramat wrote:Also, the 'csize' used in 'get perlinmap' should have it's z component set to 1, otherwise you can end up using 80 times more data.
Perhaps i need to write another super-simple example mapgen.
paramat wrote:Trimming off the shell might even slow things down.
paramat wrote:A smaller LVM might save on lua memory though.
mgv7_np_terrain_base = 4, 70, (600, 600, 600), 82341, 5, 0.6, 2.0
mgv7_np_terrain_alt = 4, 25, (600, 600, 600), 5934, 5, 0.6, 2.0
mgv7_np_terrain_persist = 0.6, 0.12, (2000, 2000, 2000), 539, 3, 0.5, 2.0
mgv7_np_height_select = -12, 24, (500, 500, 500), 4213, 6, 0.69, 2.0
mgv7_np_filler_depth = 0, 1.2, (150, 150, 150), 261, 4, 0.7, 2.0
mgv7_np_mount_height = 675, 350, (3000, 2000, 3000), 72449, 3, 0.5, 2.0
mgv7_np_ridge_uwater = 0, 1, (1000, 1000, 1000), 85039, 5, 0.6, 2.0
mgv7_np_mountain = -0.6, 1, (850, 1450, 850), 5333, 5, 0.68, 2.0
mgv7_np_ridge = 0, 1, (100, 100, 100), 6467, 4, 0.75, 2.0
mgv7_np_cave1 = 0, 12, (100, 100, 100), 52534, 4, 0.5, 2.0
mgv7_np_cave2 = 0, 12, (100, 100, 100), 10325, 4, 0.5, 2.0
burli wrote:Another question. I want to make realistic lakes/ponds. Any idea how to make them?
burli wrote:Maybe someone find this useful. This is the most simple Lua mapgen. Just generates stone and water
And maybe someone can replace the example in the get_perlin_map Wiki page. It does not work. I need a while until I found that get2dMap_flat doesn't want 3d coordinatesYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.set_mapgen_params({mgname="singlenode"})
minetest.register_on_generated(function(minp, maxp, seed)
local c_stone = minetest.get_content_id("default:stone")
local c_water = minetest.get_content_id("default:water_source")
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local csize = vector.add(vector.subtract(maxp, minp), 1)
local write = false
local noise_1 = minetest.get_perlin_map({offset = 5,
scale = 15,
seed = 1234,
spread = {x = 250, y = 250, z = 250},
octaves = 5,
persist = 0.6,
lacunarity = 2,
flags = "defaults"},
csize):get2dMap_flat({x=minp.x, y=minp.z})
local index2d = 0
for z = minp.z, maxp.z do
for y = minp.y, maxp.y do
for x = minp.x, maxp.x do
index2d = (z - minp.z) * csize.x + (x - minp.x) + 1
local ivm = a:index(x, y, z)
if y < noise_1[index2d] then
data[ivm] = c_stone
write = true
elseif y > noise_1[index2d] and y < 1 then
data[ivm] = c_water
write = true
end
end
end
end
if write then
vm:set_data(data)
vm:set_lighting({day = 0, night = 0})
vm:calc_lighting()
vm:update_liquids()
vm:write_to_map()
end
end
demon_boy wrote:
I've spent a few months refactoring my Australia mod and I'm not far from completion.
I've used a combination of some plantlife mods, Valleys Mapgen plants API and some of DuaneR code to get something close to what you are might call realistic.
What I have managed to achieve is a riparian zone. I have trees and plants following rivers. Some only spawn by rivers. Note the bare landscape away from the river.
Also, I've got green grass growing near rivers, reeds and juncus on the banks. A few lillies nearby.
minetest.set_mapgen_setting_noiseparams(
"mg_biome_np_heat",
{
offset = 50,
scale = 50,
spread = {x = 1000, y = 1000, z = 1000},
seed = 5349,
octaves = 3,
persistence = 0.5,
lacunarity = 2.0,
flags = "defaults"
},
true
)
paramat wrote:To save you some frustration, here is how to use the new 'minetest.set_mapgen_setting_noiseparams()' to set noise params in a mod. Hmmmm's intention is to move the setting of noise params out of .conf and into lua mods.
The documentation on this is confusing as it suggests the use of 'override_meta = true' as the 3rd argument, whereas it is simply 'true' or 'false'.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.set_mapgen_setting_noiseparams(
"mg_biome_np_heat",
{
offset = 50,
scale = 50,
spread = {x = 1000, y = 1000, z = 1000},
seed = 5349,
octaves = 3,
persistence = 0.5,
lacunarity = 2.0,
flags = "defaults"
},
true
)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
yslice_prob = {
{ypos = 1, prob = 127},
{ypos = 2, prob = 63}
}
yslice_prob = {
{ypos = 1, prob = 255},
{ypos = 2, prob = 255}
}
Users browsing this forum: No registered users and 57 guests