Post your mapgen questions here (modding or engine)
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
ShadMOrdre,
There is no lua version of V7 or V5.
If you search my mods you will find a few lua mapgens that are quite good code examples.
I didn't know there was a lua version of Carpathian, best ask the mapgen creator 'demon_boy' in this thread viewtopic.php?f=9&t=17174
There is no lua version of V7 or V5.
If you search my mods you will find a few lua mapgens that are quite good code examples.
I didn't know there was a lua version of Carpathian, best ask the mapgen creator 'demon_boy' in this thread viewtopic.php?f=9&t=17174
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
Vadtec.
Currently experimenting. Imagine this is an entire MT world.
However, it's possible this will require MT 5.0.0-dev or later since it requires the new 'mgv7_mount_zero_level' parameter, without that it won't look as good as this.
What version of MT is this for, 0.4.16 / 0.4.17.1 or 5.0.0-dev?
- Attachments
-
- screenshot_20181214_070326.png (282 KiB) Viewed 728 times
Re: Post your mapgen questions here (modding or engine)
Hello, I would like to know what is the maximum altitude of the lands generated by default by magen V7 ?
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
R-One the highest mountain i have found had a summit at y = 450.
Re: Post your mapgen questions here (modding or engine)
Is it possible to generate ores within ores?
For example, I could have an ore blob of "super hard stone" and within that I would want a chance of a scatter ore of diamond blocks.
This is basically my attempt at making the underground less uniform "stone".
Edit: it might work if I register the "inner ore" after the "outer ore". Maybe. Looks like the code loops through ores and checks per potential ore node placement if this is an okay block. So it might work something like this
"Outer" is a regular ore and can be found in default stone
"Inner" is an ore that can be found in "outer"
Outer ore generated as blob, code modifies vm->m_data
Inner ore generated, code checks vm->m_data for "outer", places it
So assuming that the ores are generated in order of them being registered it should work, but quite hacky.
For example, I could have an ore blob of "super hard stone" and within that I would want a chance of a scatter ore of diamond blocks.
This is basically my attempt at making the underground less uniform "stone".
Edit: it might work if I register the "inner ore" after the "outer ore". Maybe. Looks like the code loops through ores and checks per potential ore node placement if this is an okay block. So it might work something like this
"Outer" is a regular ore and can be found in default stone
"Inner" is an ore that can be found in "outer"
Outer ore generated as blob, code modifies vm->m_data
Inner ore generated, code checks vm->m_data for "outer", places it
So assuming that the ores are generated in order of them being registered it should work, but quite hacky.
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
> So assuming that the ores are generated in order of them being registered
They are.
So your method will work and is not hacky at all, it couldn't be any less hacky. It's intuitive.
They are.
So your method will work and is not hacky at all, it couldn't be any less hacky. It's intuitive.
Re: Post your mapgen questions here (modding or engine)
Adding ores is very intuitive, depending on an unstated, implicit processing ordering is hacky. There is a ghost dependcy between ores. I'm still gunna do it though.paramat wrote:So your method will work and is not hacky at all, it couldn't be any less hacky. It's intuitive.
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
I agree the use of order should be documented, i'll put that on my TODO.
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
There have been some requests for how to disable the 'caves'/'cracks'/'tunnels' that intersect the surface in non-mgv6 mapgens.
For mgv7 add this to the minetest.conf file, or find the parameter in advanced settings:
Yes larger values mean narrower caves.
All non-mgv6 mapgens have this parameter.
For mgv7 add this to the minetest.conf file, or find the parameter in advanced settings:
Code: Select all
mgv7_cave_width = 1000
All non-mgv6 mapgens have this parameter.
Re: Post your mapgen questions here (modding or engine)
What would be the value if you wanted caves that were on average 10 blocks wide?
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
No idea, the value is abstract. Trial and error. I think the average width is close to 10 nodes already.
Re: Post your mapgen questions here (modding or engine)
Hi,
i want to use valleys as mapgenerator. How can i disable dungeons on this generator?
Greets
i want to use valleys as mapgenerator. How can i disable dungeons on this generator?
Greets
- Nathan.S
- Member
- Posts: 1147
- Joined: Wed Sep 24, 2014 17:47
- GitHub: NathanSalapat
- IRC: NathanS21
- In-game: NathanS21
- Location: Bigsby Texas
- Contact:
Re: Post your mapgen questions here (modding or engine)
You can set nodungeons in the mapgen flags. There are probably several ways to do that, but if you create a world and then browse to the save location you should be able to open the map_meta.txt file and find the mg_flags line and change dungeons to nodungeons, and this will prevent any more dungeons from being generated.lilo wrote:Hi,
i want to use valleys as mapgenerator. How can i disable dungeons on this generator?
Greets
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course
Check out my website, and brand new Minetest Modding Course
-
- New member
- Posts: 1
- Joined: Wed Mar 06, 2019 18:53
- In-game: thediamondlego
Re: Post your mapgen questions here (modding or engine)
Is there a way to generate 1 node in every spot of the world(even replacing air)
vimitItM9ET2CwT2E2MPiHJMgOspdKs7
- Linuxdirk
- Member
- Posts: 3217
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your mapgen questions here (modding or engine)
I wonder how to get the most out of mgv7. Floatlands? All decrations? Slightly more emphasized terrain, larger and deeper/longer caves, dungeons, valleys, rivers, etc. I know the documentation, but what are playtested values to create some really awesome terrain?
-
- Member
- Posts: 1118
- Joined: Mon Dec 29, 2014 08:07
- Location: USA
Re: Post your mapgen questions here (modding or engine)
LinuxDirk,
Such a loaded question... ;) I guess it really depends on what kind of play you are wanting.
I like to play with the settings in mgv7 way too much. It really distracts me from actually playing MT.
Here is a sample map_meta.txt file for a mgv7 world. I disable mountains, floatlands, caves, dungeons, and ridges. I then multiply mgv7_np_terrain_alt and mgv7_np_terrain_base scale and spread values by 4. I also alter the persistence and octave values for both. I modify the mgv7_np_terrain_persist spread, octave, and persistence values and reduce mgv7_np_height_select offset to -0.25 and scale to 1, and alter octave and persistence.
Previously, I've also modified mgv7_np_terrain_base seed to be the same as mgv7_np_terrain_alt, which I think actually blends base terrain with mountains. I've seen mountain peeks upwards of 400 meters with these settings, and this can be further increased by increasing mgv7_np_height_select octave.
IMHO, it feels more natural at this scale.
Shad
Such a loaded question... ;) I guess it really depends on what kind of play you are wanting.
I like to play with the settings in mgv7 way too much. It really distracts me from actually playing MT.
Here is a sample map_meta.txt file for a mgv7 world. I disable mountains, floatlands, caves, dungeons, and ridges. I then multiply mgv7_np_terrain_alt and mgv7_np_terrain_base scale and spread values by 4. I also alter the persistence and octave values for both. I modify the mgv7_np_terrain_persist spread, octave, and persistence values and reduce mgv7_np_height_select offset to -0.25 and scale to 1, and alter octave and persistence.
Previously, I've also modified mgv7_np_terrain_base seed to be the same as mgv7_np_terrain_alt, which I think actually blends base terrain with mountains. I've seen mountain peeks upwards of 400 meters with these settings, and this can be further increased by increasing mgv7_np_height_select octave.
Spoiler
Code: Select all
mgv7_np_cave2 = {
flags = defaults
lacunarity = 2
offset = 0
scale = 12
spread = (67,67,67)
seed = 10325
octaves = 3
persistence = 0.5
}
mgv7_np_cave1 = {
flags = defaults
lacunarity = 2
offset = 0
scale = 12
spread = (61,61,61)
seed = 52534
octaves = 3
persistence = 0.5
}
mgv7_np_cavern = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1
spread = (384,128,384)
seed = 723
octaves = 5
persistence = 0.63
}
mgv7_cave_width = 0.09
mg_biome_np_heat = {
flags = defaults
lacunarity = 2
offset = 50
scale = 50
spread = (1000,1000,1000)
seed = 5349
octaves = 3
persistence = 0.5
}
mgv7_lava_depth = -256
mgv7_np_mount_height = {
flags = defaults
lacunarity = 2
offset = 256
scale = 112
spread = (1000,1000,1000)
seed = 72449
octaves = 3
persistence = 0.6
}
mg_biome_np_humidity_blend = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1.5
spread = (8,8,8)
seed = 90003
octaves = 2
persistence = 1
}
mgv7_np_ridge = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1
spread = (100,100,100)
seed = 6467
octaves = 4
persistence = 0.75
}
mgv7_large_cave_depth = -33
mg_biome_np_humidity = {
flags = defaults
lacunarity = 2
offset = 50
scale = 50
spread = (1000,1000,1000)
seed = 842
octaves = 3
persistence = 0.5
}
mg_biome_np_heat_blend = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1.5
spread = (8,8,8)
seed = 13
octaves = 2
persistence = 1
}
mgv7_floatland_level = 1280
mgv7_np_terrain_base = {
flags = defaults
lacunarity = 2
offset = -4
scale = 400
spread = (2400,2400,2400)
seed = 82341
octaves = 8
persistence = 0.3
}
mgv7_np_float_base_height = {
flags = defaults
lacunarity = 2
offset = 48
scale = 24
spread = (300,300,300)
seed = 907
octaves = 4
persistence = 0.7
}
seed = 16096304901732432682
water_level = 1
mapgen_limit = 31000
mg_name = v7
mgv7_cavern_threshold = 0.7
mgv7_dungeon_ymin = -31000
chunksize = 5
mg_flags = nocaves, nodungeons, light, decorations, biomes
mgv7_np_height_select = {
flags = defaults
lacunarity = 2
offset = -0.25
scale = 1
spread = (500,500,500)
seed = 4213
octaves = 4
persistence = 0.4
}
mgv7_np_mountain = {
flags = defaults
lacunarity = 2
offset = -0.6
scale = 1
spread = (250,350,250)
seed = 5333
octaves = 5
persistence = 0.63
}
mgv7_shadow_limit = 1024
mgv7_float_mount_height = 128
mgv7_float_mount_exponent = 0.75
mgv7_np_terrain_persist = {
flags = defaults
lacunarity = 2
offset = 0.6
scale = 0.1
spread = (1200,1200,1200)
seed = 539
octaves = 2
persistence = 0.3
}
mgv7_cavern_limit = -256
mgv7_cavern_taper = 256
mgv7_dungeon_ymax = 31000
mgv7_float_mount_density = 0.6
mgv7_np_terrain_alt = {
flags = defaults
lacunarity = 2
offset = -4
scale = 100
spread = (2400,2400,2400)
seed = 5934
octaves = 6
persistence = 0.6
}
mgv7_spflags = nomountains, noridges, nofloatlands, nocaverns
mgv7_np_filler_depth = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1.2
spread = (150,150,150)
seed = 261
octaves = 3
persistence = 0.7
}
mgv7_mount_zero_level = 0
mgv7_np_ridge_uwater = {
flags = defaults
lacunarity = 2
offset = 0
scale = 1
spread = (1000,1000,1000)
seed = 85039
octaves = 5
persistence = 0.6
}
mgv7_np_floatland_base = {
flags = defaults
lacunarity = 2
offset = -0.6
scale = 1.5
spread = (600,600,600)
seed = 114
octaves = 5
persistence = 0.6
}
[end_of_params]
Shad
- Linuxdirk
- Member
- Posts: 3217
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Post your mapgen questions here (modding or engine)
Something that is fun to explore over and under ground. Large and fascinating mountains with overhangs, floating islands high up in the sky. But still "playable" and not just a voxel terrain wallpaper generator like carpathian. I want long and deep caves (hundreds and hundreds of nodes) with giant halls where the ceiling is not loaded when standing on ground, rivers and crevices, deep large oceans, complex dungeons, etc.ShadMOrdre wrote:I guess it really depends on what kind of play you are wanting.
Just something that is awesome at first look but is still playable at second look.
Re: Post your mapgen questions here (modding or engine)
If I may take this opportunity to toot my own horn slightly with a mod recommendation, I wrote dfcaverns to provide this sort of thing. Tried to add lots of variety and interesting places to discover underground.Linuxdirk wrote:I want long and deep caves (hundreds and hundreds of nodes) with giant halls where the ceiling is not loaded when standing on ground
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your mapgen questions here (modding or engine)
> Is there a way to generate 1 node in every spot of the world(even replacing air)
Yes, use the 'singlenode' mapgen with a mod that sets the singlenode mapgen alias to your desired node, see https://github.com/minetest/minetest/bl ... i.txt#L353
Yes, use the 'singlenode' mapgen with a mod that sets the singlenode mapgen alias to your desired node, see https://github.com/minetest/minetest/bl ... i.txt#L353
- StarNinjas
- Member
- Posts: 411
- Joined: Wed Mar 14, 2018 00:32
- GitHub: starninjas
- IRC: StarNinjas
- In-game: J1
- Location: Terrarca
- Contact:
Re: Post your mapgen questions here (modding or engine)
Paramat is there a way to create highland pools (as in your mod) but that work well with mg7?
Don't go to bed tonight, without knowing what would happen if you died. https://thegospelfilm.org/
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Post your mapgen questions here (modding or engine)
I love those highlandpools as well and experimented some time ago with them. All it takes is a mapgen with support for the heightmap (mg7 ought to work) and a node to fill your lakes with.StarNinjas wrote: Paramat is there a way to create highland pools (as in your mod) but that work well with mg7?
The detection of the extensions of the lake is not always perfect. That doesn't matter too much as a bit of floating water may sometimes even look good.
Not all potential holes can be detected and filled. A lake will not cross over a mapchunk border as the lake detection is based on the hightmap - which is only available for the mapchunk.
Currently, every hole there is, no matter how tiny or deep or in which biome, is filled. This does not always give the results you might wish for. Lake after lake in the desert may not be what you expect. Neither may be lakes in cold areas where all ought to have frozen over.
Trees and plants are not actively removed. No plants are placed.
All this taken together, you can see this as an experiment and try it out in a new world. Might even be fun to use default:lava_source as a lake material (easier to see them that way). But for any real usage, there'd have to be more decoration and thought added.
See here: https://github.com/Sokomine/lakes.git
A list of my mods can be found here.
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Post your mapgen questions here (modding or engine)
Screenshot of a reasonably well looking lake:
- Attachments
-
- lake.jpg (185.92 KiB) Viewed 728 times
A list of my mods can be found here.
-
- Member
- Posts: 1118
- Joined: Mon Dec 29, 2014 08:07
- Location: USA
Re: Post your mapgen questions here (modding or engine)
I've had some luck putting lakes in mgv7 using the bergsee mod from the OCD game.
I added to this mod, and can successfully put not just lakes of water, but lava, quicksand, and others. After checking for holes in the current chunk, the code tests for the type of ground node, and paces the appropriate "liquid".
Here's the code for it, a self contained init.lua file. I call my version, lib_lakes. I have not posted this in the forums or github. My version depends on my lib_materials mod, but you can use any ground type node, based on the game you are playing.
The license is GPLv3, as per Bas080
I added to this mod, and can successfully put not just lakes of water, but lava, quicksand, and others. After checking for holes in the current chunk, the code tests for the type of ground node, and paces the appropriate "liquid".
Here's the code for it, a self contained init.lua file. I call my version, lib_lakes. I have not posted this in the forums or github. My version depends on my lib_materials mod, but you can use any ground type node, based on the game you are playing.
The license is GPLv3, as per Bas080
Code: Select all
--[[
1. We choose a random position in the same way plants are placed. That's the root for our lake.
2. From there we go lx in the x direction and lz in the z direction. That gives us a rectangle.
3. We check the sides of the rectangle for air and itterate down until the rectangle is closed.
4. Now we repeat this itteration, but search for the opposite, not for solid nodes but for air.
5. As soon as we found the lower limit, we check if the bottom is sealed. Now we have some jar.
6. Now as we made sure no water can escape we can replace all air inside the volume with water.
--]]
lib_lakes = {}
local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_water = minetest.get_content_id("default:water_source")
local c_ice = minetest.get_content_id("default:ice")
local c_murky = minetest.get_content_id("lib_materials:murky_river_water_source")
local c_muddy = minetest.get_content_id("lib_materials:muddy_river_water_source")
local c_dirty = minetest.get_content_id("lib_materials:dirty_water_source")
local c_quick_source = minetest.get_content_id("lib_materials:quicksand_source")
local c_quick = minetest.get_content_id("lib_materials:quicksand")
local c_fluid_id
--
-- Find position
--
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y <= 1024 and minp.y >= -32 then
local perlin1 = minetest.get_perlin(318, 3, 0.6, 100)
-- Lua Voxel Machine
local vm = minetest.get_voxel_manip()
local vm_minp, vm_maxp = vm:read_from_map({x=minp.x, y=minp.y, z=minp.z-16}, {x=maxp.x+16, y=maxp.y+16, z=maxp.z+16})
local a = VoxelArea:new{MinEdge=vm_minp, MaxEdge=vm_maxp}
local data = vm:get_data()
-- Assume X and Z lengths are equal
local divlen = 32
local divs = (maxp.x-minp.x)/divlen+1;
for divx=0,divs-1 do
for divz=0,divs-1 do
local x0 = minp.x + math.floor((divx+0)*divlen)
local z0 = minp.z + math.floor((divz+0)*divlen)
local x1 = minp.x + math.floor((divx+1)*divlen)
local z1 = minp.z + math.floor((divz+1)*divlen)
-- Determine amount from perlin noise
local amount = math.floor(perlin1:get2d({x=x0, y=z0}) * 5 + 10)
-- Find random positions based on this random
local pr = PseudoRandom(seed+486)
for i=0,amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
local ground_y = nil
-- Prevent from starting underground
local nn = minetest.get_node({x=x,y=maxp.y,z=z}).name
if nn ~= "air" and nn ~= "ignore" then
return
end
-- Find groundlevel
for y=maxp.y,minp.y,-1 do
local nn = minetest.get_node({x=x,y=y,z=z}).name
if nn ~= "air" and nn~= "ignore" then
local is_leaves = minetest.registered_nodes[nn].groups.leaves
if is_leaves == nil or is_leaves == 0 then
ground_y = y
break
end
end
end
if ground_y and ground_y >= 2 then
local p = {x=x,y=ground_y,z=z}
local ground_name = minetest.get_node(p)
local node_name = minetest.get_node(p).name
if ground_name == "default:water_source" then return end
local lx = pr:next(10,30)
local lz = pr:next(10,30)
if string.match(node_name, "lib_materials:sand") then
c_fluid_id = c_quick_source
end
if string.match(node_name, "lib_materials:dirt_sandy") then
c_fluid_id = c_quick
end
if string.match(node_name, "rainforest") then
c_fluid_id = c_murky
end
if string.match(node_name, "with_brown") then
c_fluid_id = c_muddy
end
if string.match(node_name, "with_dry") then
c_fluid_id = c_muddy
end
if string.match(node_name, "with_grass") then
c_fluid_id = c_dirty
end
if string.match(node_name, "coniferous") then
c_fluid_id = c_dirty
end
if string.match(node_name, "with_snow") then
c_fluid_id = c_ice
end
if ground_y >= 120 then
c_fluid_id = c_ice
end
-- if c_water == "" then
-- else
-- c_water = minetest.get_content_id("default:river_water_source")
-- end
lib_lakes.fill(data, a, p, lx, lz)
--c_fluid_id = ""
end
end
end
end
-- Write to map
vm:set_data(data)
vm:write_to_map(data)
vm:update_map()
end
end)
--
-- Make lake
--
-- TODO: combine functions into one
local function check_x(data, a, x, y, z, lx, lz)
for xi = 0, lx do
local vi = a:index(x+xi, y, z)
if data[vi] == c_air or data[vi] == c_ignore then
return true
end
local vii = a:index(x+xi, y, z+lz)
if data[vii] == c_air or data[vii] == c_ignore then
return true
end
end
end
local function check_z(data, a, x, y, z, lx, lz)
for zi = 0, lz do
local vi = a:index(x, y, z+zi)
if data[vi] == c_air or data[vi] == c_ignore then
return true
end
local vii = a:index(x+lx, y, z+zi)
if data[vii] == c_air or data[vii] == c_ignore then
return true
end
end
end
local function leak(data, a, j, lx, lz)
for xi = 0, lx do
for zi = 0, lz do
local vi = a:index(xi, -j, zi)
if data[vi] == c_air or data[vi] == c_ignore then
return true
end
end
end
end
function lib_lakes.fill(data, a, pos, lx, lz)
local x, y, z = pos.x, pos.y, pos.z
local water_a = VoxelArea:new{MinEdge={x=0, y=-32, z=0}, MaxEdge={x=lx, y=0, z=lz}}
local water_buffer = {}
-- Find upper start
local i = 0
while i <= 16 do
if check_x(data, a, x, y-i, z, lx, lz) or check_z(data, a, x, y-i, z, lx, lz) then
i = i + 1
else
break
end
end
if i >= 16 then return end
-- Itterate downwards
local j = i
while j <= (i+16) do
if check_x(data, a, x, y-j, z, lx, lz) or check_z(data, a, x, y-j, z, lx, lz) then
j = j - 1
break
else
j = j + 1
end
end
if j >= i+16 then return end
-- print ('[lib_lakes] i = '.. i ..'')
-- print ('[lib_lakes] j = '.. j ..'')
-- Check bottom
if leak(data, a, j, lx, lz) then return end
-- Add volume to buffer
for xi = 0, lx do
for yi = -i, -j, -1 do
for zi = 0, lz do
water_buffer[water_a:index(xi, yi, zi)] = true
end
end
end
-- Add the water
for xi = water_a.MinEdge.x, water_a.MaxEdge.x do
for yi = water_a.MinEdge.y, water_a.MaxEdge.y do
for zi = water_a.MinEdge.z, water_a.MaxEdge.z do
if a:contains(x+xi, y+yi, z+zi) then
local vi = a:index(x+xi, y+yi, z+zi)
if data[vi] == c_air or data[vi] == c_ignore then
if water_buffer[water_a:index(xi, yi, zi)] then
data[vi] = c_fluid_id
-- print ('[lib_lakes] Wasser auf (' .. x+xi .. ',' .. y+yi .. ',' .. z+zi .. ')')
end
end
end
end
end
end
end
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Post your mapgen questions here (modding or engine)
My code can be extended to place other liquids as well - even based on surface and volume of the potential lake.ShadMOrdre wrote: I added to this mod, and can successfully put not just lakes of water, but lava, quicksand, and others. After checking for holes in the current chunk, the code tests for the type of ground node, and paces the appropriate "liquid".
Your algorithm works diffrently. Mine doesn't even use VoxelManip. The heightmap is read (which is very fast), analyzed for potential lakes (still pretty fast) - and the fill node placed at the lakes' surface via set_node(..) (faster for small amounts of nodes). For lager lakes, VoxelManip would be better.
Currently, each detected hole is turned into a lake. For a real mod, it ought to be much better to just create some lakes and ignore other holes.
Might be intresting to see what performs better.
A list of my mods can be found here.
Who is online
Users browsing this forum: No registered users and 7 guests