Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different fruit produce different amounts of wine when the number of kegs is the limiting factor. #76

Open
Pluranium-Alloy opened this issue Jun 11, 2024 · 3 comments

Comments

@Pluranium-Alloy
Copy link

Different fruit produce different amounts of wine when the number of kegs is the limiting factor.

2024-06-11 (1)
2024-06-11

Both crops produce significant amounts of excess fruit yet, somehow, the calculator shows that the ancient fruit produces almost twice as much wine as the starfruit despite that. According to the wiki, the time taken to produce wine does not vary based on what fruit you use so, since starfruit is more valuable, it should be more profitable if the number of kegs is the limiting factor (limiting number of kegs can be useful to simulate a limited number of casks as one keg can supply 8 casks).

@doodlebunnyhops
Copy link
Contributor

In this case starfruit produces after 13 days and ancient fruit after maturity of 28 days regrows every 7 - thus ancient fruit would produce more. Given you have 108 crops spanning 7000 days the amount of crops produced is right.

However equipment isn't considering how long it takes to convert to said item. <- and would actually produce more excess crops unused in converting to an artisan item if time was factored. With only 16 kegs useable, 1 day to convert, and also assumes you can only use the keg on harvest, you would have ~8k keg items made from star fruit.

So the real ask is to update equipment with time factor to produce an artisan item.

@Thorinair
Copy link
Owner

Indeed, this behavior is expected, because the equipment is applied as per-harvest, and ignores the time it takes to process the crops. I agree that this is a limitation.

Implementing code to account for processing times would get extremely complicated, as this time varies on time of day when the crop was placed into the equipment, and some other factors. See the note here: https://stardewvalleywiki.com/Keg#Products It would also be an additional layer of code complication as you would have to somehow simulate each crop hour by hour and how it is harvested/processed.

Because of this, there are currently no plans to implement time calculations, unless someone adventurous enough feels like writing this complex code. One alternative that could be done is to add an option to do one big processing at the end of the season, similar to the option that currently exists for Dehydrators, but I don't think anyone processes all of the fruit at the end of the season, so it was never really considered.

@IG2WTC
Copy link
Contributor

IG2WTC commented Aug 2, 2024

Those are just some thoughts on how it might be possible to add it in an "easy" way (which will approximate some numbers but should be quite a bit more accurate than the current system). I might try to write something like that on the weekend.

  1. Compromise and always assume the 3 day processing time. (When actually playing this will happen most of the time, so the actual output will only be slightly higher.)

  2. Regarding our Jar processing capacity we could do something like this:
    if regrow = false -> Math.floor((growth * (Harvests - 1)) + (Total days - growth * Harvests - 1 ) / 3) = Jar cycles
    else -> Math.floor((regrow * (Harvests - 1)) + (Total days - growth - regrow * (Harvests - 1) - 1) = Jar cycles
    Jar cycles * Jars = max Jar processes

  3. Don´t account for Produce that will be done to late to be processed:
    Math.floor(per Plant * (Harvests - 1) * Plants) + Math.min( Math.floor(regrow > 0 ? (Total days - grow - regrow * (Harvests - 1) - 1) / 3 : (Total days - grow * Harvests - 1) / 3 ) * Plants, Plants * per Plant) = Produce available

  4. Now we need to calculate much we can actually process:
    If available Produce > max Jar processes -> max Jar processes = Jar Produce
    Else -> available Produce = Jar Produce

  5. Now we just check how much Raw Produce is left:
    Math.floor(per Plant* Harvests * Plants) = Produce
    if Produce available > max Jar processes -> Produce - max Jar processes = Raw Produce
    Else -> Produce - Produce available = Raw Produce

With those rules we should be able to work for any compatible Produce I can think of.

Here I have proof that those calculations seem to give correct (or at least close to correct) Answers:
https://docs.google.com/spreadsheets/d/1KvMAcuGMZbub1BJdUThZCSidJXj2YaqIfXLPQHohguQ/edit?usp=sharing

I implemented in my fork:
https://ig2wtc.github.io/Stardew-Profits/

So far, I have not even found any incompatibility with settings. If you find something, please tell me.
Edit: Kegs are a little borked, but I will check it soon.
Edit: I think I fixed Kegs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants