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

Flatbread has 9x more calories than player crafted flatbread. #35800

Closed
Bejofo opened this issue Dec 1, 2019 · 8 comments · Fixed by #35875
Closed

Flatbread has 9x more calories than player crafted flatbread. #35800

Bejofo opened this issue Dec 1, 2019 · 8 comments · Fixed by #35875
Labels
Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding

Comments

@Bejofo
Copy link
Contributor

Bejofo commented Dec 1, 2019

Describe the bug

Crafted flatbread yields far too little calories.

Steps To Reproduce

  1. Debug spawn some wheat & water.
  2. Craft dough.
  3. Using dough craft flatbread.
  4. Notice the pitiful amount of calories it contains.

Expected behavior

Crafted flatbread to have more or less similar caloric value to normal flatbread.

Screenshots

Crafted flatbread on the left, flatbread I debug spawned on the right.
Crafted flatbread has exactly 9 times less calories than normal flatbread.
image

Versions and configuration

  • OS: Windows
  • OS Version: 10.0 1903
  • Game Version: 0.D-9376-gb17746f [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Mythical Martial Arts [MMA],
    EZ-Mode Medical [fast_healing],
    Hydroponics [hydroponics],
    Mutant NPCs [mutant_npcs],
    Vehicle Additions Pack [blazemod],
    Roadheader and other mining vehicles [Heavy miners],
    Folding Parts pack [deoxymod],
    Tanks and Other Vehicles [Tanks],
    Aftershock [aftershock],
    Craftable Gun Pack [craftgp],
    DeadLeaves' Fictional Guns [FIC_Weapons],
    Icecoon's Arsenal [ew_pack],
    Makeshift Items Mod [makeshift],
    Medieval and Historic Classes and Shields [Medieval_Stuff],
    More Survival Tools [More_Survival_Tools],
    Mundane Zombies [Mundane_Zombies],
    No Acid Zombies [No_Acid_Zombies],
    No Ants [No_Anthills],
    No Bees [No_Bees],
    No Monsters [Only_Wildlife],
    No Fungal Monsters [No_Fungi],
    No Big Zombies [No_Big_Zombies],
    No Explosive Zombies [No_Explosive_Zombies],
    No Spiders [No_Spiders],
    Whitelist [Whitelist],
    Classes and Scenarios Mod [more_classes_scenarios],
    Classic Roguelike Classes [RL_Classes],
    Fuji's Military Profession Pack [fuji_mpp],
    Manual Bionic Installation [manualbionicinstall],
    No Filthy Clothing [no_filthy_clothing],
    Prevent Zombie Revivication [no_reviving_zombies],
    Safe Autodoc [safeautodoc],
    Simplified Nutrition [novitamins],
    No Rail Stations [No_Rail_Stations]
    ]

Additional context

Add any other context about the problem here.

Probably somethings to do with crafted food inheriting their caloric value from their ingredients. Probably other examples out there.
Crafting flatbread directly out of flour, without using dough seems to yield expected amount of calories.

@CSHague
Copy link
Contributor

CSHague commented Dec 1, 2019

That is exactly what is happening. The only real discrepancy is the weight value. It could be argued that using the rolling pin method gives you more flatbread to use for other meals that increase potential enjoyment without increasing caloric values. Otherwise this is working as intended. The rolling pin was originally intended to increase yield but with the calorie change it cannot do that.

@Xion350
Copy link
Contributor

Xion350 commented Dec 1, 2019

Dough just has far too little calories for inheritance so anything crafted out of them has absurdly low calorie count. It'd probably be an easy fix but I'm not sure what the best solution would be. Increasing Dough calories maybe?

EDIT: I just realized that dough is part of Aftershock. Also the math with Dough is really really off in the first place. Dough is supposed to be about 289 calories per 100 grams. But if you try to go this way it really breaks the calorie ratios. The easiest solution it seems would be to just make Dough crafted Flatbread to make 2 charges, which produces similar calorie count to normal flatbread.

@KorGgenT KorGgenT added [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks Mods Issues related to mods or modding labels Dec 1, 2019
@KorGgenT
Copy link
Member

KorGgenT commented Dec 1, 2019

if someone would like to fix this in aftershock they can. This isn't a bug in vanilla, but an oversight by the creator of the recipe in aftershock.

@CSHague
Copy link
Contributor

CSHague commented Dec 1, 2019

Let's start doing the math. Starting with flour from wheat:

Now I'm not sure how Cataclysm does the calories, if the amount listed in an entry is per the mass of that item or on a set mass mentioned earlier (kcal/100g) but either way, the JSON shows flour at 48 kcal/13g, that makes normalish value (enriched flour is about 480cal / 125g so this figure is about correct. However, in game, flour is showing to have 36 calories per unit at a mass of .01kg listed in game (spawned) and 33 calories / unit at the same mass if you mill it from wheat yourself (500 kcal / 15 portions = 33.3~ kcal) so "store-bought" wheat has a little more calorie but it seems there's a discrepancy in the game. Somewhere between the JSON and the game description, a quarter of the flour's kcal are lost.

I think possibly the game is truncating gram values less than 10. The JSON shows flour spawning 48cal but in-game spawned flour is 36 cal. JSON weight is 13g, in-game weight is .01kg or 10g. The difference between the two weights 10g and 13g is proportional to the difference between the calories: 36 * 1.3 = 46,8. If this is true, then there could be a lot of individual calorie loss on every item that possesses a gram remainder, with a deeper effect the closer the comestible's calorie value approaches 10g. The way to fix this would be find where it's truncating the value and fix the math or force a style guideline where all comestibles have calorie values divisible by 10. I think this effect is actually visible the most in lettuce which shows in JSON as having 6 calories / portion (38g) and in-game having .04kg weight and 4 calories. If the game is dropping the 8 grams, then rounding down twice in two separate calculations it would truncate the calories to 4. This isn't that big a deal with lettuce but flour uses a lot of portions to make a thing so it loses more calories to cooking, especially if the gram value gets truncated multiple times in each cooking process.

@KorGgenT
Copy link
Member

KorGgenT commented Dec 2, 2019

i think you're conflating mass and calories, these two things are entirely unrelated in the game.

@CSHague
Copy link
Contributor

CSHague commented Dec 2, 2019

Well, either way, there's something that's making the difference in calorie values between what the json says and the description in-game conveys. It was just a pattern I noticed between the values.

@Davi-DeGanne
Copy link
Contributor

Davi-DeGanne commented Dec 2, 2019

@CSHague That is due to the RAW flag introduced in #35347. It is reducing the calories by 25%. Once the flour is cooked into something, the original calories (e.g. 48 from spawned-in flour) will be used.

As far as truncating weights (which is an entirely different thing, as KorG pointed out) seeing 1 charge of flour as 0.01 kg is just the game truncating 0.013 kg for display purposes. Notice that a pile of 10 flour correctly weighs 0.13 kg.

@CSHague
Copy link
Contributor

CSHague commented Dec 2, 2019

I see! Thanks for pointing that out to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants