Compare Two Values - Stardew Valley Food

159 Views Asked by At

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.

Stonefish
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.

Albacore
Price : 117
Energy:  35

Eel
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.

1

There are 1 best solutions below

5
On

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.