[Experimental][Mod] More rocks / oregen / geology [rocks]

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

[Experimental][Mod] More rocks / oregen / geology [rocks]

by Tomas Brod » Post

Rocks is a mod to add variety of natural rocks to enhace the underground of minetest. This mod is inspired by Minecraft mod PFFA Geologica. In fact all textures are copied from geologica.

Note: this mod is not complete and is far from. Currently I work on ore and layer generators and most of the content are just placeholders.

Features

Currently 2 layers are generated. On the top is sedimental layer consistig mainy of dirt and Mudstone, which extends down to ~10 blocks underground. Under sedimentary is an igneous layer, consisting mainly of Basalt. 45% of basalt is replaced by Granite, 10% by Diorite and some Gabbro. Strata of the above rocks extend to hundreds of nodes according to large scale 3D noise.

There is an experimental vein generator, which is faster, but limited by mapgen chunk size. Veins are shaped like deformed sphere according to equation of sphere (x*x+y*y+z*z=r*r), where the radius is varied by 3D noise.

There are skarn veins currently defined, which contains a mixture of valuable minerals and spawn in granite and limestone.
Default ore generation is not disabled.

More detailed description is in the readme.

Speed

On my machine sedimentary layer generator performs at 0.57s per 80^3 chunk, igneous layer generator performs at 0.68s/chunk. And vein generator with abovementoined vein at 0.2s/chunk. The way it is implemented causes the whole server to lock down while generating my rocks/ores.

Download

fork by Gael de Sailly on github
last usable version zip
... extract this to your mod folder under the name "rocks".
Changes to the Engine (oredev branch)

License: My code: GPLv2.
Please do not get angry on me copying your stuff, I'll sort that out on release.
Last edited by Tomas Brod on Fri Sep 02, 2016 10:06, edited 7 times in total.

Thermal_Shock
Member
Posts: 85
Joined: Mon Jun 24, 2013 09:10

Re: [WIP][Mod] More rocks [rocks]

by Thermal_Shock » Post

I'm always happy to see mods that add more stone types to play with.

I'd highly recommend altering the textures to make them your own. You'll find the experience rewarding when you create a texture you really like.

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

Re: [WIP][Mod] More rocks [rocks]

by 12Me21 » Post

Tomas Brod wrote:Default ore generation is not disabled (idk how to).
You could alias the ores to stone, or make this into its own game, and edit the mapgen.lua in the default mod.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Progress: Added a Skarn vein. There are few types of skarn vein each containing different ore combination. See the git log for details. Also I thinking about making the code GPL (ur opinion?).

I have a dillema of how I want this mod to move on:

1. Should I add all the useful(les) ores or concentrate on rocks and leave ores for another mod?

2. Do I really want a clone of geologica's (or decoblocks') mapgen or should I create something different?

Also I did some research and figured out that doing expensive tasks (mapgen) in the ServerThread (read on_generated) does completly lock down the server. Whereas generating rocks and ores in EmergeTherad does not. But EmergeTherad is not lua-accesible. Following options arise to my mind:

a. Keep it as it is. Lag? Just Deal With It.

b. Modify minetest source (mg_ores.cpp) and improve the oregen, which is currently only 300 lines and extremly basic.

c. Overvrite standard biomes (from lua) and abuse the scatter oretype to spawn that large strata of rock I like so much.

Thanks m8s for ur patience!
Last edited by Tomas Brod on Fri Apr 17, 2015 14:55, edited 1 time in total.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP][Mod] More rocks [rocks]

by Don » Post

I really like the ideas you have. I think doing it in lua is best so it gives people the choice. Saying that, I think it might be good to suggest your idea to the core team. Might want to avoid using words like dumb. Remember that everyone does this for free.
Just my opinion.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Don wrote:I really like the ideas you have. I think doing it in lua is best so it gives people the choice. Saying that, I think it might be good to suggest your idea to the core team.
Your right. I myself do not feel like hacking C++ (prefer algol style languages). I might write the suggestion in the furure.
Don wrote:Might want to avoid using words like dumb. Remember that everyone does this for free.
Yeah, me too. I already edited it. I meant it as "simple".

I thing about using the MapgenV7's biomes for surface and sedimentary rock types (eg: mountain=limestone, ocean, beach=sand, plains=mudstone). And the "blob" ore type for other formations.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [WIP][Mod] More rocks [rocks]

by Don » Post

Tomas Brod wrote:
Don wrote:I really like the ideas you have. I think doing it in lua is best so it gives people the choice. Saying that, I think it might be good to suggest your idea to the core team.
Your right. I myself do not feel like hacking C++ (prefer algol style languages). I might write the suggestion in the furure.
Don wrote:Might want to avoid using words like dumb. Remember that everyone does this for free.
Yeah, me too. I already edited it. I meant it as "simple".

I thing about using the MapgenV7's biomes for surface and sedimentary rock types (eg: mountain=limestone, ocean, beach=sand, plains=mudstone). And the "blob" ore type for other formations.
Really hope you do find a good why to do what you want to do. I think it will be a very popular mod. Would be really nice to have different layers.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

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

Re: [WIP][Mod] More rocks [rocks]

by Krock » Post

Looks interesting.
I get masses of the mudstone and clay.

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

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

This mod now depends on Mapgen V7. I have overridden the minetest.register_biome to inject my rocks for every new biome. I recommend to use paramats mod https://github.com/paramat/biomesdev.git and make it depend on rocks mod. MGv7 is amazing together with the abowementoined mod.
The general guide on how to find coal is: Walk around, look at ridges/rivers and randomly dig a 2 block hole in the ground.
However, do not expect to see anything specaial deeper underground. I had to temporary disable igneous layer.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Krock wrote:Looks interesting.
I get masses of the mudstone and clay.
http://i.imgur.com/Jb1qo8j.png
Thank you for testing! As you may have discovered, this mod is highly work in progress. The amount of mudstone was decreased and in the future will be decreased more by limestone, metamorphics or other rocks.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Re-enabled skarn and nyancat veins using the awesome oretype blob. Rewritten the igneous layer gen using a trick with scatter ore type and noise params. It looks bit ugly, but since it is generated by core (mg_ore.pp, unmodified) in emerge it is fast. There is actually a large scale 3D noise determinig wheter the depostis should be copper-rich or rich in other future mineral. See git log for details.

And I forgot to mentoin that I added a generic mountain biome with limestone. This biome re-registers itself every time biome list is cleared (eg by Paramat's biomesdev). This fills the ugly stone-only mountains caused by me trimming every registered biome to y 27.

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

Re: [WIP][Mod] More rocks [rocks]

by bdjnk » Post

Hey Tomas,

This is amazing work. After trying it out a bit, in conjunction with biomesdev, I've got a few suggestions.

Ores should definitely be a part of this. It's a central aspect of geology, and you can't craft an entirely new rock system without considering how it informs the presence of ores, and vice versa.

Speaking of ores, I actually found the existence of default:stone to be distracting, especially when you have layers of, say granite, spotted with ore in default:stone. I feel like default:stone should be entirely gone.

On the topic of what should be included, while exploring I found myself missing marble. I also didn't find any gravel, which made me think of pebbles, like you find along many river banks.

The only thing that struck me as truly wrong however, were the giant blobs of nyan cat ;)

Image

This is really an amazing endeavor though, and I'm looking forward to it becoming more and more awesome.

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

Re: [WIP][Mod] More rocks [rocks]

by Krock » Post

Nyan cats without rainbows aren't nyan cats. Please add some colors!
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

bdjnk wrote:Hey Tomas, This is amazing work.
Thanks!
Ores should definitely be a part of this. It's a central aspect of geology, and you can't craft an entirely new rock system without considering how it informs the presence of ores, and vice versa.
I split this to modpack of following mods:
  • rocks: the rocks
  • mineral: the ores and minerals
  • name?: mountain and underwater (geo)biomes
Speaking of ores, I actually found the existence of default:stone to be distracting, especially when you have layers of, say granite, spotted with ore in default:stone. I feel like default:stone should be entirely gone.
No default:stone allowed. Default ores should now be disabled. Stone replaced by basalt down to -48. I overriden node_stone in the biome code but, I cant seem to override alias (mapgen_stone) defined in default.
On the topic of what should be included, while exploring I found myself missing marble. I also didn't find any gravel, which made me think of pebbles, like you find along many river banks.
Thanks for suggestion. I will implemet it definitly.
The only thing that struck me as truly wrong however, were the giant blobs of nyan cat ;)
They are for testing purposes and wont be removed until beta.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

I have added clay, claystone, slate, gravel, conglomerate, sand, sandstone to spawn in sedimentary layer. Under grass it is like a rainbow. Will be adding some bio and chemo sediments later. Slate is nice black stone, and good for roofing. This rocks spawn simillary to biomes, but using different noises. There are 2 that select "type" (silico/bio/chemo/vulcano/cosmo), third that determines particle size (gravel vs clay) and fourth the hardness (sand vs sandstone).

Beware: The code is a mess. Node properties are largely unset, stones do not drop cobble and the chunk is saved like 3 times during generation for no reason.

Also the readme is now bi-lingual :-). But the rock names are largely international with our weirid suffixes. Will be translated, of course.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Added limestone and 3 coal qualities. Tunded the parameters a bit. It is difficult to get all parameters right due to nature of the noises. Statistics are printed after mapgen. Express your opinion on what should be more and what should be less. If you do not install biomesdev, all sedimentary formations remain visible. No metamorphics, so no marble yet. Creative is a must, or you will be digging forever.

Have a fun prospecting!

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [WIP][Mod] More rocks [rocks]

by Napiophelios » Post

Is it intended to have such massive grouping of the same stone type?
All I have hit so far is limestone...oh well I will keep digging.
Image

Image
Attachments
screenshot_20150503_151951.png
screenshot_20150503_151951.png (272.09 KiB) Viewed 3307 times
screenshot_20150503_151449.png
screenshot_20150503_151449.png (409.9 KiB) Viewed 3307 times

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Napiophelios wrote:Is it intended to have such massive grouping of the same stone type?
All I have hit so far is limestone...oh well I will keep digging.
Thank you for testing. Sedimentary geomes are 2D. By digging down you only find one type of sedimentary rock.
The noises are extremly difficult to controll. It takes trial and error to set the tresholds just right. Last time I was exploring, 20% of all sed was lignite coal, for example. How big the geomes should be on average?

This is how it looks from above (all dirt removed):
Image
Attachments
screenshot_534116845.png
screenshot_534116845.png (773.91 KiB) Viewed 3307 times

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][Mod] More rocks [rocks]

by sofar » Post

As a former Geology student I can't help worry that rock types are deposited in entirely unrealistic ways in these images :^)

Sedimentary rocks can be found as deep as 10km, Basalt and igneous rocks can be found at 8km elevation. Sandstone can be under limestone, but also above limestone. Plus they can all be folder, tilted, sheared and pushed either up or down.

A 2D mapgen seems terribly wrong. Perhaps you need to combine several 3d noise maps - one determining the barrier between crust(igneous) and sediments. By all means let that barrier go above 0. Above the barrier you'd want to create semi-horizontal "cakes" of sediments of random order and thickness. Then intersect everything with the actual topography and cover with a soft deposit.

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

Re: [WIP][Mod] More rocks [rocks]

by paramat » Post

This looks good, at one point i was planning to work on coloured stone located by 3D noise, i was inspired by MC videos.

User avatar
SegFault22
Member
Posts: 872
Joined: Mon May 21, 2012 03:17
Location: NaN

Re: [WIP][Mod] More rocks [rocks]

by SegFault22 » Post

This mod is very interesting. It adds a good amount of diversity to the stone underground, which is good for making things less boring, especially considering how things can be made to generate only in certain types of stone.
I have a suggestion - instead of doing this:

Code: Select all

minetest.register_node( "rocks:granite", {  
	description = S("Granite"),
	tiles = { "rocks_wgr.png" },
	is_ground_content = true, sounds = default.node_sound_stone_defaults(),
	groups = {cracky=3, stone=1}, 
})
minetest.register_node( "rocks:diorite", {  
	description = S("Diorite"),
	tiles = { "rocks_Diorite.png" },
	groups = {cracky=3, stone=1}, 
	is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "rocks:gabbro", {  
	description = S("Gabbro"),
	tiles = { "rocks_Gabbro.png" },
	groups = {cracky=3, stone=1}, 
	is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
minetest.register_node( "rocks:basalt", {  
	description = S("Basalt"),
	tiles = { "rocks_Basalt.png" },
	groups = {cracky=3, stone=1}, 
	is_ground_content = true, sounds = default.node_sound_stone_defaults(),
})
you could do:

Code: Select all

nodes = {
{ "diorite", "Diorite", {cracky=3, stone=1} },
{ "granite", "Granite", {cracky=3, stone=1} },
{ "gabbro", "Gabbro", {cracky=3, stone=1} },
{ "basalt", "Basalt", {cracky=3, stone=1} },
}
for _, row in ipairs(nodes) do
	local node_id = row[1]
	local node_name = row[2]
	local node_groups = row[3]

	minetest.register_node( "rocks:"..node_id, {
		description = S(node_name),
		tiles = { "rocks_"..node_id..".png" },
		is_ground_content = true,
		sounds = default.node_sound_stone_defaults(),
		groups = node_groups,
	})
end
That way, you only use 15 lines of code for registering nodes (13 for the ipairs do function, plus 2 for "nodes = {}) plus 1 line for each node that is registered (in ipairs "nodes"), instead of 6 lines for registering each individual node. When you add a new node with that code, you only have to add one more line to the ipairs table "nodes", instead of 6 for every node being registered.
You could even move "nodes = " and everything encased in the braces/curly-brackets to a new file, and leave the registering code in the file it was already in, preceded by a dofile line targeting the file with the ipairs table "nodes" in it. That way, the code doing logical/registry is not mixed up with the strings of information that make each registered node different, and they can be accessed/modified much faster and easier. (More rows would be needed in the table if you want to register rocks with different sounds or other properties, which could be difficult if you have a large number of lines in the ipairs table, because you would have to add a new row to every line, with a short string in it. You would also have to enter the name of the local variable (representing the value of the property) into the registering code where the property is set.)

User avatar
domtron vox
Member
Posts: 111
Joined: Thu Feb 20, 2014 21:07
GitHub: DomtronVox
IRC: Domtron
In-game: Domtron

Re: [WIP][Mod] More rocks [rocks]

by domtron vox » Post

@Tomas Brod this is awesome and would probably go well with Wuzzy's Pedology (soils) mod viewtopic.php?f=11&t=9429

Does this mod need to depend on default or could this and Pedology be put together to replace default's terrain part completely?

I think you should stick with rocks and maybe add some sort of register ore alias that can be called by other modders to register ores in specific 'geomes' as you put it. that way they can add in different kinds of iron for each geome: iron in limestone, iron in granite, ect.

Thanks for making the mod. :)

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

Thank you for the suggestion, Segfault22. I have been thinking about that.
SegFault22 wrote:More rows would be needed in the table if you want to register rocks with different sounds or other properties, which could be difficult if you have a large number of lines in the ipairs table
That is exactly the reason why I wont do it like that. No offense. Now it seems repetitive, but once I start adding node properties, the registration code would become more complicated than standard register_node.

User avatar
Tomas Brod
Member
Posts: 34
Joined: Thu Sep 18, 2014 13:57
In-game: Brod
Location: Slovakia
Contact:

Re: [WIP][Mod] More rocks [rocks]

by Tomas Brod » Post

sofar wrote:As a former Geology student I can't help worry that rock types are deposited in entirely unrealistic ways in these images :^)

A 2D mapgen seems terribly wrong. Perhaps you need to combine several 3d noise maps - one determining the barrier between crust(igneous) and sediments. By all means let that barrier go above 0. Above the barrier you'd want to create semi-horizontal "cakes" of sediments of random order and thickness. Then intersect everything with the actual topography and cover with a soft deposit.
It is not a 2d mapgen, just the noise is 2D. In fact, base height of terrain in v7 is calculated by 2d noise (the noise value is height of terrain).
Your idea with 3d noise separating crust from sediments seems interesting. I can already see what it will look like. And a last thing: I do not want to create complete lua mapgen, nor a geological simulatior. I just want to have more than dirt and stone.

Is this better? (not uploaded code yet)
Image
It is created by stacking a few layers. In every layer, the same algorithm is used to select 'geome', but with different seeds. Also the height of the layers is varied by noise. But it is also slower. I want it to be fast, so all people (incl me) can play it.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][Mod] More rocks [rocks]

by sofar » Post

Tomas Brod wrote: It is not a 2d mapgen, just the noise is 2D. In fact, base height of terrain in v7 is calculated by 2d noise (the noise value is height of terrain).
Your idea with 3d noise separating crust from sediments seems interesting. I can already see what it will look like. And a last thing: I do not want to create complete lua mapgen, nor a geological simulatior. I just want to have more than dirt and stone.

Is this better? (not uploaded code yet)

It is created by stacking a few layers. In every layer, the same algorithm is used to select 'geome', but with different seeds. Also the height of the layers is varied by noise. But it is also slower. I want it to be fast, so all people (incl me) can play it.
indeed, you do not want to create a geological simulator, that would be a thesis project (Just look at my sedimentology mod, which only models 2 geological processes).

It indeed looks nice, I like the waving layers. We'll just consider any vertical edges to be "faults" like real geologists, and make up a good story about it!

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests