In the game, Stardew Valley, you can pick up items through farming, fishing, foraging, cooking, etc. Most tasks use up your character's energy, such as swinging an axe or using using a watering can. Most items in the game can be sold to get gold or consumed to increase your energy for the day.

A good portion of the early game involves balancing selling items to increase wealth versus consuming these items, to increase energy, in order to perform more tasks throughout the day.

I made a spreadsheet of all consumable items and their associated gold and energy values. I would like to place each consumable item into one of two different categories, EAT or SELL. I've been trying to form an equation that plugs both numbers in and tells me which category each item should go into, but I haven't had much luck.

For reference, items can be sold between 30 and 700 gold and have between -125 and 263 energy (Negative energy is detrimental to character health). Also, the character's maximum energy stored is initially 270, which can be further upgraded to 508 as the game goes on.

Some items can easily categorized, and the equation should be able to do so.

Price : 200
Energy:   0

Stonefish should be sold, since it doesn't provide the player any energy upon consumption.

Void Salmon
Price : 234
Energy:  88

Void Salmon should probably be consumed due to how much energy it gives versus its sales price.

Some items are a little more difficult to categorize because one of the properties doesn't dwarf the other.

Price : 117
Energy:  35

Price : 132
Energy:  42

Without analysis, it's difficult to determine which category Albacore and Eel should fall into. I would like to make a hard-line that each item falls into one, and only one category. I broke out the old algebra/pre-calculus book looking for what this type of problem is called, but I'm drawing a blank.

  • $\begingroup$ Unless you can say what the value of energy in terms of gold is, there is no way to answer this question. $\endgroup$ – saulspatz Jan 30 at 16:41
  • $\begingroup$ I figured it could be based on all available items. Could average energy, average gold values, a ratio of the two per item, or some other metric be used to get a decent enough comparison? $\endgroup$ – Swiftmatt Jan 30 at 16:58

An easy way you could make this decision is based on Price/Energy ratio. As you've pointed out, for some items this is pretty obvious. You could continue to be relatively unscientific and maybe settle on some arbitrary value as your cutoff by going through the items and thinking "would I eat this or sell it?". You could be more scientific by trying to measure the maximum amount of money you can earn per energy point and then basing your cutoff on that.

I'm unfamiliar with Stardew Valley inventory management, but I think I remember it being a bit like Minecraft where you have pretty limited space. This adds a dimension of complexity because an item with Price = 10 and Energy = 0 is obviously worth selling rather than eating, but it may be more efficient not to pick up the item at all because you'd be better off selling something with Price = 50 and Energy = 10. When you start thinking about it this way, it starts to remind me a bit of the Knapsack Problem. You could get around trying to solve this by attempting to heuristically (maybe even there's a more scientific way?) determine how much energy or money you want each inventory space to be worth. A lot of this would break down to output per time, where you need to consider how long it takes you to earn money or energy providing items, and how long it would take you to go and sell them.

  • $\begingroup$ Very early game, inventory space is an issue, but is quickly remedied. So, I personally wouldn't worry too much about that point. I totally agree with your stance on setting a ratio of Eat:*Sell*. If I were to, say, cut the line at 50%, how can I get a "rating" of the two numbers so that it falls on either side of the 50% mark? Once I have the equation, is there a metric I could use to determine if the 50% mark is worth while? $\endgroup$ – Swiftmatt Jan 31 at 1:00
  • $\begingroup$ I'm not entirely I understand your follow-up question because I'm suggesting to set the line in such a way that all items on one side are "eat" and all items on the other side are "sell". To try and determine this line, I think the best way is to estimate how much energy you consume in an amount of time, and how much money you can earn in that time. This should give you a valuation of money/energy and you can use that as your line, maybe adjusting in the future as necessary. $\endgroup$ – kcborys Jan 31 at 16:57
  • $\begingroup$ This might become an iterative process: for example maybe you arbitrarily choose 3:1 money:energy as your line. You grind for 20 minutes, do the math on how much energy and money you're earning, and maybe you realize that 2.8 : 1 is a better valuation. I don't know how much variance there is in money-earning but if you make your measurement periods large enough (say 2 hours rather than 20 minutes) you should hope to converge on a good value. $\endgroup$ – kcborys Jan 31 at 17:00
  • $\begingroup$ Sorry for the misunderstanding. By "50%", I meant starting with a ratio of 1:1. So half of the items get sold while the other half get consumed. I see what you mean by this being an "iterative" process. The ratio may have to change depending on my needs. Sometimes, you may run through all stored consumables, making the EAT category more favorable, while a stockpile of consumables would make the SELL category more favorable. So that brings me back to the measurement of each item. What function can I run on both of these values to give them a common rating upon which I can measure them? $\endgroup$ – Swiftmatt Jan 31 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.