Realistic Ore Veins

Realistic Ore Veins

357k Downloads

[Suggestions] Alternative to size and density

NielsPilgaard opened this issue ยท 4 comments

commented

I would like to suggest an alternative option to min-x/min-y, something along the lines of amount. I'd like to be able to specify a rough amount of ores in each vein, and then have distribute it evenly-ish.
That'll make "normal" ore generation a lot easier to make, for me at least.

I hope you'll consider it :)

commented

There's a number of things here:

  1. min_y and max_y have nothing to do with the size of veins, or how many ores are placed within them. So I'm going to assume you're referring to the collective effect of horizontal_size, vertical_size, density, and other vein generation parameters.
  2. This mod is completely cascading lag free, which puts restrictions on ore generation, namely each chunk in a vein needs to be able to generate completely independently of each other. (I can explain this further but I think I'm already drifting into wall of text zone, long story short it's not possible without a complete rewrite).
  3. As a result of 2), putting any restriction on the number of ores in a vein is impossible, as that requires knowledge of the entire vein at the time it generates - not possible.

So, what could be done instead, is provide a convenience config option for approximate_amount, which will default various config options such as horizontal_size, vertical_size, and density. I will stress this won't make veins have exact counts of ore blocks, as all it can do, is perform the exact same limitations that are achievable with the aforementioned restrictions. But, given I know the implementation of the veins in question, it should result in veins having an approximately normal distribution, centered at approximate_amount

commented

Yep, I did mean the collective effect of horizontal_size, vertical_size and density, woops.

That is exactly what I'm looking for, a convinient option that does the calculation for me to get an approximate amout of ores.

commented

Okay, I took a look at doing this for sphere type veins (arguably the simplest case), and it quickly got much more complicated than I was expecting.

In order to pick accurate size parameters, first the expected amount of each vein needs to be known. E.g. modeling each vein as a probability mass function over three dimensional space, approximating that with a continuous probability density, and integrating over the volume of the vein. In addition, sphere veins have a non-uniform density, and are also actually ellipsoids, meaning to calculate the volume requires an integral over the surface area of an ellipsoid, which immediately starts involving quite a lot of mathematics.

So, while I would in theory like to do this, it probably won't happen any time soon unless I can get some better models for vein sizes (and this is only for spheres). Otherwise the option would be too imprecise to be useful.

commented

Alright, I appreciate you looking into it, I'll just practice getting size and density configured well then :)