Changes

Jump to navigation Jump to search
→‎Speed-Gro Mechanics: Copy from the Speed-Gro talk page on the old wiki
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)
1,078

edits

Navigation menu