Post your mapgen questions here (modding or engine)

Skamiz Kazzarch
Member
Posts: 176
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Post your mapgen questions here (modding or engine)

by Skamiz Kazzarch » Post

Just to make sure, but are you calling 'minetest.generate_decorations()' as described here:
https://github.com/minetest/minetest/bl ... .txt#L4789

User avatar
acidzebra
Member
Posts: 75
Joined: Sun Sep 10, 2017 09:11

Re: Post your mapgen questions here (modding or engine)

by acidzebra » Post

Skamiz Kazzarch wrote:
Wed May 06, 2020 14:03
Just to make sure, but are you calling 'minetest.generate_decorations()' as described here:
https://github.com/minetest/minetest/bl ... .txt#L4789
And just like that, you hand me the answer I didn't know existed, thanks :)

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)
took me a few iterations but so easy.

User avatar
sirrobzeroone
Member
Posts: 204
Joined: Mon Jul 16, 2018 07:56

Re: Post your mapgen questions here (modding or engine)

by sirrobzeroone » Post

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

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	
}
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.

Skamiz Kazzarch
Member
Posts: 176
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Post your mapgen questions here (modding or engine)

by Skamiz Kazzarch » Post

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:
persist (does this = Lacunarity)
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.
I run a simple multiplication and addition over the range
You can let minetest do this for you by setting the scale and offset values.
From the documentation:

Code: Select all

final noise = offset + (scale * noise value)
Which would look in practice like this:

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	
}
for an output of -20 to 50

User avatar
sirrobzeroone
Member
Posts: 204
Joined: Mon Jul 16, 2018 07:56

Re: Post your mapgen questions here (modding or engine)

by sirrobzeroone » Post

Skamiz Kazzarch wrote:
Tue Jun 02, 2020 09:17
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.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

Kurtzmusch wrote:
Mon May 04, 2020 18:23
is it possible to obtain a vmanip of an area that hasnt been emerged or generated yet?
No, because it has not been generated yet, so there is no way to know what it will be.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

Skamiz Kazzarch wrote:
Tue Jun 02, 2020 09:17
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.
Correct.

Even noise with 1 octave does not generate output equally spread between -1 and 1, it is also slightly biased towards the middle values.

User avatar
BlockStar
Member
Posts: 23
Joined: Thu Jun 11, 2020 22:14
Location: The Dirty South

Re: Post your mapgen questions here (modding or engine)

by BlockStar » Post

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!

User avatar
DrFrankenstone
Member
Posts: 174
Joined: Tue May 24, 2016 05:36
GitHub: treer
Location: Melbourne, Australia
Contact:

Re: Post your mapgen questions here (modding or engine)

by DrFrankenstone » Post

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.

User avatar
DrFrankenstone
Member
Posts: 174
Joined: Tue May 24, 2016 05:36
GitHub: treer
Location: Melbourne, Australia
Contact:

Re: Post your mapgen questions here (modding or engine)

by DrFrankenstone » Post

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.

User avatar
sirrobzeroone
Member
Posts: 204
Joined: Mon Jul 16, 2018 07:56

Re: Post your mapgen questions here (modding or engine)

by sirrobzeroone » Post

Something like this but customized to be more minetest specific?

https://codepen.io/jhnsnc/pen/KNyOqV

User avatar
DrFrankenstone
Member
Posts: 174
Joined: Tue May 24, 2016 05:36
GitHub: treer
Location: Melbourne, Australia
Contact:

Re: Post your mapgen questions here (modding or engine)

by DrFrankenstone » Post

sirrobzeroone wrote:
Fri Jul 03, 2020 07:09
Something like this but customized to be more minetest specific?

https://codepen.io/jhnsnc/pen/KNyOqV
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.

isaiah658
Member
Posts: 51
Joined: Sun Jan 24, 2016 14:58

Re: Post your mapgen questions here (modding or engine)

by isaiah658 » Post

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: 176
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Post your mapgen questions here (modding or engine)

by Skamiz Kazzarch » Post

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

User avatar
DrFrankenstone
Member
Posts: 174
Joined: Tue May 24, 2016 05:36
GitHub: treer
Location: Melbourne, Australia
Contact:

Re: Post your mapgen questions here (modding or engine)

by DrFrankenstone » Post

sirrobzeroone wrote:
Fri Jul 03, 2020 07:09
Something like this but customized to be more minetest specific?

https://codepen.io/jhnsnc/pen/KNyOqV
That was close enough it inspired me to copy and make the Minetest 2D-Perlin tuning tool I was after. Cheers.

https://codepen.io/treer/pen/gOPZyov?editors=001

Screenshot:
Image

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) Not downloaded yet
Last edited by DrFrankenstone on Wed Jul 29, 2020 22:47, edited 6 times in total.

isaiah658
Member
Posts: 51
Joined: Sun Jan 24, 2016 14:58

Re: Post your mapgen questions here (modding or engine)

by isaiah658 » Post

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.
+ Spoiler

User avatar
Miniontoby
Member
Posts: 438
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: Post your mapgen questions here (modding or engine)

by Miniontoby » Post

Please help by helping at viewtopic.php?f=47&t=25141
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
Inocudom
Member
Posts: 3096
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: Post your mapgen questions here (modding or engine)

by Inocudom » Post

I think Minetest needs more variety in its caves. Any plans for that?
You can now find my videos at BitChute: https://www.bitchute.com/channel/some_cheeky_jinuskian/

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

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.

User avatar
runs
Member
Posts: 1891
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Post your mapgen questions here (modding or engine)

by runs » Post

Is it possible to add decos to caverns? How?
Day 42 of the quarantine

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

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.

User avatar
runs
Member
Posts: 1891
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Post your mapgen questions here (modding or engine)

by runs » Post

paramat wrote:
Thu Jul 30, 2020 00:03
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.
Oh, thanks, underworldz at sight :-D
Day 42 of the quarantine

User avatar
runs
Member
Posts: 1891
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Post your mapgen questions here (modding or engine)

by runs » Post

> 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.
paramat, you responded that.

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 :-)
Day 42 of the quarantine

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your mapgen questions here (modding or engine)

by paramat » Post

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'.

User avatar
T6C
Member
Posts: 50
Joined: Thu May 07, 2020 17:11
In-game: T6C

Re: Post your mapgen questions here (modding or engine)

by T6C » Post

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...
  • 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.
I've included maps of two worlds created with minetestmapper. They're representative of the rest of the carpathian worlds I've started.

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.

Image
Image
+ Spoiler

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests