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

Scrap Meat Has No Iron(UPDATE:ALL FOODS MISSING 1 BASE VITAMIN?!) #63801

Open
Grubleafeater opened this issue Feb 26, 2023 · 9 comments
Open
Labels
(S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Grubleafeater
Copy link
Contributor

Grubleafeater commented Feb 26, 2023

Describe the bug

Scraps of meat have effectively no iron. When frying them, using 10 meat, I get a hunk of fried meat with ONE percent iron. (Edit:The iron was from the oil. Scrap meat had no contribution.)

Attach save file

N/A

Steps to reproduce

Butcher creature, get scrap meat, cook scrap meat into fried meat

Expected behavior

Scrap meat should have 10% of the iron that chunk meat does, and for that matter a shred of calcium as chunked meat has a tiny bit, too.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19044.2604 (21H2)
  • Game Version: 95521e0 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    No Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions],
    Xedra Evolved [xedra_evolved],
    Magiclysm [magiclysm],
    Blaze Industries [blazeindustries],
    SpeedyDex [speedydex],
    Stats Through Kills [stats_through_kills],
    Stats Through Skills [StatsThroughSkills],
    My Sweet Cataclysm [my_sweet_cataclysm]
    ]

Additional context

No response

@Grubleafeater Grubleafeater added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Feb 26, 2023
@Owlfren
Copy link
Contributor

Owlfren commented Feb 26, 2023

The 12% is "of RDI", recommended daily intake, not a percentage of the total or anything like that. Since scrap of meat is a tenth of the weight chunk is it would in fact appear to be accurate on that count. 12% for 300g is a bit on the low end for iron in meat mind you, but I expect that was the choice since we put all the meats in the same category.

@Grubleafeater
Copy link
Contributor Author

The 12% is "of RDI", recommended daily intake, not a percentage of the total or anything like that. Since scrap of meat is a tenth of the weight chunk is it would in fact appear to be accurate on that count. 12% for 300g is a bit on the low end for iron in meat mind you, but I expect that was the choice since we put all the meats in the same category.

You misunderstand.

1 chunk is 12%. 10 scraps are 1% total. Individually they have no listed iron.

@Grubleafeater
Copy link
Contributor Author

The 12% is "of RDI", recommended daily intake, not a percentage of the total or anything like that. Since scrap of meat is a tenth of the weight chunk is it would in fact appear to be accurate on that count. 12% for 300g is a bit on the low end for iron in meat mind you, but I expect that was the choice since we put all the meats in the same category.

You misunderstand.

1 chunk is 12%. 10 scraps are 1% total. Individually they have no listed iron.

Ah, hang on. The 1% is from the animal oil. Apologies. 10 scraps are 0%.

@Owlfren
Copy link
Contributor

Owlfren commented Feb 26, 2023

Can confirm, scraps of meat whether spawned in or gain from butchery do not contain any iron. Tested by spawning 20 cooked and eating, butchering a deer and then cooking ten that I ate and eating another ten raw. Waiting an hour after each, then checking vitamins. No iron.
Scraps of meat appear to have no iron despite json saying 1.

@Grubleafeater
Copy link
Contributor Author

Crosschatter on Discord says that it appears that the base foods are all missing 1 of each vitamin. Combining them works just fine, dividing them does too, but chocolate bars are supposed to have 8 of calcium and iron and only have 7.

@Grubleafeater Grubleafeater changed the title Scrap Meat Has Nearly No Iron Scrap Meat Has Nearly No Iron(UPDATE:ALL FOODS MISSING 1 BASE VITAMIN?!) Feb 26, 2023
@Grubleafeater Grubleafeater changed the title Scrap Meat Has Nearly No Iron(UPDATE:ALL FOODS MISSING 1 BASE VITAMIN?!) Scrap Meat Has No Iron(UPDATE:ALL FOODS MISSING 1 BASE VITAMIN?!) Feb 28, 2023
@pjf
Copy link
Contributor

pjf commented Mar 20, 2023

Base foods missing 1 of each vitamin would also explain why young leaves and burdock don't display any vitamin C, despite having 1% RDI each in the JSON files.

@pjf
Copy link
Contributor

pjf commented Apr 12, 2023

/confirmed

@github-actions github-actions bot added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Apr 12, 2023
@Kamayana
Copy link
Contributor

Kamayana commented Jun 22, 2023

It seems that RDA_to_default's conversion from RDA to the game's internal vitamin units (which I believe are at equilibrium at 96, rather than the 100 of RDA) has issues with floating points numbers getting converted into integers. An RDA value of 1% gets converted into 0.959999 which gets rounded to 0 after converting it to an integer, an RDA value of 23% gets rounded to 22.079999 which rounds to 22, and so on.

image

The function itself returns a float, but that gets immediately converted into an int since the nutrients struct stores vitamin values as integers: std::map<vitamin_id, int> vitamins;

In addition, this conversion is used before displaying RDA values when examining an item, rather than showing the RDA value like one would expect, so all those values are off as well.

I'm not sure how best to handle these issues. Rounding vitamin values between 0-1 up to 1 would fix the biggest problem of 1% vitamins being completely absent, but that wouldn't fix all the vitamin values being slightly off, and I don't understand the internal vitamin units well enough to make a judgement call. I'd like to request @bombasticSlacks give their input, since they overhauled vitamins in #59722 and could help determine what to do here.

@bombasticSlacks
Copy link
Contributor

Had to reread that PR lol, yeah it's 96 not 100 because it's on time ticks and that works out to 15 minute ticks. Easiest (and fine solution) is just to ceil the value so that you get a little more than correct rather than a little less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

5 participants