How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

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

How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by paramat » Post

Some users like aspects of Mapgen V6, but the biomes are hardcoded so it lacks many of the biomes defined in games such as MTGame. It is also very different from the other mapgens in how it works and is more difficult to support in games.

I have often considered adding a new mapgen to MT that would be a modernised version of Mapgen V6 that is as similar as possible but functions like the other mapgens and has all the biomes registered by games.

However, it is actually possible to approximately emulate Mapgen V6 in Mapgen V7 using customised settings.
This is only possible in MT 5.2.0 or later due to the 'randomwalk' caves now being more configurable, allowing Mapgen V7 to have Mapgen V6 type caves.

Copy-paste the lines below into your 'minetest.conf' file before starting a new Mapgen V7 world:

////////////////////////////////

mgv7_spflags = nomountains, noridges, nofloatlands, nocaverns
mgv7_cave_width = 10
mgv7_large_cave_depth = 47
mgv7_small_cave_num_min = 24
mgv7_small_cave_num_max = 24
mgv7_large_cave_num_min = 2
mgv7_large_cave_num_max = 2
mgv7_np_terrain_base = {
offset = 21.0,
scale = 16.0,
spread = (500, 500, 500),
seed = 85039,
octaves = 5,
persistence = 0.6,
lacunarity = 2.0,
flags = eased
}
mgv7_np_terrain_alt = {
offset = -3.0,
scale = 20.0,
spread = (250, 250, 250),
seed = 82341,
octaves = 5,
persistence = 0.6,
lacunarity = 2.0,
flags = eased
}
mgv7_np_terrain_persist = {
offset = 0.6,
scale = 0.0,
spread = (2000, 2000, 2000),
seed = 539,
octaves = 1,
persistence = 0.6,
lacunarity = 2.0,
flags = eased
}
mgv7_np_height_select = {
offset = -19.5,
scale = 100.0,
spread = (250, 250, 250),
seed = 4213,
octaves = 5,
persistence = 0.69,
lacunarity = 2.0,
flags = eased
}
mgv7_np_filler_depth = {
offset = 4.0,
scale = 2.0,
spread = (200, 200, 200),
seed = 91013,
octaves = 3,
persistence = 0.55,
lacunarity = 2.0,
flags = eased
}

////////////////////////////////

Or you can set these parameters in the 'All Settings' menu if you prefer, but that will take much longer to do.

The emulation is only approximate, it differs in the following ways:
  • There is no 'mudflow' erosion
  • The cliff / slope transitions between the lowland and highland do not have a wide range of steepnesses, they are now all steep cliffs
  • The number of small and large caves per mapchunk is fixed and not varied by noise or biome
  • Using the same world seed as a Mapgen V6 world will probably not result in hills, lakes, cliffs, caves, dungeons etc. being in the same locations, even though the character and elements of the mapgen will be similar
  • When using MTGame, lava is found below y = -256 and ores are deeper, just like all non-V6 mapgens
Image
Attachments
screenshot_20200523_015727.png
screenshot_20200523_015727.png (642.68 KiB) Viewed 1029 times

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

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by ShadMOrdre » Post

paramat,

If the seed of the noise params used for generating v6 noise were used as the seed for the v7 params you've given us, would that make the v6 noise match the v7 noise.

I have used the seed from the default mgv7 terrain_alt noise params in lua mapgens, and have been given v7 like maps as a result.

I would actually appreciate a formal translation of the engine logic into lua logic, for both the mgv7 noise conglomeration and how the engine handles biomes. If these two items could easily constructed in lua mapgens, that would certainly ease the ability of developers to understand and provide other new alternative mapgens.

Shad

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

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by paramat » Post

ShadMOrdre wrote:
Fri May 29, 2020 20:50
If the seed of the noise params used for generating v6 noise were used as the seed for the v7 params you've given us, would that make the v6 noise match the v7 noise.
I doubt it (i would need to recheck to be sure).
That is one of the differences i stated above.
The reason is that Mapgen V6 perlin noise adds X, Z offsets to the noises, but all the other Mapgens (luckily) do not add offsets, so the same terrain shapes might appear but shifted a few hundred nodes.

The core mapgens can be almost completely replicated by a Lua mapgens, but not the variable persistence noise used in Mapgen V7, and maybe not some other things.
I could write Lua mapgen replicas of core mapgens, but that takes a lot of time and effort and is low priority for me.
But these are not necessary to understand how to write new mapgens, in Lua or C++, there are many Lua mapgens you can learn from.

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by Wuzzy » Post

Awesome post. This is so cool.

I have just turned this forum post into a wiki page:

https://wiki.minetest.net/How_to_emulat ... _Mapgen_v7

BTW: Do you still not have a wiki account?

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

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by paramat » Post

No account =) I cannot be bothered and do not have time, best i use my limited time on MT code, others can update the wiki.

User avatar
eyekay
Member
Posts: 67
Joined: Fri Feb 07, 2020 10:49
GitHub: Azl-Eyekay
In-game: eyekay49
Contact:

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by eyekay » Post

Is there any way to do this as a mod, rather than editing minetest.conf?
<a href=about:blank> My projects</a>

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

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by paramat » Post

Yes you can write a mod that sets mapgen settings.

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

Re: How to emulate Mapgen V6 using a customised Mapgen V7 (MT 5.2.0 or later)

by ShadMOrdre » Post

Here are both mg_v6 and mg_v7 basic mapgens. There are no caves mountains or ridges. There is a basic biome system. Depends on MTG default mod.

viewtopic.php?f=9&t=25600

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests