This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Template talk:QualityHealthGrid

From Stardew Valley Wiki
Jump to: navigation, search
This talk page is for discussing Template:QualityHealthGrid.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

Can this template be updated to hide silver and gold quality (e.g., for Cave Carrots)?
For reference, Template QualityPrice Template:Qualityprice contains code to hide silver/gold quality. I just don't know how to integrate it into this template myself. Thank you!! margotbean (talk) 19:31, 2 January 2017 (UTC)

I've integrated the hide argument from Template:Qualityprice and updated the documentation. --Vg-tal (talk) 03:16, 3 January 2017 (UTC)
Thank you very much!! :) margotbean (talk) 03:38, 3 January 2017 (UTC)

Calculation of Energy and Health Benefits

Details mentioned here refer to:

  1. First of all, Talk:Quality Stars#Note on Calculation of Price Bonuses, which proves that price bonuses are calculated using truncation, not rounding, and that when there are multiple bonuses, they are calculated separately, with the result of the first acting as the base for the calculation of the second, where there is truncation in both calculations, and where the calculation for quality precedes the calculation for profession.
  2. Second of all, Talk:Cauliflower#Price Generation by Infobox Template, which proves that Template:Infobox has a bug in its calculation method.
  3. And third of all, Template talk:Infobox#Pumpkin is broken, which indicates where the solution lies in the Infobox template.

This template calculates Energy and Health benefits for display, and it too has problems. Or perhaps I should say simply that it is inconsistent with Template:Infobox, in that they both do these calculations, but end up with different results in some cases. I cannot yet prove what the values ought to be, but I have a good guess which points to errors in this template rather than in Infobox. (It is definite that there is an error in one or the other.) Further, I suggest that the technique for eliminating the errors lies in the analysis I laid out in Talk:Quality Stars.

The root of the problem seems to lie in the fact that Health benefits are always 45% of Energy, and the calculation involved is just like that of applying a price bonus. My guess is founded in the supposition that the game program, which definitely computes quality price effects first, then applies profession bonuses to the result, will act consistently to do similarly with Energy and Health: apply quality bonuses, then convert Energy results to produce Health results. Implementation of this idea is simply a matter of performing the operations separately and correctly, and in the order required. A fix here could be as simple as the one I suggest at Infobox.

Now, let me prove that there really is a problem. Start with Cauliflower, and with what is correct. Regular quality grants 75E in benefit when eaten, and the E/H factor for gold quality is +80%. There, a gold Cauliflower grants 1.8 * 75 or 135E in benefit. There is no question of this, for there is a single calculation that yields no fractional result. Regular quality thus also grants 0.45 * 75 or 33.75H. The Cauliflower article (which uses Infobox) reports it as 33H, and the Crops article (which uses QualityHealthGrid) also reports 33H. Thus, both are agreed on truncation of the result rather than rounding, which is also what I would expect.

Now, how about a gold Cauliflower? The Cauliflower article reports 60H, while the Crops article reports 59H. How could this be? Well, 135E * 0.45 = 60.75, or 60H when truncated. However, 33H * 1.8 = 59.4, or 59H when truncated. I think Infobox is right in calculating the gold quality effect first, and this template is in error in not doing so. And I think so in part because the game confirms Pumpkin's Artisan values when calculations proceed in this order, and because I confirmed the same for Cauliflower and Kale with Tiller at Quality Stars.

Now look at Blueberry, whose article also uses Infobox. Energy is 25E for regular, 35E for silver, 45E for gold, all whole-number calculations. Both templates give 11H for regular and 15H for silver, as truncations mask any fractional differences in the calculations. However, Infobox gives 20H for gold, while QualityHealthGrid gives 19H, where the higher bonuses generate enough difference to trip over to the next or previous whole number when truncated.

Without question, there is a mass of inconsistencies like this on the Wiki right now, but I think I've locked into the fix for all of it. And - how wonderful - it should be easy for someone who knows how to write templates. Butterbur (talk) 23:52, 25 April 2017 (BST)

In just a few minutes I've verified that there are similar problems for most of the summer crops - more errors than correct answers. Butterbur (talk) 00:17, 26 April 2017 (BST)

Hops

Hmm. This template reports energy for silver Hops to be 62, but it must be 63. How did that happen? This is a different bug, for the factor between regular and silver is 1.4, midway between regular and gold, and the calculation works out to exact integers. There's no way the right value is 62 unless the factor really isn't 1.4, and then we'd have other anomalies all over the charts. Butterbur (talk) 00:11, 26 April 2017 (BST)

Chanterelle, Purple Mushroom, Cave Carrot, and Cactus Fruit all seem to be off by this same margin. Butterbur (talk) 02:16, 26 April 2017 (BST)

Fruit Tree Fruit

All regular quality Fruit Tree fruit confers 38E, just like regular Cranberry. However, regular Cranberry confers 17H, as expected, since 38 * 0.45 = 17.1. It's strange, then, that fruit tree fruit is reported to confer 15H, something more around 40% of 38. This is yet another bug, where the calculation is not done the same as for crops. Butterbur (talk) 00:28, 26 April 2017 (BST)