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

Crafting canned juice yield's product with varying caloric and nutritional values. #38071

Closed
sharkfinsouperman opened this issue Feb 16, 2020 · 4 comments · Fixed by #38127
Closed
Labels
<Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling
Milestone

Comments

@sharkfinsouperman
Copy link

Describe the bug

Batch crafted four jars of juice using raspberries, three cans using strawberries, and juice in the normal manner using huckleberries which were stored in two glass bottles.

While the batch of juice in the glass bottles is constant, the other two are not.

Steps To Reproduce

Batch craft juice in cans and jars using fresh fruit.

Expected behavior

Juice crafted from a single stack of fruit should produce a consistent end product.

Screenshots

image

Versions and configuration

Build 10309
Win7
Mods: No Fungal Creatures

Additional context

Note: The plastic bottles of juice are the result of issue #38060.

@sharkfinsouperman
Copy link
Author

I just noticed they also have different nutritional values even though they were batch crafted from a single stack of fresh fruit.

@sharkfinsouperman sharkfinsouperman changed the title Canned juice yield's product with varying caloric values. Crafting canned juice yield's product with varying caloric and nutritional values. Feb 17, 2020
@TechyBen
Copy link
Contributor

TechyBen commented Feb 17, 2020

The difference from different berries/fruits/foods is working as intended AFAIK. When it comes to stacks, are these multiple ages/qualities, but not displayed to the player? I guess they'd need to be tested in debug mode with values?

PS, the negative values do seem to be a bug though, a similar was happening with (IIRC) icecream at some point as some math went wrong in the multiple part additions.

@sharkfinsouperman
Copy link
Author

sharkfinsouperman commented Feb 17, 2020

It was my mistake in not being clear enough.

I had picked the fruit minutes before crafting each different batch, and I used different fruit for each batch to see if the bug was restricted to specific fruit.

The nutritional difference I'm referring to isn't between different fruit, its between juice from the same kind of fruit, from the same stack, resulting from the same batch craft.

To keep the results current to any game changes made, I have updated my game to 10336 in order to include the recipe change ( #38060 ), harvested two new batches of fruit, batch crafted four cans of juice using Rose hips, and batch crafted four jars of juice using Pears.

Here is the freshly harvested fruit to be used in my inventory:
image

Here is a comparison between the two most extreme cases from the batch of four cans:
image

Here is a comparison between the two most extreme cases from the batch of four jars:
image

From the above images, you see there is a difference between calories and vitamin C content, and in one case the vitamin C content is a negative value.

I hope this helps clear things up.

jkraybill added a commit to jkraybill/Cataclysm-DDA that referenced this issue Feb 18, 2020
@jkraybill
Copy link
Contributor

@sharkfinsouperman thanks for the excellent notes. This was a bug that would affect any future recipe that has charges, has variable inputs/calories, has by-products, and is batch-crafted. The issue is that the by-products "build up" during batch crafting and their nutrients get deducted from each produced item. So the first item has the right nutrients, but each subsequent item has insufficient nutrients off by the amount of byproducts (in the case of fruit juice, the pulp).

I submitted a fix that works, hopefully it passes code review :)

@ifreund ifreund added <Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Feb 18, 2020
@ifreund ifreund added this to the 0.E milestone Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants