Page 1 of 5

[Mod] Tectonic Map Generator 0.3.2 [mg_tectonic]

Posted: Sun May 06, 2018 03:25
by Dokimi
A naturalistic mapgen, based around mimicking the landscape of a tectonic plate boundary.


Image



This mapgen aims to create a world which is scientifically informed, but within the minimalist bounds of default Minetest.

It generates a landmass bounded by oceans, with a mountains running North-South down the middle. The land, and its hills and valleys rise from softer terrain on the coasts to towering mountains in the centre. A rainshadow leaves the East dry, and the West wet. Hot weather prevails in the North, cold in the South.

Rocks, sediments, and soils are arranged in strata. Ores occur in concentrated deposits. Deep fissures run along the fault lines, go down deep enough and they fill with magma.

Image
Image: this is a rough cross section of the map. Whichever line is on top is the one that gets placed at that height, if it is higher than underlying layers (i.e. hard rock excludes soft in the middle, soft overlays hard at the edge).


License
Code is licensed under GNU LGPLv2+.


Mod dependencies
default
flowers
farming
beds?





View code on Github:
https://github.com/DokimiCU/mg_tectonic


DOWNLOAD




Image

FAQ:
1) What map generator do I choose?
Short answer: singlenode.
Long answer: This is an Lua singlenode mapgen. As long as you've activated the mod it should work. But choose singlenode to be safe.

2) Why am I starting in the sky?
Short answer: because the spawn code sucks. Wait.
Long answer: It needs to start higher than the highest mountain. It will take a few seconds to a few minutes. It will only do this once. You will respawn at that location until it is overwritten by using a bed.

3) Why is the whole map mountain/desert/ice/grassland/...?
Short answer: it is not.
Long answer: The whole point of this map is that geography matters. Be prepared to go on epic voyages of discovery. Be prepared for very different experiences depending on where you start (Survival mode can range from very easy to Ahhhh-I'm-in-death-valley-how-do-I-escape!).

4) Will [Biome mod XXXX] work with this map? e.g Ethereal, Aotearoa, Australia...
Short answer: No.
Long answer: Anything that requires registered biomes to function will not work. You'll get the content in creative mode at best. This is because this map has a radically different underlying design.
Standard Mintest maps aim to get as much cool stuff in a small area. To do this they have registered Biomes that get applied in a patchwork across the map according to Temperature & Humidity noise.
Mg_tectonic aims to create a natural looking landscape. It's big challenge is to squeeze as much small scale variation as possible out of huge landscape features. To do that it varies all factors (plants, soils, rocks) independently to create infinite continuously changing "biomes". These factors are controlled by Temperature & Humidity & Disturbance & position in the world etc etc....

5) Why is it so slow?
a) It's in Lua. b) it's a complicated map c) I'm an amateur :-)
(edit August 2023: it might be better now than it was, thanks to Skamiz)

6) Future development? Is this map stable?
Short answer: I don't know.
Long answer: Being an amateur I'm at my limits with this. I can't do much beyond aesthetic improvements, and most of that is now finished. To that extent, it is more stable than it was. If I find anything game-breakingly bad I might fix it, if it annoys me personally. Improvements to the core code will require a non-amateur to take this project on.

7) Will this ever become one of the core mapgens?
Short answer: ask the developers.
Long answer: See 4). This is the biggest barrier to that being feasible. Either mg_tectonic would have to be redesigned (and likely broken in the process), or the core Minetest would need to be open to supporting maps of this kind. Either way I think mg_tectonic has shown that Minetest has an open niche for a highly realistic map.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 04:00
by Dokimi
A few thoughts/extra details for those who are interested....

How does this work?:

This is the results of the underlying equation which creates the base layer of mountain rock. It's a modified sine wave.
Image
This (plus noise, plus layers of soft rock, sediment etc) is a cross section of the land from the centre to the egdes (I can't remember if this graph shows the exact parameters I used, but it's close). As you can see it goes from steep mountains, to plains, then oceans.


Game play:

This map is set up very different than the default maps. I suspect it lies at the extremes of certain preferences. Some people will hate it... others will love it.

The map has three major differences from default: ores, scale, and predictability.

- Ore: Mining is a much more realistic boom-bust, gold-fever affair. Almost all minerals are in rare, large, concentrated deposits (versus default which scatters them everywhere). This has a huge impact on gameplay, dividing it into three (often long) stages:
1. prospecting: you have to find the damn things. This can be easy... or extremely hard, depending on luck and the mineral. It encourages exploration rather than simply digging a super-deep hole.
2. Extraction. Deposits can contain hundreds of units of ore. Now you need to build an actual mine to get that stuff out, process it, link the mine with other key sites etc.
3. Use. You will now have so much ore you can forget about mining... build houses from gold, pave the streets with diamonds... until you deplete the resource and the cycle begins again.

- Scale: This map aims for realism, therefore the landscape changes over massive distances. The transitions are continuous meaning each location is subtly unique. However, if you want to see something wildly different you will need to go on an epic journey. Teleporters/high speed transport recommended.

- Predictability: the map uses a few strictly defined features (like the equation above, the climate etc), rather than noise alone. The map is much less random than default. You can guess where certain features ought to be, and even navigate by reading the landscape. This makes is more like open world games with a designed map. You lose a little surprise, but gain a much more real sense of place.

Future development:
As far as I know... this only a few minor issues remaining that I don't know how to fix, and don't much matter (some are almost features!). The only serious issue is rare out of memory crashes. Other than that it is complete. I don't plan any new features.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 04:09
by Dokimi
A few more screenshots...

The Eastern mountains
Image

The lowlands
Image

The coast and islands
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 04:14
by Dokimi
The Eastern mountains
Image

Western montane forest
Image

An Eastern lowland lagoon
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 06:39
by Devy
I really like it! I love terrain mods but I wish they could be faster if implemented in LUA. When walking around with this mod everything generates very slowly. Still, I love the terrain it generates!

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 09:00
by voxelproof
@Dokimi

Man, it looks great. I was playing around with modifications of mapgen v5 viewtopic.php?p=309179#p309179 and some results where truly surprising:

Image

It probably wouldn't be of much use for you since you've worked out another algorithm, but maybe some of my "discoveries" would be helpful or inspiring in your future mapgens. One especially nice feature of your mg are real rivers (current mgs in Minetest don't feature rivers, only roller coaster streams ;) ).

Good work, maybe it should be added to the MT official mapgens...

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 12:02
by hajo
Devy wrote:When walking around with this mod everything generates very slowly.
Maybe it would help to pre-emerge some terrain around each player
when the server is mostly idle ?

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Sun May 06, 2018 21:47
by Mjollna
Hi !

I've traveled a little bit on a new world using your mod, and I love the look and feel of the landscapes. I especially like the slopes, there are huuuge mountains that can still be climbed without a too much cliff-like edge. I'll definitely have to try playing in a survival way and build there !

Great work ! :)

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Mon May 07, 2018 01:16
by TumeniNodes
Well, this looks interesting.
definitely going to check it out soon

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Mon May 07, 2018 07:49
by texmex
This looks massive, need to try out asap.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Mon May 07, 2018 23:05
by Dokimi
I was playing around with modifications of mapgen v5...
I don't really understand mgv5, but I might have had a similar thing going earlier in development. Interesting to see it looks nice when in a finished state.

mg_tectonic has lots of room for minor fiddling and experimenting so...

If you want to try and bring that effect back you would change the following in the init. file

Code: Select all

local den_base = (xwav ^ 3) + mup + ((n_terr ^2) * whs)
to

Code: Select all

local den_base = (xwav ^ 3) + mup + ((n_terr) * whs)
(same deal for the soft rock)

The squaring damps out those rolling hills in favor of the extreme peaks. (haven't tried this change though... not sure what it'll do!)

If anyone does do any fiddling and get's a better result, please let us know!

One especially nice feature of your mg are real rivers...
This is the advantage of having some more strictly defined features. It seems a good approach for getting realism over relying on pure noise. The downside though... It only has six rivers (two from the central lake, 4 more at 15000 north/south draining lakes at 5000 east/west.).
Good work, maybe it should be added to the MT official mapgens...
I'm guessing that would be one way to get it out of LUA and fix the load times...?! ;-)


Have fun with it everyone. This was quite a mission to make... so time to take a break from modding for a while!

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Tue May 08, 2018 21:28
by Gael de Sailly
I'm very interested in this mod too. I checked it out immediately and looked a bit into the code. Great work!

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 01:02
by csirolli
I created a world to test this out in (using MTE 0.4.17) and got this error:

Code: Select all

2018-06-06 20:47:34: ERROR[Main]: In thread b617b980:
2018-06-06 20:47:34: ERROR[Main]: /build/minetest-o89QbF/minetest-0.4.17/src/script/common/c_internal.cpp:b8: void log_deprecated(lua_State*, const string&): A fatal error occured: lua_getstack() failed
2018-06-06 20:47:34: ERROR[Main]: Debug stacks:
2018-06-06 20:47:34: ERROR[Main]: DEBUG STACK FOR THREAD b617b980: 
2018-06-06 20:47:34: ERROR[Main]: #0  int main(int, char**)
I can't enter the world because of it. In fact, the program closes on me. Any idea why? The world is using the v7 mapgen. Is this mod for 0.5.*? But it seems to work fine in 0.5.0.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 02:42
by Dokimi
csirolli wrote:I created a world to test this out in (using MTE 0.4.17) and got this error:
`2018-06-06 20:47:34: ERROR[Main]: In thread b617b980:`
`2018-06-06 20:47:34: ERROR[Main]: /build/minetest-o89QbF/minetest-0.4.17/src/script/common/c_internal.cpp:b8: void log_deprecated(lua_State*, const string&): A fatal error occured: lua_getstack() failed`
`2018-06-06 20:47:34: ERROR[Main]: Debug stacks:`
`2018-06-06 20:47:34: ERROR[Main]: DEBUG STACK FOR THREAD b617b980: `
`2018-06-06 20:47:34: ERROR[Main]: #0 int main(int, char**)`
I can't enter the world because of it. In fact, the program closes on me. Any idea why? The world is using the v7 mapgen. Is this mod for 0.5.*? But it seems to work fine in 0.5.0.

I developped this in 0.4.16. I haven't tried either of the Minetest development versions. I can't see this error message pointing to something within mg_tectonic's code per se... so considering it works in 0.5 (that's nice to know!)... maybe its an issue with 0.4.17 Minetest??? I have no idea!

(also... it sets up a singlenode mapgen, I think it should over-ride whatever default mapgen you've set. That shouldn't be the issue.)

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 06:07
by csirolli
It works in 0.5.0 but is slow in generating everything. At least it doesn't affect the fps. Something in your mod triggers that error, cause a world without it is fine in 0.4.17. It is definitely something worth looking into.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 06:19
by Dokimi
csirolli wrote:It works in 0.5.0 but is slow in generating everything. At least it doesn't affect the fps. Something in your mod triggers that error, cause a world without it is fine in 0.4.17. It is definitely something worth looking into.
Sadly it is slow in everything!

I have probably used some deprecated method that makes 0.4.17 spit it out. But if 0.5 is okay with it??? I have no idea what part of it is causing the issue (that's what I mean by it not pointing to some specific line of mg_tectonics code that I could fix).

If 0.5 keeps being okay with it I may just have to skip making it work for 0.4.17. Unless someone can point out where the issue lies?

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 06:28
by Dokimi
Updated to 0.1.1!

This update will cause discontinuities on old maps! (you might be okay if you haven't explored beyond 5000 from the map centre... maybe)

My main goal with this update was to fix two issues:
- a lack of inland water
- vast boring midrange areas.

I have done this by making some minor (but dramatic) tweaks to the ocean forming mechanism. Basically it can take chunks out of the land deeper inland (plus the sea bed got tweaked).

The result:

Moving out from the centre..., first we have plateaus and lowlands. Then the lowlands become swamps/dunelands... then lakes... then the coast. The balance between land and now water reverses. We have complex peninsulas and bays... then we have large islands... then tiny atolls right out to the map edge.

Lowlands surrounded by highlands
Image

Swamps and shallow lakes
Image

Deep coastal lake
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 06:33
by Dokimi
Complex coastline (or maybe a very big island)
Image

Islands near the map edge
Image

And... I haven't shown much of the caves and ores before so... this is the magma layer (-15000) and a massive ore deposit!
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 07:40
by Krock
I love this mapgen due to its variety in used materials. Colors are everywhere and the landscape smoothly transitions into new set of terrain nodes. However, I find it a bit strange to always start on the same island. It varies a bit with changed seeds but a continuous landscape like other map generators have, would be nice to have here aswell.

By the way, I found some mese. (Y = -400m)
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 10:53
by Dokimi
Krock wrote:... However, I find it a bit strange to always start on the same island. It varies a bit with changed seeds but a continuous landscape like other map generators have, would be nice to have here aswell.
Hmmm... yes... the island!

Basically that is the result of me getting frustrated and going, "#$^& it! You can start on an island!"

Default spawning puts you underground (being mountains after all). I've seen various ways of overcoming this properly but couldn't figure them out. Then I gave up and dumped you in the ocean... except sometimes you died. Then I made a tunnel... but sometimes you fell down a crevasse and died... then I made the lake and an island that would always be the same damn height! A non-death solution!

Like I've said above, this map is more predictable than normal - I can't change that without breaking the fundamentals of it. But the island and the rivers are the most crudely predictable part of all.

They exist to add some water features, provide access through the mountains, and ... the spawning problem!

They could be removed? Perhaps some way could be found to achieve the same result more randomly? Personally I like having something fulfill their role, even if they aren't the best solution.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 11:32
by csirolli
It looks like that error message was created by this: https://github.com/minetest/minetest/bl ... l.cpp#L157
I am still not sure what exactly was the reason for it being triggered.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Thu Jun 07, 2018 11:52
by Krock
csirolli wrote:It looks like that error message was created by this: <snip>
This bug was already reported: https://github.com/minetest/minetest/issues/7419
To fix it, open mg_tectonic/init.lua and change the following:

Code: Select all

-- Old line:
minetest.set_mapgen_params({mgname = "singlenode", flags = "nolight"})
-- Replace with:
minetest.set_mapgen_setting("mgname", "singlenode", true)
minetest.set_mapgen_setting("flags", "nolight", true)
Dokimi wrote:Default spawning puts you underground (being mountains after all). I've seen various ways of overcoming this properly but couldn't figure them out.
There were some changes in this code recently, but AFAIK only contained in 0.5.0-dev. You can still register a `on_joinplayer` and `on_respawnplayer` callback to search a fitting location and move the player there.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Fri Jun 08, 2018 01:26
by Dokimi
This fix has been merged. I hadn't realized 0.4.17 had been released. Both fixed and unfixed seemed to work fine (I notice it has legacy support, so doesn't actually crash unless you turn that off). However this fix kills it for 0.4.16. Turns the map to garbage. I have added a warning in the main post.

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Fri Jun 08, 2018 01:45
by Dokimi
Seeing as people always like to make suggestions for changes/new features here is my own wishlist for mg_tectonic (remembering that realism is the guiding principle for this map):

- a random starting position (so you see more of the map in each play through)
- randomly generated rivers, glaciers, and highland lakes (rather than the current hardcoded ones)
- a proper rainshadow effect based on the presence of mountains (rather than the current East vs West thing)
- volcanoes and magma chambers.
- underground rivers and aquifers.
- ruins
- forest clearings, and forest clumps
- coral reefs/atolls
- a handful of realistically big mountains (>1000 m high. Current max is ~300m ... which is really just a very big hill (or a bloody huge cliff!))

Sadly... none of these have easy solutions. The code is already complicated enough (not to mention slow)... so I've no plans to even begin figuring this stuff out, let alone adding it.

I am happy enough with mg_tectonic as it is for now. Especially considering it started out as this:
Image

Re: [Mod] Tectonic Map Generator [mg_tectonic]

Posted: Fri Jun 08, 2018 02:09
by Dokimi
Some more thoughts on gameplay:

When making this, realism was my focus - gameplay came a distant second. So I've found it interesting to see it emerge it's own unique style of gameplay.

Mg_tectonic encourages, even demands a style that can only be described as "epic". ...One does not simply walk to the sea-shore!

"Epic" gameplay goals seem to emerge naturally out of mg_tectonic:

- Find deposits for all the ores (not easy!)
- Find all the flowers/wood types (you have to find the right climate zone...)
- Visit all the major regions of the world (and link them with a highspeed travel network)
- Find and scale the world's highest peak,
- Make it down to the magma layer
- circumnavigate the world (the whole map is an island...)

I also find it naturally encourages better building. Every location has masses of different building materials. You are forced to find uses for all the dozen materials clogging your inventory. Likewise with ores - you need to find some use for those 1000000 gold ingots you just found. Once you escape the mountains there are plenty of city sized building sites too...

So there you have it.

mg_tectonic = epic!

Image