[Mod] Tectonic Map Generator 0.3.2 [mg_tectonic]

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

[Mod] Tectonic Map Generator 0.3.2 [mg_tectonic]

by Dokimi » Post

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.
Attachments
mgt03b.jpg
mgt03b.jpg (155.29 KiB) Viewed 4030 times
mg_tect_profile03.JPG
mg_tect_profile03.JPG (62.52 KiB) Viewed 4030 times
mgt03a.jpg
mgt03a.jpg (451.49 KiB) Viewed 4031 times
Last edited by Dokimi on Sun Aug 13, 2023 23:22, edited 9 times in total.

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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.
Attachments
Mg_tect_graph.PNG
Mg_tect_graph.PNG (23.31 KiB) Viewed 4030 times

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

A few more screenshots...

The Eastern mountains
Image

The lowlands
Image

The coast and islands
Image
Attachments
screenshot_c.png
screenshot_c.png (439.08 KiB) Viewed 4030 times
screenshot_b.png
screenshot_b.png (795.46 KiB) Viewed 4030 times
screenshot_a.png
screenshot_a.png (543.08 KiB) Viewed 4030 times

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

The Eastern mountains
Image

Western montane forest
Image

An Eastern lowland lagoon
Image
Attachments
screenshot_g.png
screenshot_g.png (410.09 KiB) Viewed 4030 times
screenshot_h.png
screenshot_h.png (1006.55 KiB) Viewed 4030 times
screenshot_e.png
screenshot_e.png (636.42 KiB) Viewed 4030 times

User avatar
Devy
Member
Posts: 133
Joined: Sat Jan 21, 2017 02:31
GitHub: DevyHeavy
In-game: devy

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Devy » Post

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!

User avatar
voxelproof
Member
Posts: 1087
Joined: Sat Aug 05, 2017 08:13
Location: Europe

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by voxelproof » Post

@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...
To miss the joy is to miss all. Robert Louis Stevenson

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by hajo » Post

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 ?

Mjollna
Member
Posts: 14
Joined: Tue May 01, 2018 12:37

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Mjollna » Post

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 ! :)

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by TumeniNodes » Post

Well, this looks interesting.
definitely going to check it out soon
A Wonderful World

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by texmex » Post

This looks massive, need to try out asap.

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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!

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: [Mod] Tectonic Map Generator [mg_tectonic]

by Gael de Sailly » Post

I'm very interested in this mod too. I checked it out immediately and looked a bit into the code. Great work!
Just realize how bored we would be if the world was perfect.

User avatar
csirolli
Member
Posts: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by csirolli » Post

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.
Last edited by csirolli on Thu Jun 07, 2018 06:08, edited 1 time in total.

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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

User avatar
csirolli
Member
Posts: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by csirolli » Post

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.

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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?

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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
Attachments
mgt011c.jpeg
mgt011c.jpeg (443 KiB) Viewed 4030 times
mgt011b.jpeg
mgt011b.jpeg (474.82 KiB) Viewed 4030 times
mgt011a.jpeg
mgt011a.jpeg (410.49 KiB) Viewed 4030 times

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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
Attachments
mgt011f.jpeg
mgt011f.jpeg (443.93 KiB) Viewed 4030 times
mgt011e.jpeg
mgt011e.jpeg (208.49 KiB) Viewed 4030 times
mgt011d.jpeg
mgt011d.jpeg (310.33 KiB) Viewed 4030 times

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Krock » Post

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
Attachments
screenshot_20180607_093140.png
screenshot_20180607_093140.png (227.08 KiB) Viewed 4030 times
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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.

User avatar
csirolli
Member
Posts: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by csirolli » Post

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.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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.

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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
Attachments
mgtectdev1.jpeg
mgtectdev1.jpeg (288.13 KiB) Viewed 4030 times

User avatar
Dokimi
Member
Posts: 227
Joined: Mon Sep 19, 2016 03:52
GitHub: DokimiCU

Re: [Mod] Tectonic Map Generator [mg_tectonic]

by Dokimi » Post

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
Attachments
mgtectmountians.png
mgtectmountians.png (924.89 KiB) Viewed 4030 times

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 21 guests