Post your mapgen questions here (modding or engine)
- Skamiz Kazzarch
- Member
- Posts: 619
- Joined: Fri Mar 09, 2018 20:34
- GitHub: Skamiz
- In-game: Skamiz
- Location: la lojbaugag.
Re: Post your mapgen questions here (modding or engine)
Just to make sure, but are you calling 'minetest.generate_decorations()' as described here:
https://github.com/minetest/minetest/bl ... .txt#L4789
https://github.com/minetest/minetest/bl ... .txt#L4789
Re: Post your mapgen questions here (modding or engine)
And just like that, you hand me the answer I didn't know existed, thanks :)Skamiz Kazzarch wrote: ↑Wed May 06, 2020 14:03Just to make sure, but are you calling 'minetest.generate_decorations()' as described here:
https://github.com/minetest/minetest/bl ... .txt#L4789
Code: Select all
minetest.register_on_generated(function(minp, maxp, seed)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
vm:get_data(mapdata)
minetest.generate_decorations(vm)
vm:calc_lighting()
vm:write_to_map()
end)
- sirrobzeroone
- Member
- Posts: 593
- Joined: Mon Jul 16, 2018 07:56
- GitHub: sirrobzeroone
- Contact:
Re: Post your mapgen questions here (modding or engine)
Perlin noise question, I'm pretty sure this is a general perlin noise question, not something specific to the minetest engine, but in regards to minetest it relates to creating a pure lua mapgen using singlenode.
Borrowed the below settings from one of Paramat's many replies although I set spread super small for testing, saves me having to walk all over the map
As I understand the above will generate up a range of values in the perlin noise from -1.75 to 1.75 (again info gathered from one of paramat's many replies :) ) and appears true when I output to debug.
I run a simple multiplication and addition over the range (more for me as I think in Celsius)
I do (Noise*20)+15 so my range becomes:
-20 to 50 (Nice range for temps in degrees C) (mid value becomes 15)
low temps = -20 to 4
normal temps = 5 to 34
High temps = 35 to 50
If I do a rough assignment of Low = snow blocks, normal = grass blocks and high = desert . What I see when my simple mapgen runs is mostly grass blocks with a smattering of desert and snow - this is actually great as it saves me time or shifting anything as I want grass more common. However I expected initially that the perlin noise would have an equal chance of generating any value (the little reading I've done seemed to indicate this) and I was initially expecting to have to shift my groups away from even 3rds.
So I went back to reading about perlin noise and Octaves. I think what is happening is that due to the ocatves being set to 3 and persist (does this = Lacunarity) being less than one, between these two I think it moves (smooths) the values more towards the mid-point and away from the extreme ends? (I put one of the urls I read at the end as its way to long - the url not the article)
I just wanted to check I'm understanding this correctly as that's pretty cool for heat (and I'd imagine humidity maps), well pretty much anything were you might need values weighted towards the middle/mean value.
thanks again for any help.
https://medium.com/@yvanscher/playing-w ... 0smoother.
Borrowed the below settings from one of Paramat's many replies although I set spread super small for testing, saves me having to walk all over the map
Code: Select all
local np_heat = {
offset = 0,
scale = 1,
spread = {x = 10, y = 10, z = 10}, -- small for testing
seed = 9130,
octaves = 3,
persist = 0.3
}
I run a simple multiplication and addition over the range (more for me as I think in Celsius)
I do (Noise*20)+15 so my range becomes:
-20 to 50 (Nice range for temps in degrees C) (mid value becomes 15)
low temps = -20 to 4
normal temps = 5 to 34
High temps = 35 to 50
If I do a rough assignment of Low = snow blocks, normal = grass blocks and high = desert . What I see when my simple mapgen runs is mostly grass blocks with a smattering of desert and snow - this is actually great as it saves me time or shifting anything as I want grass more common. However I expected initially that the perlin noise would have an equal chance of generating any value (the little reading I've done seemed to indicate this) and I was initially expecting to have to shift my groups away from even 3rds.
So I went back to reading about perlin noise and Octaves. I think what is happening is that due to the ocatves being set to 3 and persist (does this = Lacunarity) being less than one, between these two I think it moves (smooths) the values more towards the mid-point and away from the extreme ends? (I put one of the urls I read at the end as its way to long - the url not the article)
I just wanted to check I'm understanding this correctly as that's pretty cool for heat (and I'd imagine humidity maps), well pretty much anything were you might need values weighted towards the middle/mean value.
thanks again for any help.
https://medium.com/@yvanscher/playing-w ... 0smoother.
- Skamiz Kazzarch
- Member
- Posts: 619
- Joined: Fri Mar 09, 2018 20:34
- GitHub: Skamiz
- In-game: Skamiz
- Location: la lojbaugag.
Re: Post your mapgen questions here (modding or engine)
There are several factors at play here, but the biggest probably is your assumption about the bounds of the noise values.
Here is the section of the lua api which describes how the octaves are combined:
https://github.com/minetest/minetest/bl ... .txt#L3252
In your case it would result in a maximum of: 1 + (1 * 0.3) + (1 * 0.3 * 0. 3) = 1 + 0.3 + 0.09 = 1.39
Which in your case results into a range of roughly -12 to 42.
Another fator is that with multiple octaves the noise is indeed biased towards the middle.
The noise value at any point is the sum of every octave at the point, so to get a final result equal to the maximum bound, several octaves have to independently get the maximum value at that point.
You can think of it like rolling dice. If you roll only one, you get an equal distribution from 1 to 6. If you roll two you get a distribution from 2 to 12, but while there is only one combination which gives you 12, (6+6) there are several combinations that give you 7, (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), which makes that result much more likely.
It isn't quite as straightforward with the noise, since persistance modifies the magnitude of the second value, but you get the idea.
Lastly:
From the documentation:
Which would look in practice like this:
for an output of -20 to 50
Here is the section of the lua api which describes how the octaves are combined:
https://github.com/minetest/minetest/bl ... .txt#L3252
In your case it would result in a maximum of: 1 + (1 * 0.3) + (1 * 0.3 * 0. 3) = 1 + 0.3 + 0.09 = 1.39
Which in your case results into a range of roughly -12 to 42.
Another fator is that with multiple octaves the noise is indeed biased towards the middle.
The noise value at any point is the sum of every octave at the point, so to get a final result equal to the maximum bound, several octaves have to independently get the maximum value at that point.
You can think of it like rolling dice. If you roll only one, you get an equal distribution from 1 to 6. If you roll two you get a distribution from 2 to 12, but while there is only one combination which gives you 12, (6+6) there are several combinations that give you 7, (1+6, 2+5, 3+4, 4+3, 5+2, 6+1), which makes that result much more likely.
It isn't quite as straightforward with the noise, since persistance modifies the magnitude of the second value, but you get the idea.
Lastly:
No - I am asumming paramat just didn't use it in the example you used, but lacunarity is a seperate value which you can specify in the noise param table. If you click the link I posted and scroll down a bit it explains all the values you can use in the noise params.persist (does this = Lacunarity)
You can let minetest do this for you by setting the scale and offset values.I run a simple multiplication and addition over the range
From the documentation:
Code: Select all
final noise = offset + (scale * noise value)
Code: Select all
local np_heat = {
offset = 15,
scale = 25.18,
spread = {x = 10, y = 10, z = 10}, -- small for testing
seed = 9130,
octaves = 3,
persist = 0.3
}
- sirrobzeroone
- Member
- Posts: 593
- Joined: Mon Jul 16, 2018 07:56
- GitHub: sirrobzeroone
- Contact:
Re: Post your mapgen questions here (modding or engine)
Really appreciate the reply and the effort you've put in to fully explain were I've gone wrong - Thanks it's just what i need, couple of my assumptions would have caused me big issues later on.
- 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, because it has not been generated yet, so there is no way to know what it will be.Kurtzmusch wrote: ↑Mon May 04, 2020 18:23is it possible to obtain a vmanip of an area that hasnt been emerged or generated yet?
- 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)
Correct.Skamiz Kazzarch wrote: ↑Tue Jun 02, 2020 09:17Another fator is that with multiple octaves the noise is indeed biased towards the middle.
The noise value at any point is the sum of every octave at the point, so to get a final result equal to the maximum bound, several octaves have to independently get the maximum value at that point.
Even noise with 1 octave does not generate output equally spread between -1 and 1, it is also slightly biased towards the middle values.
Re: Post your mapgen questions here (modding or engine)
I guess this is a mapgen question, but not completely sure, so I apologize if this belongs somewhere else. Anyway...
Let's say you use some mapgen to generate a world, and then you build a bunch of buildings on it, spawn in a bunch of NPCs, place some mob spawners here and there, get rid of a mountain you don't like, etc. You're making a game that is already pre-built, like an adventure game, with quests, specific bosses only at certain places, all that good stuff.
Is there some way for the player to generate a new game that already has all that content in it? Not just the procedural map generated from a seed, but one including all the buildings, NPCs, quests, etc. I tried searching for this every way I could think of, but it's kind of an awkward thing to search (thinking of the right keywords, that is).
Thanks!
Let's say you use some mapgen to generate a world, and then you build a bunch of buildings on it, spawn in a bunch of NPCs, place some mob spawners here and there, get rid of a mountain you don't like, etc. You're making a game that is already pre-built, like an adventure game, with quests, specific bosses only at certain places, all that good stuff.
Is there some way for the player to generate a new game that already has all that content in it? Not just the procedural map generated from a seed, but one including all the buildings, NPCs, quests, etc. I tried searching for this every way I could think of, but it's kind of an awkward thing to search (thinking of the right keywords, that is).
Thanks!
- DrFrankenstone
- Member
- Posts: 231
- Joined: Tue May 24, 2016 05:36
- GitHub: treer
- Location: Australia
- Contact:
Re: Post your mapgen questions here (modding or engine)
if they create a new game then copy your map.sqlite file from your /worlds/<worldname> directory into their /worlds/<newworldname> directory then they'll have all that content, but the new game will have to use the mods the original game used or there'll be a bunch of unknown nodes in the world.
- DrFrankenstone
- Member
- Posts: 231
- Joined: Tue May 24, 2016 05:36
- GitHub: treer
- Location: Australia
- Contact:
Re: Post your mapgen questions here (modding or engine)
Is there a perlin noise sandbox / tuner anywhere?
Something that isn't too dumbed down, so you could fiddle with offset/scale/spread/ocataves/persistance/lacunarity/flags and then plug the values into Minetest?
Or play with simple operations on the result, like clipping range, abs, etc.
I think Numberflow could be beaten and twisted into purpose for 2D, but it's a tool that runs in Unity, so installing and learning it feels like a rather extreme length to go to for a sandbox that could be an HTML5 page with some input fields and sliders.
Something that isn't too dumbed down, so you could fiddle with offset/scale/spread/ocataves/persistance/lacunarity/flags and then plug the values into Minetest?
Or play with simple operations on the result, like clipping range, abs, etc.
I think Numberflow could be beaten and twisted into purpose for 2D, but it's a tool that runs in Unity, so installing and learning it feels like a rather extreme length to go to for a sandbox that could be an HTML5 page with some input fields and sliders.
- sirrobzeroone
- Member
- Posts: 593
- Joined: Mon Jul 16, 2018 07:56
- GitHub: sirrobzeroone
- Contact:
Re: Post your mapgen questions here (modding or engine)
Something like this but customized to be more minetest specific?
https://codepen.io/jhnsnc/pen/KNyOqV
https://codepen.io/jhnsnc/pen/KNyOqV
- DrFrankenstone
- Member
- Posts: 231
- Joined: Tue May 24, 2016 05:36
- GitHub: treer
- Location: Australia
- Contact:
Re: Post your mapgen questions here (modding or engine)
Yes. If it was taking the same noise params as Minetest's perlin implementation, then the live scripting aspect of codepen.io would even let you experiment with different operations on the noise.sirrobzeroone wrote: ↑Fri Jul 03, 2020 07:09Something like this but customized to be more minetest specific?
https://codepen.io/jhnsnc/pen/KNyOqV
Re: Post your mapgen questions here (modding or engine)
Is it possible to make nodes generate in the mapgen based on xz coordinates? I'm looking to create a mapgen that has better ores, new trees, etc the further out the player explores from spawn. All ideas/workarounds are appreciated.
- Skamiz Kazzarch
- Member
- Posts: 619
- Joined: Fri Mar 09, 2018 20:34
- GitHub: Skamiz
- In-game: Skamiz
- Location: la lojbaugag.
Re: Post your mapgen questions here (modding or engine)
You can make the mapgen do just about anything if you are willing to do a bit more coding then just changing the parameters of the builtin mapgens or registering ores/decorations/biomes.
This thread is a good starting point:
viewtopic.php?f=18&t=19836
This thread is a good starting point:
viewtopic.php?f=18&t=19836
- DrFrankenstone
- Member
- Posts: 231
- Joined: Tue May 24, 2016 05:36
- GitHub: treer
- Location: Australia
- Contact:
Re: Post your mapgen questions here (modding or engine)
That was close enough it inspired me to copy and make the Minetest 2D-Perlin tuning tool I was after. Cheers.sirrobzeroone wrote: ↑Fri Jul 03, 2020 07:09Something like this but customized to be more minetest specific?
https://codepen.io/jhnsnc/pen/KNyOqV
https://codepen.io/treer/pen/gOPZyov?editors=001
Screenshot:
Still WIP, it uses Minetest's 2D noise parameters, and any value below minDisplayedNoiseValue is shown blue, anything above maxDisplayedNoiseValue is cyan, and values within the range are greyscale.
- Attachments
-
- screenshot2-half-or8.png (96.32 KiB) Viewed 2701 times
Last edited by DrFrankenstone on Wed Jul 29, 2020 22:47, edited 6 times in total.
Re: Post your mapgen questions here (modding or engine)
I have another question. Are there any good ways of handling an expanding world border? It can be an actual wall, limiting chunk generation, or any other method. The key though is that it needs to be able to handle expanding while the player plays the game and not be laggy while expanding.
Also I was able to find an example that showed me what I needed to know about making small changes to generated chunks. I changed it a bit as a proof of concept. It changes all dirt with grass to stone outside of a 100 block radius from 0,0. That answers my previous question.
Also I was able to find an example that showed me what I needed to know about making small changes to generated chunks. I changed it a bit as a proof of concept. It changes all dirt with grass to stone outside of a 100 block radius from 0,0. That answers my previous question.
Spoiler
Code: Select all
minetest.register_on_generated(
function(minp, maxp)
if minp.x < 100 and minp.x > -100 or minp.z < 100 and minp.z > -100 then
return
end
for x = minp.x,maxp.x do
for y = minp.y,maxp.y do
for z = minp.z,maxp.z do
pos = {x=x, y=y, z=z}
if minetest.env:get_node(pos).name == "default:dirt_with_grass" then
minetest.env:add_node(pos, {name="default:stone"})
end
end
end
end
end
)
- Miniontoby
- Member
- Posts: 616
- Joined: Fri Mar 01, 2019 19:25
- GitHub: Miniontoby
- IRC: Miniontoby
- In-game: Miniontoby
- Location: The Netherlands
Re: Post your mapgen questions here (modding or engine)
Please help by helping at viewtopic.php?f=47&t=25141
Re: Post your mapgen questions here (modding or engine)
I think Minetest needs more variety in its caves. Any plans for that?
[BitChute: https://www.bitchute.com/channel/fCcBQxrYQjNX/] [Rumble: https://rumble.com/user/HPoorHMagentaHChildH]
- 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)
That is technically a 'mapgen question', but is unsuitable for this topic.
You can find out for yourself by searching GitHub issues by filtering using the 'mapgen' label.
You can find out for yourself by searching GitHub issues by filtering using the 'mapgen' label.
Re: Post your mapgen questions here (modding or engine)
Is it possible to add decos to caverns? How?
- 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)
Yes, that was a feature i added a while ago.
See https://github.com/minetest/minetest/bl ... .txt#L7713
Those flags can be used add decorations to floor and ceiling surfaces in caves and dungeons.
See https://github.com/minetest/minetest/bl ... .txt#L7713
Those flags can be used add decorations to floor and ceiling surfaces in caves and dungeons.
Re: Post your mapgen questions here (modding or engine)
Oh, thanks, underworldz at sight :-Dparamat wrote: ↑Thu Jul 30, 2020 00:03Yes, that was a feature i added a while ago.
See https://github.com/minetest/minetest/bl ... .txt#L7713
Those flags can be used add decorations to floor and ceiling surfaces in caves and dungeons.
Re: Post your mapgen questions here (modding or engine)
paramat, you responded that.> If you want a world with only one biome I think you'd need to change the code in minetest_game/mods/default/mapgen.lua and comment out all the biome registrations other than the jungle
^ That. But make sure to keep all the 'Rainforest' biomes, there is a vertical stack of 4. Nothing else needs doing.
The fact is that I I want to remove all the _under biomes, to be replaced by only one. Is it possible?
To clarify I want all the MTG biomes in the surface (horizontally distributed) and 1 or more underground biomes below them (vertically distributed).
I mean a unique biome with y_min and y_max (no another biome defined in between those values), would have to be spreaded horizontally without no limit and ignoring the heat and humidity.
Thankz in advance :-)
- 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)
runs, yes that is possible.
Biomes are only distributed horizontally by heat/humidity where they share y values with other biomes.
If a particular y value contains only 1 biome, that biome will be horizontally everywhere for that y value.
So:
* Give all horizontally distributed surface biomes the same y_min value, for example y_min -255.
* Add underground biomes stacked in y, for example:
"under" y_max -256 y_min -511
"deep" y_max -512 y_min -1023
"deeper" y_max -1024 y_min -2047
etc.
Because these underground biomes do not share y values, horizontal distribution by heat/humidity does not occur, so the 'heat/humidity point' values could be anything, but, it is good practice to give them the middle value 50 to suggest they are 'horizontally everywhere'.
Biomes are only distributed horizontally by heat/humidity where they share y values with other biomes.
If a particular y value contains only 1 biome, that biome will be horizontally everywhere for that y value.
So:
* Give all horizontally distributed surface biomes the same y_min value, for example y_min -255.
* Add underground biomes stacked in y, for example:
"under" y_max -256 y_min -511
"deep" y_max -512 y_min -1023
"deeper" y_max -1024 y_min -2047
etc.
Because these underground biomes do not share y values, horizontal distribution by heat/humidity does not occur, so the 'heat/humidity point' values could be anything, but, it is good practice to give them the middle value 50 to suggest they are 'horizontally everywhere'.
Re: Post your mapgen questions here (modding or engine)
I've played worlds created by the v6 mapgen, v7, flat, and carpathian. I have tended to prefer the carpathian maps, because they seem to be the closest to real-life terrain of the four mapgens. It's also the only mapgen—flat excluded, of course—that has not at least once spawned floating landmasses (too unrealistic; ruins the immersion for me).
In the wiki, it says that carpathian maps feature "vast plains," and, "complex, realistic mountain ranges." I've started at least a dozen carpathian worlds, and what I found from all of them was...
Is my problem that I'm just very, very unlucky with my seeds? Maybe I'm thinking about these mapgens the wrong way. What I'm looking for in a world is vast spans of relatively flat plains, immense oceans that dominate the map, actual (i.e., semi-linear) ranges of mountains like the Rockies, Andes, or Alps, large biomes whose placement make sense (i.e., no tundra biome adjacent to a hot biome). Basically, as true to real terrain as possible.
Can I add or tweak any settings in the minetest.conf file to accomplish this? The wiki mentions settings only for v6 and v7.
In the wiki, it says that carpathian maps feature "vast plains," and, "complex, realistic mountain ranges." I've started at least a dozen carpathian worlds, and what I found from all of them was...
- No vast plains. The largest plain I've found so far was about 100x100.
- No "ranges" of mountains. The mountains seem to be distributed at random, and hills are very steep and jagged (not rolling).
- No oceans; just lakes. I haven't found a body of water large enough that I cannot see any shore from the middle (visibility=100).
- Biomes are very small and are strangely placed. For example, no progression from hot to cold biomes. Snow can be right next to a jungle or between two desert biomes. See maps below.
Is my problem that I'm just very, very unlucky with my seeds? Maybe I'm thinking about these mapgens the wrong way. What I'm looking for in a world is vast spans of relatively flat plains, immense oceans that dominate the map, actual (i.e., semi-linear) ranges of mountains like the Rockies, Andes, or Alps, large biomes whose placement make sense (i.e., no tundra biome adjacent to a hot biome). Basically, as true to real terrain as possible.
Can I add or tweak any settings in the minetest.conf file to accomplish this? The wiki mentions settings only for v6 and v7.
Spoiler
Who is online
Users browsing this forum: Andrey01 and 8 guests