Currently it is possible to define how often a cluser of ore can spawn. Internally, mapchunk volume is divided by this number to determine how many attempts to spawn ore should be performed in the currently generated chunk. But what if you specify higher scarcity and the number of ores in a chunk approaches zero? Currently it is rounded down to 0 (or 1 idk). Instead a random number r € R u (-1;+1) should be added to the result of the division and then rounded to nearest integer. This would enable extremly rare ore deposits. The pseudocode is for illustration and assumes / is operator for real division.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
NumberOfClusters := Round( (ChunkVolume/ClustScarcity) + (Random(-100,100)/100) );
I am not good at single-letter languages. Considering the simplicity of the code, this should be fast to implement and also fast to execute with arithmetic coprocessor.
Edit: typo.