Changes

Jump to navigation Jump to search
1,172 bytes added ,  11:35, 18 April 2023
Line 64: Line 64:  
::So Lava bats should only spawn on level 20 and 40. I'll update the main page to say that.[[User:JackBlack69|JackBlack69]] ([[User talk:JackBlack69|talk]]) 07:54, 3 January 2023 (UTC)
 
::So Lava bats should only spawn on level 20 and 40. I'll update the main page to say that.[[User:JackBlack69|JackBlack69]] ([[User talk:JackBlack69|talk]]) 07:54, 3 January 2023 (UTC)
 
:::Thank you very much for that thorough analysis!! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 18:45, 3 January 2023 (UTC)
 
:::Thank you very much for that thorough analysis!! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 18:45, 3 January 2023 (UTC)
 +
 +
== Ore distribution bug? ==
 +
 +
While looking at the code for ore distribution, I found the ore distribution for iron and copper to be quite strange.
 +
The chance for iron is calculated as:
 +
<code>chanceForIron = Math.Min(0.5, 0.1 + (double)(this.mineLevel - Math.Min(200, skullCavernMineLevel)) * 0.005)</code>
 +
But as mineLevel is always 120 more than skullCavernMineLevel, this can be rewritten as:
 +
<code>chanceForIron = Math.Min(0.5, 0.7 + (double)(skullCavernMineLevel - Math.Min(200, skullCavernMineLevel)) * 0.005)</code>
 +
And as the minimum of skullcavernMineLevel and 200 cannot be larger than skullCavernMineLevel, this latter term will always be greater than 0, so this simplifies to:
 +
<code>chanceForIron = 0.5</code>
 +
Practically this means iron and copper are equally rare. (And the check only occurs after passing an ore check and failing an iridium check and a gold check). But if this was intended, it makes much more sense to just use 0.5. This makes me think it is likely a bug, and that both were meant to use mineLevel (or both were meant to use skullCavernMineLevel)[[User:JackBlack69|JackBlack69]] ([[User talk:JackBlack69|talk]]) 11:35, 18 April 2023 (UTC)
73

edits

Navigation menu