Changes

11,296 bytes added ,  21:11, 18 October 2023
Question about symbols, open to discussion
Line 12: Line 12:     
::Thanks for the response! Yeah I can try to edit it. I wanted to double check if the in-game formulas are correct as stated on the page, but I'm not sure how to go about doing that. If they are, I can share what I have. [[User:APost-It|APost-It]] ([[User talk:APost-It|talk]]) 01:36, 8 September 2021 (UTC)
 
::Thanks for the response! Yeah I can try to edit it. I wanted to double check if the in-game formulas are correct as stated on the page, but I'm not sure how to go about doing that. If they are, I can share what I have. [[User:APost-It|APost-It]] ([[User talk:APost-It|talk]]) 01:36, 8 September 2021 (UTC)
:::I added a code reference (it should have been done long ago, I'm so glad you asked about this subject!) -- the formula can be found in <tt>StardewValley.Crop::harvest</tt>. For your convenience, I believe the relevant portion, copied from the v1.5 code, is:
+
:::I added a code reference (it should have been done long ago, I'm so glad you asked about this subject!) -- the formula can be found in <samp>StardewValley.Crop::harvest</samp>. For your convenience, I believe the relevant portion, copied from the v1.5 code, is:
 
:::<syntaxhighlight lang="C#">
 
:::<syntaxhighlight lang="C#">
 
double chanceForGoldQuality = 0.2 * ((double)Game1.player.FarmingLevel / 10.0) + 0.2 * (double)fertilizerQualityLevel * (((double)Game1.player.FarmingLevel + 2.0) / 12.0) + 0.01;
 
double chanceForGoldQuality = 0.2 * ((double)Game1.player.FarmingLevel / 10.0) + 0.2 * (double)fertilizerQualityLevel * (((double)Game1.player.FarmingLevel + 2.0) / 12.0) + 0.01;
Line 55: Line 55:  
::As for the 75% capped yes I did account for it by doing the following: If the sum of true gold chance and silver chance is greater than 1, then silver chance is set to 1 - true gold chance. Otherwise it is 0.75.
 
::As for the 75% capped yes I did account for it by doing the following: If the sum of true gold chance and silver chance is greater than 1, then silver chance is set to 1 - true gold chance. Otherwise it is 0.75.
 
::If you'd like to take a look at the sheet, heres the link (you'll have to remove the spaces): docs. google. com/spreadsheets/d/1_qFcwcRTiyfqGdm5LMmG-8MI3woqKowvu-1utmuYe4M/edit?usp=sharing
 
::If you'd like to take a look at the sheet, heres the link (you'll have to remove the spaces): docs. google. com/spreadsheets/d/1_qFcwcRTiyfqGdm5LMmG-8MI3woqKowvu-1utmuYe4M/edit?usp=sharing
[[User:LahaiRoi|LahaiRoi]] ([[User talk:LahaiRoi|talk]]) 17:18, 10 September 2021 (UTC)
+
::[[User:LahaiRoi|LahaiRoi]] ([[User talk:LahaiRoi|talk]]) 17:18, 10 September 2021 (UTC)
 +
 
 +
:::My numbers are different than what LahaiRoi got. My numbers were all the same as what the page already has for all fertilizers, except the Deluxe. I think the actual formulas are, based on the given code (forgive my pseudo code):
 +
:::<syntaxhighlight lang="C#">
 +
iridium: gold chance / 2
 +
 
 +
true gold chance: if( (gold chance * (1 - iridium chance) + iridium chance) < 1)
 +
                    {gold chance * (1 - iridium chance)}
 +
                  else
 +
                    {1 - iridium chance}
 +
 
 +
silver chance: min(0.75, (gold chance * 2))
 +
 
 +
true silver chance: if(fertilizer quality == Deluxe)
 +
                      {1 - iridium chance - true gold chance}
 +
                    else if( (silver chance * (1 - iridium chance) * (1 - true gold
 +
                            chance) + iridium chance + true gold chance) < 1 )
 +
                      {silver chance * (1 - iridium chance) * (1 - true gold chance)}
 +
                    else
 +
                      {1 - iridium chance - true gold chance}
 +
 
 +
normal: 1 - iridium chance - true gold chance - silver chance
 +
</syntaxhighlight>
 +
 
 +
:::With these formulas I replicated all the numbers in the tables for all the fertilizers, except for the Deluxe fertilizer. I will upload my full tables to this talk page tonight when I have more time.
 +
:::--[[User:APost-It|APost-It]] ([[User talk:APost-It|talk]]) 17:24, 10 September 2021 (UTC)
 +
::::If you are using deluxe fert then the silver chance is just max(1 - iridium chance - true gold chance, 0) because the code says: || fertilizerQualityLevel >= 3)
 +
::::And if you are not using deluxe fert, then there shouldnt be any iridium calculations involved at all because the code says: fertilizerQualityLevel >= 3 &&
 +
::::So normal chance is 1 - silver chance - true gold chance, and if deluxe fert is used then normal chance doesnt exist.
 +
::::The gold and iridium formulas you have are good.
 +
::::[[User:LahaiRoi|LahaiRoi]] ([[User talk:LahaiRoi|talk]]) 17:42, 10 September 2021 (UTC)
 +
::::Here are my exact formulas:
 +
::::<syntaxhighlight lang="C#">
 +
gold chance (r) = 0.2*(farminglevel/10) + 0.2*fertlevel*((farminglevel+2)/12)+0.01
 +
iridium chance = if fertlevel >= 3
 +
                      r/2
 +
                else if fertlevel <= 2
 +
                      0
 +
true gold chance = if fertlevel <= 2
 +
                      r
 +
                else if fertlevel >= 3
 +
                      min(r*(1-iridium chance), 1-iridium chance)
 +
silver chance = if fertlevel >= 3
 +
                      max(1 - iridium chance - true gold chance, 0)
 +
                else if fertlevel <= 2
 +
                      min(min(r*2*(1-r),0.75),1-r)
 +
normal chance = if fertlevel >= 3
 +
                      0
 +
                if fertlevel <= 2
 +
                      max(1 - true gold chance - silver chance, 0)
 +
</syntaxhighlight>
 +
::::[[User:LahaiRoi|LahaiRoi]] ([[User talk:LahaiRoi|talk]]) 18:09, 10 September 2021 (UTC)
 +
 
 +
 
 +
:::::Ok LahaiRoi, I've taken a look at your spreadsheet and I see where it went wrong. I think I didn't explain well what my formulas were. I'm attaching a screenshot below of some of my calculations.
 +
 
 +
:::::[[Media:Fertilizer_Crop_Quality_Chances_Screenshot.png]]
 +
 
 +
:::::I'm also attaching my spreadsheet. If you wish to see the formulas they are hidden within the headers.
 +
 
 +
:::::docs.google.com/spreadsheets/d/1IwVMmuggkY2kzK6wrdUCWNndWI9r79YD3hDnvXIzbf8/edit?usp=sharing
 +
 
 +
:::::If you look at the screenshot first, you can see that our calculations differ first at Basic Fertilizer and Farming Level 10. Our gold chances are the same. For silver, you calculate 48.4%; I have 44.3%. If you look at the way I've calculated it, I've broken down the calculation into two: first the Silver Chance Formula and then the actual Silver Chance. My Silver Chance Formula is exactly as given by the code. At Farming Level 10 with Basic Fertilizer, that is the first time that 0.75 becomes the minimum, which you can see in my calculation. Our values differ because I use that first then apply the probabilities. Looking at your calculation at the same levels (Row 29), you have min(G29*2*(1-G29),0.75) as your innermost min formula. You're multiplying the probability to the silver formula '''before''' taking the minimum. The code given above is first calculating the silver chance, then checking for iridium quality, then checking gold, finally silver. So I think your formula needs to be min(min(G29*2,0.75),1-G29) in order to follow the code.
 +
 
 +
:::::Additionally, if I change my calculations to ignore the 75% cap to silver chance, my values match yours.
 +
 
 +
:::::If that doesn't make sense to you, add a few intermediate columns that calculate the chance in parts. Make a column that calculates the silver chance, then another column that includes the silver chance and the probability the code checks for silver quality.
 +
 
 +
:::::I'm confident that what I have is correct, please view my spreadsheet for the full calculations. If you compare mine to the current tables, all my percentages match, except for the Deluxe Fertilizer table, which cannot possibly be correct since it lists a nonzero chance of harvesting a regular quality. If everyone here agrees, I will edit the table.--[[User:APost-It|APost-It]] ([[User talk:APost-It|talk]]) 20:55, 10 September 2021 (UTC)
 +
::::::Alright I see. I changed my spreadsheet and it matches yours exactly. So ya I had it wrong.
 +
::::::You're good to change it. Thanks for helping me out with this.
 +
::::::[[User:LahaiRoi|LahaiRoi]] ([[User talk:LahaiRoi|talk]]) 22:21, 10 September 2021 (UTC)
 +
 
 +
== XP per Day ==
 +
 
 +
Based on Margotbean's suggestion to move XP per Day here rather than including it in crops table in crops page. [[User:Xyrsis|Xyrsis]] ([[User talk:Xyrsis|talk]]) 22:58, 1 October 2023 (UTC)
 +
 
 +
Hello margotbean, I think XP per day is important as it is useful for determining the most efficient crops to level up your farming or foraging skills.
 +
There is slight difference to the most profitable crops as XP per day does not consider the price of seeds.
 +
I am going to use your spreadsheets to calculate the XP per day, edit on all crops table is on the way. [[User:Xyrsis|Xyrsis]] ([[User talk:Xyrsis|talk]]) 09:09, 1 October 2023 (UTC)
 +
This is the spreadsheet I used, [https://docs.google.com/spreadsheets/d/15zNaPQp-6GwIzm2ucuIkphNpSdECw3cI/edit?usp=sharing&ouid=114495551717477095381&rtpof=true&sd=true spreadsheet].
 +
 
 +
Table added with values from last updated spreadsheet, there are few missing crops' value. To avoid controversy regarding maximum harvest and growing days, I will calculate it based on Crops page Gold per Day value then calculate XP per Day value for it. [[User:Xyrsis|Xyrsis]] ([[User talk:Xyrsis|talk]]) 23:45, 1 October 2023 (UTC)
 +
 
 +
Missing xp/d values updated. Please check. [[User:Xyrsis|Xyrsis]] ([[User talk:Xyrsis|talk]]) 00:35, 2 October 2023 (UTC)
 +
 
 +
:So, this is the start of a discussion about the value of XP per day. Let's leave the discussion open ''before'' making the edits, please!
 +
 
 +
:Below is a mockup of the proposed section:
 +
<blockquote>
 +
<div style="font-size: larger; font-weight: bold;">XP per Day</div>
 +
Due to seed price, there is a slight calculation differences between the most profitable crops (Gold per day) and most XP yielding crops (XP per day). High quality crops grant the same amount of XP as normal-quality crops.
 +
 
 +
The general formula is:
 +
<code>Minimum XP per Day = (Max Harvests &times; XP per Harvest) / Growing Days </code>
 +
 
 +
'''Growing Days''' = <code>Days to Maturity + ((Max Harvests &minus; 1) &times; Days to Regrow)</code>
 +
 
 +
'''Days to Maturity''' and '''Days to Regrow''' are listed in each table.
 +
 
 +
'''Max Harvests''' is normally 1, but for crops that continue to produce, it is the actual number of harvests that can be obtained in the growing season(s).
 +
 
 +
{|class="wikitable sortable" style="float: left; margin-right: 18px;"
 +
|-
 +
!colspan="3"|Spring
 +
|-
 +
! Crop
 +
! XP
 +
! XP/d
 +
|-
 +
|{{name|Coffee Bean}}
 +
| 4
 +
| 1.32 <sup>1</sup><br /> 1.63 <sup>2</sup>
 +
|-
 +
|{{name|Tulip}}
 +
| 7
 +
| 1.15
 +
|-
 +
|{{name|Unmilled Rice}}
 +
| 7
 +
| 0.86 <sup>3</sup><br /> 1.15 <sup>4</sup>
 +
|-
 +
|{{name|Parsnip}}
 +
| 8
 +
| 1.95
 +
|-
 +
|{{name|Green Bean}}
 +
| 9
 +
| 2.08
 +
|-
 +
|{{name|Blue Jazz}}
 +
| 10
 +
| 1.47
 +
|-
 +
|{{name|Garlic}}
 +
| 12
 +
| 2.93
 +
|-
 +
|{{name|Potato}}
 +
| 14
 +
| 2.38
 +
|-
 +
|{{name|Kale}}
 +
| 17
 +
| 2.91
 +
|-
 +
|{{name|Strawberry}}
 +
| 18
 +
| 3.84 <sup>5</sup><br /> 3.07 <sup>6</sup>
 +
|-
 +
|{{name|Cauliflower}}
 +
| 23
 +
| 1.98
 +
|-
 +
|{{name|Rhubarb}}
 +
| 26
 +
| 1.97
 +
|-
 +
|{{name|Ancient Fruit}}
 +
| 38
 +
| 3.97*
 +
|-
 +
|{{name|Cactus Fruit}}
 +
| 14
 +
| 3.04 <sup>7</sup><br /> 4.39 <sup>8</sup>
 +
|}
 +
 
 +
{|class="wikitable sortable" style="float: left; margin-right: 18px;"
 +
|-
 +
!colspan="3"|Summer
 +
|-
 +
! Crop
 +
! XP
 +
! XP/d
 +
|-
 +
|{{name|Coffee Bean}}
 +
| 4
 +
| 1.32 <sup>1</sup><br /> 1.63 <sup>2</sup>
 +
|-
 +
|{{name|Hops}}
 +
| 6
 +
| 3.74
 +
|-
 +
|{{name|Wheat}}
 +
| 6
 +
| 1.49
 +
|-
 +
|{{name|Hot Pepper}}
 +
| 9
 +
| 2.67
 +
|-
 +
|{{name|Blueberry}}
 +
| 10
 +
| 2.28
 +
|-
 +
|{{name|Corn}}
 +
| 10
 +
| 1.58 <sup>1</sup><br /> 2.09 <sup>2</sup>
 +
|-
 +
|{{name|Tomato}}
 +
| 12
 +
| 2.17
 +
|-
 +
|{{name|Sunflower}}
 +
| 14
 +
| 1.78
 +
|-
 +
|{{name|Radish}}
 +
| 15
 +
| 2.57
 +
|-
 +
|{{name|Summer Spangle}}
 +
| 15
 +
| 1.93
 +
|-
 +
|{{name|Poppy}}
 +
| 20
 +
| 2.88
 +
|-
 +
|{{name|Melon}}
 +
| 27
 +
| 2.27
 +
|-
 +
|{{name|Red Cabbage}}
 +
| 28
 +
| 3.09
 +
|-
 +
|{{name|Starfruit}}
 +
| 43
 +
| 3.37
 +
|-
 +
|{{name|Ancient Fruit}}
 +
| 38
 +
| 3.97*
 +
|-
 +
|{{name|Cactus Fruit}}
 +
| 14
 +
| 3.04 <sup>7</sup><br /> 4.39 <sup>8</sup>
 +
|-
 +
|{{name|Taro Root}}
 +
| 16
 +
| 1.65 <sup>3</sup><br /> 2.35 <sup>4</sup>
 +
|-
 +
|{{name|Pineapple}}
 +
| 30
 +
| 2.83
 +
|}
 +
 
 +
{|class="wikitable sortable" style="float: left;"
 +
|-
 +
!colspan="3"|Fall
 +
|-
 +
! Crop
 +
! XP
 +
! XP/d
 +
|-
 +
|{{name|Wheat}}
 +
| 6
 +
| 1.49
 +
|-
 +
|{{name|Corn}}
 +
| 10
 +
| 1.58 <sup>1</sup><br /> 2.09 <sup>2</sup>
 +
|-
 +
|{{name|Eggplant}}
 +
| 12
 +
| 2.34
 +
|-
 +
|{{name|Bok Choy}}
 +
| 14
 +
| 3.57
 +
|-
 +
|{{name|Cranberries}}
 +
| 14
 +
| 2.53
 +
|-
 +
|{{name|Grape}}
 +
| 14
 +
| 3.43
 +
|-
 +
|{{name|Sunflower}}
 +
| 14
 +
| 1.78
 +
|-
 +
|{{name|Beet}}
 +
| 16
 +
| 2.75
 +
|-
 +
|{{name|Amaranth}}
 +
| 21
 +
| 2.99
 +
|-
 +
|{{name|Artichoke}}
 +
| 22
 +
| 2.71
 +
|-
 +
|{{name|Yam}}
 +
| 22
 +
| 2.17
 +
|-
 +
|{{name|Fairy Rose}}
 +
| 29
 +
| 2.44
 +
|-
 +
|{{name|Pumpkin}}
 +
| 31
 +
| 2.35
 +
|-
 +
|{{name|Ancient Fruit}}
 +
| 38
 +
| 3.97*
 +
|-
 +
|{{name|Sweet Gem Berry}}
 +
| 64
 +
| 2.67
 +
|-
 +
|{{name|Cactus Fruit}}
 +
| 14
 +
| 3.04 <sup>7</sup><br /> 4.39 <sup>8</sup>
 +
|}
 +
{{Clear}}
 +
:<sup>1</sup> 1 season
 +
:<sup>2</sup> 2 seasons
 +
:<sup>3</sup> Unirrigated
 +
:<sup>4</sup> Irrigated
 +
:<sup>5</sup> Planted on Spring 1
 +
:<sup>6</sup> Planted on Spring 13/14
 +
:<sup>7</sup> Planting season
 +
:<sup>8</sup> Each season thereafter
 +
:<nowiki>*</nowiki>Assumes seed crafted for free from [[Ancient Seed]] Artifact, grown for 3 seasons.</blockquote>
 +
:Opinions on the value and validity of the information are welcome! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 03:38, 2 October 2023 (UTC)
 +
::My bad for the edit, thanks for opening the discussion! [[User:Xyrsis|Xyrsis]] ([[User talk:Xyrsis|talk]]) 06:23, 2 October 2023 (UTC)
 +
 
 +
==Notation==
 +
The formula <samp>XP=||16 × ln(0.018 × PRICE + 1)||</samp> means round everything between the double-pipes to the nearest integer. I've seen ⌊x⌉ and [x] being used for "round to nearest integer" as well. Does anyone have any thoughts about what notation should be used on the wiki? Perhaps providing an explanation instead of relying on symbols would be better? (although this would require changing wording in all 12 languages)... Thoughts? [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 21:11, 18 October 2023 (UTC)
105,853

edits