How do I offset the mapgen Y level?

Post Reply
0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

How do I offset the mapgen Y level?

by 0siribix » Post

So I found a seed that I like. I know how to set water level to 30k. But how do I move the ground level to +30k?

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: How do I offset the mapgen Y level?

by Gael de Sailly » Post

This has to be changed in noise parameters.
You need to increase the offset of some of them by 30k, there may be several ones to change, depending on the mapgen you are using.

I've looked a bit for the case of mapgen v7, you need to offset mgv7_np_terrain_base and mgv7_np_terrain_alt by 30k, and also set mgv7_mount_zero_level = 30000.

This gives in minetest.conf:

Code: Select all

mgv7_np_terrain_base = {
	flags = eased
	lacunarity = 2
	persistence = 0.6
	seed = 82341
	spread = (600,600,600)
	scale = 70
	octaves = 5
	offset = 30004
}
mgv7_np_terrain_alt = {
	flags = eased
	lacunarity = 2
	persistence = 0.6
	seed = 5934
	spread = (600,600,600)
	scale = 25
	octaves = 5
	offset = 30004
}
mgv7_mount_zero_level = 30000
water_level = 30001
You may have troubles with biomes (e.g. trees underwater), if you want to fix this you need to change that in the code (assuming you use Minetest Game): find the folder of the default mod, open mapgen.lua, and offset y_min and y_max parameters every time they occur (except when they are already 31k).
Just realize how bored we would be if the world was perfect.

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: How do I offset the mapgen Y level?

by 0siribix » Post

TYVM. I saw those offsets but I thought maybe they could be anything like x, z, or whatever. I am aware that I'll have to modify LOTS of y values like decorations, cloudlands, ethereal etc. This will at least get me started ^_^

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: How do I offset the mapgen Y level?

by 0siribix » Post

So I've played around with this some and diamond and other ore are generating on the ground and mountains. I haven't been able to find anything in the lua code that would cause it to spawn that high (+30000~ish). Any ideas?

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: How do I offset the mapgen Y level?

by Gael de Sailly » Post

0siribix wrote:
Wed May 26, 2021 00:52
So I've played around with this some and diamond and other ore are generating on the ground and mountains. I haven't been able to find anything in the lua code that would cause it to spawn that high (+30000~ish). Any ideas?
I found some code in Minetest Game that seems to spawn diamond from +1025 to +31000. Don't ask me why.
https://github.com/minetest/minetest_ga ... #L817-L826

There is similar stuff for many other minerals too, it looks that MTG registers ores symmetrically.
Just realize how bored we would be if the world was perfect.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: How do I offset the mapgen Y level?

by ShadMOrdre » Post

I think this was to accommodate floatlands in mg_v7.

The code is in the default mod of MTG, in the mapgen.lua file. Line 385 for mg_v6 ores and line 817 for all other mapgens.

Shad

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: How do I offset the mapgen Y level?

by 0siribix » Post

Thank you guys very much. That should fix my issue

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: How do I offset the mapgen Y level?

by 0siribix » Post

So I'm revisiting this and it seems like when I move these up that the noise changes. I thought that when I tried this last year that the landscape was exactly the same except translated up 30000 blocks. Is there something I'm missing or did something maybe change since then?

I supposed to could post some screenshots to explain?

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: How do I offset the mapgen Y level?

by Gael de Sailly » Post

0siribix wrote:
Tue Sep 21, 2021 01:28
So I'm revisiting this and it seems like when I move these up that the noise changes. I thought that when I tried this last year that the landscape was exactly the same except translated up 30000 blocks. Is there something I'm missing or did something maybe change since then?

I supposed to could post some screenshots to explain?
I see what you mean and I think it's due to 3d noises. Their principle is that their value depends on the vertical axis (contrary to 2d noises), so everything using 3d noises will be generated differently if situated on a different elevation. It is currently not possible to offset a noise in space (what you actually did by increasing the offset parameter was offsetting 2d noises in value).

On v7, plains, plateaus and mesas use exclusively 2d noises so they should be identical. Mountains and river sides use 3d and can be different but their "statistical" behaviour should remain the same with appropriate parameters. I think it's the best we can achieve.
Just realize how bored we would be if the world was perfect.

0siribix
Member
Posts: 123
Joined: Tue Nov 17, 2020 20:54
GitHub: 0siribix
In-game: 0siribix

Re: How do I offset the mapgen Y level?

by 0siribix » Post

That makes perfect sense. TY for the explanation

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests