Skip to content

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Sep 19, 2025

Summary

None

Purpose of change

Fix #82950, i.e. formic acid recipes having enormous yields.

Describe the solution

Remove the "counts" entries from the recipes so the volume of the results matches the volume of inputs for the distillation recipe, and a loss of the alcohol (through evaporation) of the easier one.

Describe alternatives you've considered

Change the unit of acid from 250 ml to 1 ml and rework everything affected. It's possible whoever created the recipes with these huge counts intended it to produce 40 ml, but that's just a guess.

Testing

Viewed both recipes in the game and verified it now states the count produced is one. Created formic acid using the distillation recipe and verified the resultant amount of acid was indeed 1.

Additional context

I looked through the affected file looking for "counts" as well as for "acid" to see if other recipes were bugged, but found none. In particular, the chem_ascetic_acid and sulphuric acid recipes with blood directly following the formic acid ones did not contain any "counts" entries.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Sep 19, 2025
@PatrikLundell PatrikLundell marked this pull request as draft September 22, 2025 08:55
@PatrikLundell PatrikLundell marked this pull request as ready for review September 22, 2025 08:55
@PatrikLundell PatrikLundell marked this pull request as draft September 23, 2025 10:04
@PatrikLundell PatrikLundell marked this pull request as ready for review September 23, 2025 10:04
@PatrikLundell PatrikLundell marked this pull request as draft September 24, 2025 09:04
@PatrikLundell PatrikLundell marked this pull request as ready for review September 24, 2025 09:04
@GuardianDll
Copy link
Member

(~[slow] ~[.],starting_items)=> ../tests/iteminfo_test.cpp:2111: FAILED:
(~[slow] ~[.],starting_items)=>   CHECK( item_info_str( ice_cream, { iteminfo_parts::FOOD_NUTRITION, iteminfo_parts::FOOD_QUENCH } ) == "--\n" "Nutrition will <color_cyan>vary with chosen ingredients</color>.\n" "<color_c_white>Calories (kcal)</color>:" " <color_c_yellow>53</color>-<color_c_yellow>470</color>" "  Quench: <color_c_yellow>0</color>\n" )
(~[slow] ~[.],starting_items)=> with expansion:
Error: (~[slow] ~[.],starting_items)=>   "--
(~[slow] ~[.],starting_items)=>   Nutrition will <color_cyan>vary with chosen ingredients</color>.
(~[slow] ~[.],starting_items)=>   <color_c_white>Calories (kcal)</color>: <color_c_yellow>53</color>-
(~[slow] ~[.],starting_items)=>   <color_c_yellow>478</color>  Quench: <color_c_yellow>0</color>
(~[slow] ~[.],starting_items)=>   "
(~[slow] ~[.],starting_items)=>   ==
(~[slow] ~[.],starting_items)=>   "--
(~[slow] ~[.],starting_items)=>   Nutrition will <color_cyan>vary with chosen ingredients</color>.
(~[slow] ~[.],starting_items)=>   <color_c_white>Calories (kcal)</color>: <color_c_yellow>53</color>-
(~[slow] ~[.],starting_items)=>   <color_c_yellow>470</color>  Quench: <color_c_yellow>0</color>
(~[slow] ~[.],starting_items)=>   "

what the fuck?

@PatrikLundell
Copy link
Contributor Author

How would I know? This garbage has appeared in a fair number of PRs lately, which is why I've mostly stopped bothering to look at failures.

I very much doubt formic acid is a part of the ice cream recipe, and as you can see from the changes, that's all there is to this PR.

@GuardianDll
Copy link
Member

Sorry, i didn't mean it to you, just a general exclamation. I just thought it is related to the change (because i never saw this specific error, also it appeared in two tests) and i could not find a correlation between ice cream recipe and this recipes of formic_acid
I will restart the test, but i still think it is related to your changes in some way, tho i am not familiar how

@PatrikLundell
Copy link
Contributor Author

PatrikLundell commented Sep 25, 2025

Cataclysm Windows build / Build (pull_request) goes completely ape shit. It seems to be failing to download a lot of stuff.

The icecream recipe test generates an upper limit of 478 kcal rather than the hard coded expected value of 470.
I would guess someone has adjusted some calorie count for some icecream ingredient during the last few weeks.

Presumably one of these:

    "components": [
      [ [ "milk_standard", 2, "LIST" ] ],
      [
        [ "chocolate", 1 ],
        [ "peanutbutter", 1 ],
        [ "syrup", 1 ],
        [ "syrup_corn", 1 ],
        [ "candy", 1 ],
        [ "candy2", 1 ],
        [ "candy3", 1 ],
        [ "candy4", 1 ],
        [ "candy5", 1 ],
        [ "candy3gator", 1 ],
        [ "cow_candy", 1 ],
        [ "marshmallow", 1 ],
        [ "maple_candy", 1 ],
        [ "strawberries", 1 ],
        [ "strawberries_cooked", 1 ],
        [ "blueberries", 1 ],
        [ "blueberries_cooked", 1 ],
        [ "wintergreen_berry", 4 ],
        [ "blackberries", 1 ]
      ],
      [ [ "sugar", 20 ], [ "artificial_sweetener", 20 ] ]
    ]

Edit:
I can recreate the error message running the test locally (hidden among a huge number of other failures), and it does indeed disappear when the changes are rolled back (unless I failed to find it among the chaff). It still doesn't make sense, though.

Changing the number of charges to 20 (half of the original 40) changes the failure message to a maximum calorie count of 471 rather than 478.

I think this is caused by the usage of blood as an ingredient, and the acid then inheriting calories. When divided by 40 the calories are too low to have an effect on food that are preserved using weak acids. However, my attempts to use the NUTRIENT_OVERRIDE flag don't seem to have any effect.
No, the calories are coming from the alcohol, not the blood. Removing the alcohol component line from the recipes causes the error report to go away.

@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Sep 26, 2025
@PatrikLundell
Copy link
Contributor Author

PatrikLundell commented Sep 26, 2025

Finally found the bugger. Booze used for production of formic acid contributed calories to the acid, and then on to the blasted ice cream from something preserved with the acid.

Muriatic acid could have the same issue if chemicals, such as coffein, also can contain calories. Didn't see it used for "real" food, though (was looking for usages of mixed alcohol).

As an aside, I tried to set the NUTRIENT_OVERRIDE flag on the blood based recipes, and that had neither any effect nor generated a warning that it wouldn't. This kind of recipes, where calorie dense ingredients are removed as byproducts (at a loss), are definitely ones where you might want to set an override on the recipe but not on the product (in this case it makes sense to have it on the product, though, but that's not necessarily the case in general).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Sep 26, 2025
@Maleclypse Maleclypse merged commit 6318722 into CleverRaven:master Sep 28, 2025
28 checks passed
@PatrikLundell PatrikLundell deleted the acid_fix branch September 28, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recipes for formic acid from blood have incorrect yield
3 participants