Changes

Jump to navigation Jump to search
Updated for 1.6
Line 1: Line 1: −
Small minable stones and ores can appear as random stones throughout the floor, or rarely as small clumps. These have different distributions<ref name="populateLevel" /><ref name="chooseStoneType" />.
+
Small minable stones and ores can appear as random stones throughout the floor, or rarely as small clumps. These have different distributions<ref name="populateLevel" /><ref name="createLitterObject" />.
 
On average there will be less than 0.67 small resource clumps on each floor with neutral luck, and less than 1 for the largest possible luck. These clumps have a 25% chance to be a dark grey rock (stone ore), a 1.5% chance to be iridium, and a 73.5% chance to be gold.
 
On average there will be less than 0.67 small resource clumps on each floor with neutral luck, and less than 1 for the largest possible luck. These clumps have a 25% chance to be a dark grey rock (stone ore), a 1.5% chance to be iridium, and a 73.5% chance to be gold.
   Line 15: Line 15:  
Dark grey rocks,  start with their maximum chance at floor 1 (9.73% for dark grey rocks, 0.005% for mystic stones, 0.059% for gem nodes for best chances), and drop proportionally as ores take their place.
 
Dark grey rocks,  start with their maximum chance at floor 1 (9.73% for dark grey rocks, 0.005% for mystic stones, 0.059% for gem nodes for best chances), and drop proportionally as ores take their place.
    +
During the [[Desert_Festival]], there are some small changes to how the ore is generated, this is to allow the generation of egg nodes. This occurs below in the section to generate ore clumps, and the section to generate metallic ores.
    
==Code Details==
 
==Code Details==
 
The main code for populating the floor is found in the function <code>StardewValley.Locations.MineShaft::populateLevel</code>. In setting up to populate the floor, it initially defines stoneChance as a random number (double) in the range [10,30), and gemStoneChance as 0.003. It then calls <code>StardewValley.Locations.MineShaft::adjustLevelChances</code>, which will perform a few checks including setting the chance to find stone to 0 for infested floors and dividing gem stone chance by 2<ref name="adjustChances" />.
 
The main code for populating the floor is found in the function <code>StardewValley.Locations.MineShaft::populateLevel</code>. In setting up to populate the floor, it initially defines stoneChance as a random number (double) in the range [10,30), and gemStoneChance as 0.003. It then calls <code>StardewValley.Locations.MineShaft::adjustLevelChances</code>, which will perform a few checks including setting the chance to find stone to 0 for infested floors and dividing gem stone chance by 2<ref name="adjustChances" />.
After this setup, it will then iterate through every square of the floor, and if it passes a few checks it will add a stone selected using the function <code>StardewValley.Locations.MineShaft::chooseStoneType</code>, passing the gemstone chance from above and the magic numbers 0.001 and 5e-5 for gem nodes (internally chanceForPurpleStone) and mystic stones (internally chanceForMysticStone). In the same sweep, if it does not add a stone there is a chance for it to add a large resource clump, which are 2 possible variants of a 2 by 2 boulder.
+
After this setup, it will then iterate through every square of the floor, and if it passes a few checks it will add a stone selected using the function <code>StardewValley.Locations.MineShaft::createLitterObject</code>, passing the gemstone chance from above and the magic numbers 0.001 and 5e-5 for gem nodes (internally chanceForPurpleStone) and mystic stones (internally chanceForMysticStone). In the same sweep, if it does not add a stone there is a chance for it to add a large resource clump, which are 2 possible variants of a 2 by 2 boulder.
    
After iterating through every square, and performing a few other tasks, it will attempt to add ore clumps using the function <code>StardewValley.Locations.MineShaft::tryToAddOreClumps</code>, but only if the floor is not divisible by 5, and it is not a treasure room.
 
After iterating through every square, and performing a few other tasks, it will attempt to add ore clumps using the function <code>StardewValley.Locations.MineShaft::tryToAddOreClumps</code>, but only if the floor is not divisible by 5, and it is not a treasure room.
Line 31: Line 32:  
However, each try chooses a random tile on the map and will only place an ore clump there if the tile is free, resulting in less than these numbers.
 
However, each try chooses a random tile on the map and will only place an ore clump there if the tile is free, resulting in less than these numbers.
   −
To choose which type of ore to add it calls the function <code>StardewValley.Locations.MineShaft::getAppropriateOre</code><ref name="whichOre" />, which just before returning has a 25% chance (if it is not in hard mode) to set the ore to 668 or 670, which are the dark grey rocks (stone ore). Otherwise, the ore is set as 764, gold ore, with a 2% chance to set it to 765, iridium ore.
+
To choose which type of ore to add it calls the function <code>StardewValley.Locations.MineShaft::getAppropriateOre</code><ref name="whichOre" />, which just before returning has a 25% chance (if it is not in hard mode) to set the ore to 668 or 670, which are the dark grey rocks (stone ore).
This results in total chances of 25% for dark grey rocks, 1.5% chance for iridium ore, and 73.5% for gold.
     −
===Random ore placement (chooseStoneType)===
+
Otherwise, it first checks if the [[Desert_Festival]] is ongoing. If it is there is a (25 + [[Desert_Festival#Skull_Cavern|"Egg Rating"]] / 20)% chance of the node being an egg node.
 +
Otherwise, the ore is set as 764, gold ore, with a 2% chance to set it to 765, iridium ore.
 +
 
 +
When the festival is not ongoing, this results in total chances of 25% for dark grey rocks, 1.5% chance for iridium ore, and 73.5% for gold.
 +
 
 +
===Random ore placement (createLitterObject)===
 
====Radioactive Ore====
 
====Radioactive Ore====
 
[[File:SDV SC Radioactive.png|300px|thumb|right|Changing distribution of radioactive ore with luck (daily luck and luff buffs).]]
 
[[File:SDV SC Radioactive.png|300px|thumb|right|Changing distribution of radioactive ore with luck (daily luck and luff buffs).]]
Line 40: Line 45:  
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
 
if (this.GetAdditionalDifficulty() > 0 && this.mineLevel % 5 != 0 && this.mineRandom.NextDouble() < (double)this.GetAdditionalDifficulty() * 0.001 + (double)((float)this.mineLevel / 100000f) + Game1.player.team.AverageDailyLuck() / 13.0 + Game1.player.team.AverageLuckLevel() * 0.0001500000071246177)</syntaxhighlight>
 
if (this.GetAdditionalDifficulty() > 0 && this.mineLevel % 5 != 0 && this.mineRandom.NextDouble() < (double)this.GetAdditionalDifficulty() * 0.001 + (double)((float)this.mineLevel / 100000f) + Game1.player.team.AverageDailyLuck() / 13.0 + Game1.player.team.AverageLuckLevel() * 0.0001500000071246177)</syntaxhighlight>
For this, the luck boost from the [[Special Charm|special charm]] (0.025, contribution to AverageDailyLuck) is equivalent to an additional 192.3 floors (2500/13), and a single point of luck (such as from a food buff) is worth ~15 floors. With the best possible luck (0.125 daily luck with special charm, +9 luck from [[Magic Rock Candy]], a [[Ginger Ale]] made with [[Qi Seasoning]], and 2 [[Lucky Ring]]s) 1.32% of stones will be [[Radioactive Ore|radioactive ore]] on floor 1, increasing to 1.42% on floor 99. With the worst possible luck no radioactive ore will appear until floor 550. Also note that radioactive ore will not appear on any floor divisible by 5.
     −
This means that hypothetically with the best possible luck, from floor 98684 onwards, except on floors divisible by 5, the only ore found from random stones would be radioactive ore. With the worst possible luck, this increases to floor 100550. Reaching these floors would require bypassing the [[Quarry Mine]] floor, which can be found on floor 77257 of Skull Cavern.
+
The difficulty can be changed by using the statue at the cavern entrance or by accepting the [[Quests#List of Mr. Qi's Special Orders|Qi quest]] Skull Cavern Invasion. This provides 3 levels, normal (0), one of these active (1), or both of these active (2). With a difficulty of 0, no radioactive ore will spawn.
 +
 
 +
The luck boost from the [[Special Charm|special charm]] (0.025, contribution to AverageDailyLuck) is equivalent to an additional 192.3 floors (2500/13), and a single point of luck (such as from a food buff) is worth ~15 floors. The boost from the additional difficulty (setting it to 2 instead of 1) is equivalent to 100 floors.
 +
 
 +
With the difficulty set to 1, with the best possible luck (0.125 daily luck with special charm, +9 luck from [[Magic Rock Candy]], a [[Ginger Ale]] made with [[Qi Seasoning]], and 2 [[Lucky Ring]]s) 1.32% of stones will be [[Radioactive Ore|radioactive ore]] on floor 1, increasing to 1.42% on floor 99. With the worst possible luck no radioactive ore will appear until floor 550. Also note that radioactive ore will not appear on any floor divisible by 5.
 +
 
 +
This means that hypothetically with the best possible luck, with difficulty set to 2, from floor 98584 onwards, except on floors divisible by 5, the only ore found from random stones would be radioactive ore. With the worst possible luck, this increases to floor 100450. Reaching these floors would require bypassing the [[Quarry Mine]] floor, which can be found on floor 77257 of Skull Cavern.
    
====Metal Ores====
 
====Metal Ores====
Line 53: Line 63:  
     }</syntaxhighlight>
 
     }</syntaxhighlight>
   −
This ends up being defined as either <code>0.02 + skullCavernMineLevel * 0.0005 </code> for floors 1-10, <code>0.01 + skullCavernMineLevel * 0.0015</code> for floors 10 to 100 (when skullCavernMineLevel <= 100), and <code>0.11 + skullCavernMineLevel * 0.0005</code> for floors 100 and up(when skullCavernMineLevel >= 100). This means the chance for ore will increase by 0.05% for each floor, except between floors 10 and 100 where it increases by 0.15% each floor. This reaches 100% at floor 1780, providing the 4th region. At the crossover point of floor 10 the 2 chances are equal as the extra term is 0. This means the function is continuous.
+
This ends up being defined as either <code>0.02 + skullCavernMineLevel * 0.0005 </code> for floors 1-10, <code>0.01 + skullCavernMineLevel * 0.0015</code> for floors 10 to 100 (when skullCavernMineLevel <= 100), and <code>0.11 + skullCavernMineLevel * 0.0005</code> for floors 100 and up(when skullCavernMineLevel >= 100). This means the chance for ore will increase by 0.05% for each floor, except between floors 10 and 100 where it increases by 0.15% each floor. This reaches 100% at floor 1780, providing the 4th region. At the crossover point of floor 10 the 2 chances are equal as the extra term is 0. This means the function is continuous. If this ore check passes it will return an ore.
    
[[File:Skull Cavern Ore Distribution.png|300px|thumb|right|Changing distribution of metal ore with floor.]]
 
[[File:Skull Cavern Ore Distribution.png|300px|thumb|right|Changing distribution of metal ore with floor.]]
If this ore check passes it will return an ore, with it first checking for [[Iridium Ore|iridium]], then [[Gold Ore|gold]], then [[Iron Ore|iron]], then returning [[Copper Ore|copper]].
+
 
 +
First, if the [[Desert_Festival]] is ongoing. If it is there is a (13 + [[Desert_Festival#Skull_Cavern|"Egg Rating"]] / 20)% chance of the node being an egg node. This will not be included in the below graphs and discussions. After that, it first checking for [[Iridium Ore|iridium]], then [[Gold Ore|gold]], then [[Iron Ore|iron]], then returning [[Copper Ore|copper]].
 
As an example, this means for a stone to be gold ore it must pass the ore check, then fail the iridium check, then pass the gold check.
 
As an example, this means for a stone to be gold ore it must pass the ore check, then fail the iridium check, then pass the gold check.
 
This means in order to get an ore, the chance for the previous ore must be less than 100%, so once iridium ore reaches 100%, no other metal ores can be made.
 
This means in order to get an ore, the chance for the previous ore must be less than 100%, so once iridium ore reaches 100%, no other metal ores can be made.
Line 227: Line 238:  
|}
 
|}
 
When not being used as the x axis, the values of daily luck, mining level and floor are controlled by a variable in the left pane and are used to calculate a reference. Initially these are set to floor 100, a daily luck of 0.025 (average daily luck with special charm) and a mining level of 10.
 
When not being used as the x axis, the values of daily luck, mining level and floor are controlled by a variable in the left pane and are used to calculate a reference. Initially these are set to floor 100, a daily luck of 0.025 (average daily luck with special charm) and a mining level of 10.
 +
 +
==History==
 +
{{History|1.6|chooseStoneType renamed to createLitterObject. Additional difficulty can now be 2. Calico statues introduced.}
 +
    
==References==
 
==References==
Line 235: Line 250:  
<ref name="dailyLuck">See <samp>FarmerTeam::AverageDailyLuck</samp> and <samp>Game1::_newDayAfterFade</samp> in the game code.</ref>
 
<ref name="dailyLuck">See <samp>FarmerTeam::AverageDailyLuck</samp> and <samp>Game1::_newDayAfterFade</samp> in the game code.</ref>
 
<ref name="whichOre">See <samp>FarmerTeam::getAppropriateOre</samp> in the game code.</ref>
 
<ref name="whichOre">See <samp>FarmerTeam::getAppropriateOre</samp> in the game code.</ref>
<ref name="chooseStoneType">See <samp>MineShaft::chooseStoneType</samp> in the game code.</ref>
+
<ref name="createLitterObject">See <samp>MineShaft::createLitterObject</samp> in the game code.</ref>
 
<ref name="whichGem">See <samp>MineShaft::getRandomGemRichStoneForThisLevel</samp> in the game code.</ref>
 
<ref name="whichGem">See <samp>MineShaft::getRandomGemRichStoneForThisLevel</samp> in the game code.</ref>
 
<ref name="stoneDrop">See <samp>MineShaft::checkStoneForItems</samp> in the game code.</ref>
 
<ref name="stoneDrop">See <samp>MineShaft::checkStoneForItems</samp> in the game code.</ref>
73

edits

Navigation menu