Difference between revisions of "Talk:Crop Growth Calendars"

From Stardew Valley Wiki
Jump to navigation Jump to search
(→‎Speed-Gro Glitch: new section)
m (Text replacement - "tt>" to "samp>")
 
(7 intermediate revisions by 2 users not shown)
Line 23: Line 23:
 
[[User:Maiken|Maiken]] ([[User talk:Maiken|talk]]) 18:41, 29 March 2021 (UTC)
 
[[User:Maiken|Maiken]] ([[User talk:Maiken|talk]]) 18:41, 29 March 2021 (UTC)
 
:You are absolutely correct, I've updated the page with the correct stages.  Thanks so much! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 18:53, 29 March 2021 (UTC)
 
:You are absolutely correct, I've updated the page with the correct stages.  Thanks so much! [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 18:53, 29 March 2021 (UTC)
 
==Speed-Gro Mechanics==
 
Speed-gro, Deluxe Speed-gro, and the Agriculturist profession are all calculated in the same way where they contribute to a certain percentage discount on the number of days a crop will spend in its growing stages.
 
 
For Speed-gro, the discount is 10%, for Deluxe Speed-gro it is 25%. Agriculturist will add an extra 10% discount to whatever the discount was before.
 
 
The discount is applied the moment the seed is planted. However, there are two details which complicates the calculations.
 
 
===Floating point imprecision===
 
 
The precise number of days discounted is multiplied using 32 bit floating point arithmetic, which has a small amount of imprecision. The result is then rounded up, which may result in surprising numbers. Let's look at an example, Green Beans with Speed-Gro.
 
 
First we have an array with the number of days the crop spends in each growing stage.
 
 
    int[] greenBeanStages = new [] { 1, 1, 1, 3, 4 };
 
 
Then we add all those numbers together to get the total number of days the crop spends growing.
 
 
    int totalDaysGrowing = 10;
 
 
This is the weird part. Floating point imprecision means that 0.1 * 10 isn't 1, it's 1.00000001490116
 
 
    float discountFactor = 0.1;
 
    float daysDiscounted = (float)totalDaysGrowing * discountFactor;
 
 
The number of discounted days are rounded up
 
 
    double result = Math.Ceiling( (double) daysDiscounted );
 
 
And the result of Math.Ceiling( 1.00000001490116 ) is, of course, 2. That is why Green Beans with Speed-Gro gets two discounted days, 20%, instead of just the one.
 
 
===The fully grown stage===
 
 
When the discount is applied, the game will decrease the number of days the crop spends in each growth stage sequentially, one day from each stage at a time, until it has removed the number of total days calculated in the last step. However, all crops have a final, fully grown stage, and sometimes the number of discounted days are enough to reach into and discount from this final stage as well. This results in a wasted discount day. Let's look at an example, Ancient Fruit planted on Deluxe Speed-gro.
 
 
{| class=wikitable style="text-align:center;"
 
|-
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|-
 
|Number of days
 
|2
 
|7
 
|7
 
|7
 
|5
 
|-
 
|}
 
 
This is a total of 28 growing days, and with a 25% discount that gives us 7 discounted days.
 
 
Before the discount is applied, the fully grown stage is added.
 
 
{| class=wikitable style="text-align:center;"
 
|-
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|2
 
|7
 
|7
 
|7
 
|5
 
|99999
 
|-
 
|}
 
 
Yes, 99999 is the actual number of days in the final stage. Somewhere around 900 in-game years.
 
 
Now the days are discounted, one at a time, from the different stages starting with the first stage:
 
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 1
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|style="color:red"|1
 
|7
 
|7
 
|7
 
|5
 
|99999
 
|-
 
|}
 
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 2
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|style="color:red"|6
 
|7
 
|7
 
|5
 
|99999
 
|-
 
|}
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 3
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|6
 
|style="color:red"|6
 
|7
 
|5
 
|99999
 
|-
 
|}
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 4
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|6
 
|6
 
|style="color:red"|6
 
|5
 
|99999
 
|-
 
|}
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 5
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|6
 
|6
 
|6
 
|style="color:red"|4
 
|99999
 
|-
 
|}
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 6
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|6
 
|6
 
|6
 
|4
 
|style="color:red"|99998
 
|-
 
|}
 
{| class=wikitable style="text-align:center;"
 
|-
 
| rowspan=2 | 7
 
| Stage:
 
|[[File:Ancient Fruit Stage 1.png|center|link=]]
 
|[[File:Ancient Fruit Stage 2.png|center|link=]]
 
|[[File:Ancient Fruit Stage 3.png|center|link=]]
 
|[[File:Ancient Fruit Stage 4.png|center|link=]]
 
|[[File:Ancient Fruit Stage 5.png|center|link=]]
 
|[[File:Ancient Fruit Stage 6.png|center|link=]]
 
|-
 
|Number of days
 
|1
 
|style="color:red"|5
 
|6
 
|6
 
|4
 
|99998
 
|-
 
|}
 
 
Note that in step 6, the discounted stage is the fully grown stage, resulting in a lost discount day.
 
 
Also note that the first stage can't be discounted to zero, so the discount skips past that stage to the next one in step 7. The other stages can be discounted to zero, it is just the first stage that can't.
 
 
The final number of days the crop will spend growing is, as demonstrated above, 1+5+6+6+4 = 22. Meaning we actually got 6 discounted days instead of 7.
 
--[[User:Zaz|Zaz]] ([[User talk:Zaz|talk]]) 04:56, 6 December 2017 (BST)
 
 
:Do you happen to know when this changed? If I remember correctly, the growth discount used to be capped by the number of growth stages (sans the final day), so the maximum anything could have been reduced by was 5. But that's good that it works this way now. It makes sense for some of the longer growing craps. --[[User:Eienshi09|Eienshi09]] 14:26, 25 April 2018 (PST)
 
  
 
== Speed-Gro Glitch ==
 
== Speed-Gro Glitch ==
 +
Apart from [https://stardewcommunitywiki.com/Talk:Speed-Gro Speed-Gro Mechanics], there's another bug in ConcernedApe's codes. When he calculated the days to be removed, he didn't consider the situation where days of the stage is less than 0 day.
  
Apart from [[#Speed-Gro Mechanics|Speed-Gro Mechanics]], there's another bug in ConcernedApe's codes. When he calculates the days to be removed, he doesn't consider the situation where days of the stage is less than 0 day.
+
Let's take grape as an example. The stage of grape is <code>{1, 1, 2, 3 ,3}</code> in the <samp>crops.xnb</samp>. When we have Hyper Speed-Gro and Agriculturist at the same time, the speed increase should be 0.43. 0.43 * (1+1+2+3+3) = 4.3 ≈ 5. Therefore, 5 days should be removed from the grapes' growth stage. It should take 5 days to grow and can be harvested on the 6th day. The following is the normal process:
 
 
Let's take grape as an example. The stage of grape is <code>{1, 1, 2, 3 ,3}</code> in the <tt>crops.xnb</tt>. When we have Hyper Speed-Gro and Agriculturist at the same time, the speed increase should be 0.43. 0.43 * (1+1+2+3+3) = 4.3 ≈ 5. Therefore, 5 days should be removed from the grapes' growth stage. It should take 5 days to grow and can be harvested on the 6th day. The following is the normal process:
 
  
 
<code>{1, 1, 2, 3 ,3}</code> --step 1-->  
 
<code>{1, 1, 2, 3 ,3}</code> --step 1-->  
Line 280: Line 48:
  
 
The growth calendar of grapes is now correct. The purpose of editing this topic is to explain how this happened. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 16:38, 20 April 2021 (UTC)
 
The growth calendar of grapes is now correct. The purpose of editing this topic is to explain how this happened. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 16:38, 20 April 2021 (UTC)
 +
 +
== Using module to replace this page ==
 +
I have completed a module to output crop growth calendars, see Module:Crop Growth Calendars. And it works well now. You can see the page using this module here: [https://stardewvalleywiki.com/mediawiki/index.php?title=User:Horizon98/Sandbox&oldid=119223 User:Horizon98/Sandbox]. I have compared the sandbox and [[Crop Growth Calendars]], everything works well. Furthermore, translating this page can be very easy. Just translate the table <code>Dictionary</code> of the Module (only 30 words or sentences need to be translated), and then all calendars are translated. See this page on zh wiki: [[:zh:作物生长日历]].
 +
 +
Besides, the 25% Irrigated table of Unmilled Rice is incorrect now. It should take 4 days to grow instead of 5 days. I have tested in the game. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 16:39, 20 April 2021 (UTC)
 +
:I have also tested all crops' growths with and without Agriculturist, and updated the English page accordingly.  At this point, all one needs to do is copy the information to the other languages in a text editor, skipping the parts that are already translated.  This is on my "to do" list, as soon as I can get through checking other edits and fixing other problems.
 +
:I appreciate that you put the work into creating the module, but implementing it in the other languages would be more work than has already been done.  In addition, it reflects the current 1.5 code, but would need to be updated to reflect any future changes in the code, so it doesn't really help there.
 +
:Please remember to discuss any major changes like this ''before'' implementing them.  I can't stress that enough.  It takes hours to keep the wikis maintained and consistent, and undoing changes made without discussion detracts from the time that could be spent updating pages.  Thank you for your work, [[User:Margotbean|margotbean]] ([[User talk:Margotbean|talk]]) 19:05, 20 April 2021 (UTC)
 +
 +
::Firstly, I don't think translating such a complex page could be simpler than translate only 30 keys in the dictionary table (about 50 English words totally). And I have translated the module to Chinese successfully. This page takes more than 300,000 bytes now, which is too large to edit. When I edit the whole page in Chrome now, there's even a delay more than 1 second after I typing words. If necessary, I will help with this translation on other language wikis. Furthermore, updating the translation of other languages' pages could be much easier, see the second point.
 +
 +
::Secondly, if there are more crops in the future, it's convenient to add new crop data from <samp>crops.xnb</samp> into the data table. The code should be updated when there are other types of speed-gro or something else that change the speed increase. But it's not complex, I can write the method in the document. Besides, this module also support returning only one single table when use the <samp>"mode"</samp> argument. It's simpler than updating the current page in this situation.
 +
 +
::Thirdly, I didn't implement any major change except for updating the [[:zh:作物生长日历]] and copying [[template:Addlanglinks]] to zh wiki, because there's no one else to talk with on zh wiki :( and these changes work well. You have undone these changes, but I don't think these operations will take you more than 15 minutes.
 +
 +
::Fourthly, <s>the module is still a draft</s> (edited). So I start a discussion here, and ''I haven't'' edited any major change on the English wiki.
 +
 +
::Fifthly, the 25% Irrigated table of Unmilled Rice is incorrect as I said before. You can test this in the game.
 +
 +
::At last, thanks for all your work to maintain and update this wiki. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 06:45, 21 April 2021 (UTC)
 +
 +
== Taro Root's season ==
 +
[[Taro Root]] grows in summer, but this page classifies this crop as [[Crop Growth Calendars#Other Crops|Other Crops]]. I think that it could be moved to [[Crop Growth Calendars#Summer Crops|Summer Crops]]. [[User:Horizon98|Horizon98]] ([[User talk:Horizon98|talk]]) 10:43, 22 April 2021 (UTC)

Latest revision as of 18:47, 4 November 2021

This talk page is for discussing Crop Growth Calendars.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

Archive

The archived talk page can be found at https://stardewcommunitywiki.com/Talk:Crop_Growth_Calendars --margotbean (talk) 02:56, 20 February 2021 (UTC)

Ancient Fruit (Deluxe Speed-Gro) should have 22 days

The calendar for Ancient Fruit, Deluxe Speed-Gro mentions that the fruit is fully grown after 20 days. This should be 22 days. I tested this in Stardew Valley 1.5 multiple times. Does anybody else have the same result in their game? The stages are as follows in my game for Ancient Fruit with Deluxe Speed-Gro.

Growth phases
Stage Days
Stage 1 1 days
Stage 2 5 days
Stage 3 5 days
Stage 4 6 days
Stage 5 4 days

Maiken (talk) 18:41, 29 March 2021 (UTC)

You are absolutely correct, I've updated the page with the correct stages. Thanks so much! margotbean (talk) 18:53, 29 March 2021 (UTC)

Speed-Gro Glitch

Apart from Speed-Gro Mechanics, there's another bug in ConcernedApe's codes. When he calculated the days to be removed, he didn't consider the situation where days of the stage is less than 0 day.

Let's take grape as an example. The stage of grape is {1, 1, 2, 3 ,3} in the crops.xnb. When we have Hyper Speed-Gro and Agriculturist at the same time, the speed increase should be 0.43. 0.43 * (1+1+2+3+3) = 4.3 ≈ 5. Therefore, 5 days should be removed from the grapes' growth stage. It should take 5 days to grow and can be harvested on the 6th day. The following is the normal process:

{1, 1, 2, 3 ,3} --step 1--> {1, 0, 2, 3 ,3} --step 2-->

{1, 0, 1, 3 ,3} --step 3--> {1, 0, 1, 2 ,3} --step 4-->

{1, 0, 1, 2 ,2} --step 5--> {1, 0, 0, 2 ,2}

While in the code and game, the actual process is:

... --step 4-->

{1, 0, 1, 2 ,2} --step 5--> {1, -1, 1, 2 ,2}

Therefore, the grapes take 1 + 0 + 1 + 2 + 2 = 6 days to grow, and can be harvested on the 7th day. I have tested this in the game, and it actually takes 6 days to grow.

The growth calendar of grapes is now correct. The purpose of editing this topic is to explain how this happened. Horizon98 (talk) 16:38, 20 April 2021 (UTC)

Using module to replace this page

I have completed a module to output crop growth calendars, see Module:Crop Growth Calendars. And it works well now. You can see the page using this module here: User:Horizon98/Sandbox. I have compared the sandbox and Crop Growth Calendars, everything works well. Furthermore, translating this page can be very easy. Just translate the table Dictionary of the Module (only 30 words or sentences need to be translated), and then all calendars are translated. See this page on zh wiki: zh:作物生长日历.

Besides, the 25% Irrigated table of Unmilled Rice is incorrect now. It should take 4 days to grow instead of 5 days. I have tested in the game. Horizon98 (talk) 16:39, 20 April 2021 (UTC)

I have also tested all crops' growths with and without Agriculturist, and updated the English page accordingly. At this point, all one needs to do is copy the information to the other languages in a text editor, skipping the parts that are already translated. This is on my "to do" list, as soon as I can get through checking other edits and fixing other problems.
I appreciate that you put the work into creating the module, but implementing it in the other languages would be more work than has already been done. In addition, it reflects the current 1.5 code, but would need to be updated to reflect any future changes in the code, so it doesn't really help there.
Please remember to discuss any major changes like this before implementing them. I can't stress that enough. It takes hours to keep the wikis maintained and consistent, and undoing changes made without discussion detracts from the time that could be spent updating pages. Thank you for your work, margotbean (talk) 19:05, 20 April 2021 (UTC)
Firstly, I don't think translating such a complex page could be simpler than translate only 30 keys in the dictionary table (about 50 English words totally). And I have translated the module to Chinese successfully. This page takes more than 300,000 bytes now, which is too large to edit. When I edit the whole page in Chrome now, there's even a delay more than 1 second after I typing words. If necessary, I will help with this translation on other language wikis. Furthermore, updating the translation of other languages' pages could be much easier, see the second point.
Secondly, if there are more crops in the future, it's convenient to add new crop data from crops.xnb into the data table. The code should be updated when there are other types of speed-gro or something else that change the speed increase. But it's not complex, I can write the method in the document. Besides, this module also support returning only one single table when use the "mode" argument. It's simpler than updating the current page in this situation.
Thirdly, I didn't implement any major change except for updating the zh:作物生长日历 and copying template:Addlanglinks to zh wiki, because there's no one else to talk with on zh wiki :( and these changes work well. You have undone these changes, but I don't think these operations will take you more than 15 minutes.
Fourthly, the module is still a draft (edited). So I start a discussion here, and I haven't edited any major change on the English wiki.
Fifthly, the 25% Irrigated table of Unmilled Rice is incorrect as I said before. You can test this in the game.
At last, thanks for all your work to maintain and update this wiki. Horizon98 (talk) 06:45, 21 April 2021 (UTC)

Taro Root's season

Taro Root grows in summer, but this page classifies this crop as Other Crops. I think that it could be moved to Summer Crops. Horizon98 (talk) 10:43, 22 April 2021 (UTC)