Skip to content

Scatter/Blob ore def clust_scarcity should provide continuous probability #16065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
j-r opened this issue Apr 22, 2025 · 0 comments · May be fixed by #16066
Open

Scatter/Blob ore def clust_scarcity should provide continuous probability #16065

j-r opened this issue Apr 22, 2025 · 0 comments · May be fixed by #16066
Labels
Feature request Issues that request the addition or enhancement of a feature @ Mapgen

Comments

@j-r
Copy link
Contributor

j-r commented Apr 22, 2025

Problem

Scatter/Blob ores currently determine the number of clusters to generate in a chunk by doing an integer division of the eligible volume (chunk volume limited by the ore y range) by clust_scarcity ignoring the remainder. This gives unexpected results if eligible volume and scarcity values are of similar magnitude.

This effect is easy to see using the Skyblock:zero game (I'm not affiliated with that project), because it has a convenient ore that is placed in air using clust_scarcity = 80*80*80:

  1. start a new game, notice the blue thingies - the emitters - around you
  2. stop the game, delete the map
  3. change to clust_scarcity = 80*80*80+1 in mods/sbz_planets/biomes.lua
  4. restart the game, notice that no emitters are generated at all
  5. stop the game, delete the map
  6. change to clust_scarcity = 80*80*40+1
  7. restart the game, notice that emitters are exactly the same as with clust_scarcity = 80*80*80 (-> half the available clust_scarcity range gives the same distribution)

Other games (e.g. Mineclonia - which I'm affiliated with) are affected right now, because some ores are very rare and/or ore y range is very small (either because the game is trying to replicate a height dependent probability or because of an unfortunate intersection of the ore y range and the chunk borders, e.g. having an ore with y_max = -200). A one node high layer ore only has a usable clust_scarcity range of 1 to 6400.

Solutions

Don't ignore the remainder of the volume by scarcity division and randomly generate enough additional clusters to make up for these lost partial ore clusters.

Alternatives

The useful clust_scarcity range could be extended right now by games using an increased chunksize.

Supporting non uniform y dependent ore distributions in the engine could reduce the need for thin layer ore definitions.

EDIT: noise_params (in addition to clust_scarcity) can be used to tweak the ore distribution

@j-r j-r added the Feature request Issues that request the addition or enhancement of a feature label Apr 22, 2025
@j-r j-r linked a pull request Apr 22, 2025 that will close this issue
2 tasks
@sfan5 sfan5 added the @ Mapgen label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Mapgen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants