Blob Ore Generation looks "chopped off" or "cubic"

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

Blob Ore Generation looks "chopped off" or "cubic"

by SegFault22 » Post

I'm trying to work on tuning the noise parameters for blob ore generation, so that I can create large clusters of ore which are far apart. The purpose is to increase the difficulty of finding ore, and encourage players to establish a "mine" where they have found a deposit, coming back whenever they need more, until it is all gone and they have to find another deposit. In multiplayer servers, this will help encourage players to specialize in certain "jobs", since the task of mining would be significantly more complicated than just digging in a straight line and collecting whatever small clusters of ore you regularly run into.

I have found that the ore generation types "blob" and "sheet" are really good for this, since they generate large clusters of ore which aren't cubic-shaped... usually:
Image
The problem isn't really a "big one", but it does seem odd that the sides of clusters are occasionally "chopped-off" and making them appear cubic (especially if the parameters are set to make the clusters huge), and it may feel "wrong" to some players. This may be caused by the parameters being sub-optimal, so I'll put the code here:

Code: Select all

minetest.register_ore({
	ore_type = "blob",
	ore = "default:coalblock",
	wherein = "air",
	clust_scarcity = 60000,
	clust_size = 22,
	y_min = 0,
	y_max = 400,
	noise_threshold = 0.6,
	noise_params = {offset=0.55, scale=1.0, spread={x=128, y=128, z=128}, seed=789, octaves=2, persist=0.7},
})
I generate ores in the air for testing purposes, to better see how "balanced" the distribution is (or isn't), and when I release a mod I will make sure that it doesn't generate ores in the air. Also, the default:coalblock isn't the ore I am trying to generate, that node is in a mod which is pretty big so I want to keep it separate while I am trying to adjust the ore generation parameters to something balanced.

I would also prefer that the clusters are not sphere-shaped either, but more random, as in previous versions of the game:
Image
This isn't necessary, if it isn't possible, although it is preferable - but as long as the generation is balanced, that is fine. Also it may be acceptable that the clusters are "chopped-off", but only if there is no way to fix it.

So, why does the blob ore generation (and sometimes sheet ore) occasionally appear "chopped-off" at the sides?
If it is caused by the parameters being sub-optimal (rather than something in the "engine"), how can I adjust the parameters to prevent this?

Alternatively, is there a mod which implements different ore generation patterns, especially ones that may be similar to the last image I posted (random clusters), which I could use for this instead of minetest.register_ore()?

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

Re: Blob Ore Generation looks "chopped off" or "cubic"

by SegFault22 » Post

Naj wrote:I love that ! I tryed to do something similar but failed in finding a way to have separate mines without having something too heavy for the mapgen.
I don't think types "blob" and "sheet" are too heavy. At the developer wiki, they say the only ore generation type which you should not use much is the "vein" type, since the processing resources it requires are around 400 times that which is required by regular "scatter".

I was also considering using the type "scatter" for my purposes, and just increasing the cluster size to make large clusters, but they end up having a cubic outline; I could maybe use the regular size of clusters and use the noise parameters to generate the clusters unevenly (blobs of clusters), which was also mentioned on the developer wiki.

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

Re: Blob Ore Generation looks "chopped off" or "cubic"

by paramat » Post

Cutoffs are due to the relationship between noise_params, noise_threshold and clust_size, noise can make the blob exceed it's allowed cubic volume defined by clust_size. Try altering noise_threshold.

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

Re: Blob Ore Generation looks "chopped off" or "cubic"

by SegFault22 » Post

paramat wrote:Cutoffs are due to the relationship between noise_params, noise_threshold and clust_size, noise can make the blob exceed it's allowed cubic volume defined by clust_size. Try altering noise_threshold.
Thank you, I did not know that this was causing the problem.

Do you know why the blob pattern produces spheres now? I found that odd, as it was always different before the newer versions of the game. I would really like to make those more randomly-shaped blobs, if that is even possible with the "stock" ore generation patterns.

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

Re: Blob Ore Generation looks "chopped off" or "cubic"

by paramat » Post

The noise is there to produce distorted spheres.
Your 'spread' is 128 nodes, if noise is varying on a scale of 128 nodes it won't be varying much over the small scale of a single blob, try a 'spread' similar to blob size, then readjust 'scale' and 'offset'. For performance you only need 1 octave of noise.

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

Re: Blob Ore Generation looks "chopped off" or "cubic"

by SegFault22 » Post

paramat wrote:The noise is there to produce distorted spheres.
Your 'spread' is 128 nodes, if noise is varying on a scale of 128 nodes it won't be varying much over the small scale of a single blob, try a 'spread' similar to blob size, then readjust 'scale' and 'offset'. For performance you only need 1 octave of noise.
I will try with the adjusted parameters as soon as I get my test set-up. I did not know that the noise can distort the spheres (I just copied the code from a previous version of my mod, where it appeared to work properly). Thank you for telling me about how this really works.

EDIT: I just tried it with this new information, and it works great now! I can make the blobs more random-looking and reduce the "flat walls" to almost none at all. Here's what it currently looks like:
Image
I will have to tune the "abundance factor" a little bit more, but this is generally the pattern I want. Again, thank you for helping me with this.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests