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

Bread is unreasonably dense; pumpkin muffins are denser than gold, can eat over 50kg in one sitting #61312

Closed
Terrorforge opened this issue Sep 27, 2022 · 6 comments
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility stale Closed for lack of activity, but still valid.

Comments

@Terrorforge
Copy link
Contributor

Terrorforge commented Sep 27, 2022

Describe the bug

Many bread items have completely wacky density. 100 units of standard "bread" weigh 6kg (6000g) and has a volume of 1.79L (1790cm3), which gives it a density of 3.4g/cc. This is denser than most rocks, and about 15 times higher than the actual density of bread at ~0.2g/cc. Some, but not all, bread-related products have similarly weird densities. A few examples:

  • Cookie: 2.64g/cc
  • Boring sandwich: 3.4g/cc
  • Wastebread: 4.8g/cc (denser than Titanium)
  • Hardtack: 6.4g/cc
  • Hallula: 15g/cc (denser than lead)
  • Pumpkin muffin: 20g/cc (denser than gold, within spitting distance of Osmium, the densest substance known to man)

While all of these values are silly and could use adjusting on that basis alone, what actually causes problems is the effect density has on eating. Because of the way satiety is calculated (#36977, #40402), calorie density is largely a function of physical density.

The survivor is able to eat about 1800 pumpkin muffins in one sitting. That's over 50kg, and more than seventy thousand kcal.

That's obviously an extreme outlier, but it has absurd effects much further down the scale. Filling up on hardtack gives you about 4 times more calories than eating a similar amount of pure lard.

Steps to reproduce

  1. Spawn 1000 pumpkin muffins
  2. Eat all of them

Expected behavior

Bread is less fattening than literally eating pure fat.

Screenshots

image
A stomach full of pumpkin muffins

image
A stomach full of hardtack.

image
A stomach full of bread

image
A stomach full of lard.

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19043.2006 (21H1)
  • Game Version: 3d6730a [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    No Fungal Growth [no_fungal_growth],
    Bionic Professions [package_bionic_professions]
    ]

Additional context

No response

@Terrorforge Terrorforge added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Sep 27, 2022
@RAldrich
Copy link
Contributor

So I was checking to see if I could fix this just by editing the JSON, and while that can help a bit there's still some oddities in math that make this turn out silly. A few things are happening:

  1. As noted, JSON values for these items are nonsense. A better value for something like an apple pumpkin muffin (based on a Starbuck's blueberry muffin) is V = 200 ml, W = 99 g, kcal = 330. That gets you to 0.3 g/kcal.

The game does several things to the Volume.

  1. You chew the food. This removes the water from it (not relevant here as muffins have negative quench), and more importantly, compresses it until it is as dense as water. Nothing in your stomach is ever treated as less dense than water. This means that our 200 mL muffin is turned into a 99 g == 99 mL paste (gross).
  2. The volume is adjusted if the calorie density is high (this uses the unchewed volume). This isn't strictly linear, but for the muffin the multiplier comes out at 3.16 (it's dense, so it's three times as filling as you'd expect).
  3. 99 mL * 3.16 = 313 mL that actually gets ingested

Despite this fairly reasonable volume, I can still eat 53 muffins * 313 mL = 16.5 Liters of muffins. Something must be wrong with the stomach code. Turning on debug mode, I can see that the effective volume that's getting logged is only 28 mL. So there must be a bug.


Ok so next I checked the JSON vs in-game definitions. Even if I set the JSON to "volume": "20000 ml" (a 20 Liter muffin), in-game it only comes up as 0.83 L. So the conversion there is not working as expected at all.

@RAldrich
Copy link
Contributor

It's a unit conversion somewhere. Consuming my 20,000 mL muffin with debug mode on shows an effective volume of 313 mL, which is exactly what we'd expect to see from the 200 mL muffin calculation I mentioned above. So something is chopping off two orders of magnitude, and the displayed volume for the item (in inventory) is also nonsense.

@RAldrich
Copy link
Contributor

Derp. It's the stack_size=24. The original pumpkin muffin data specified some sort of magically dense mini-muffin with 24 portions. Eliminating the stack_size causes all the math to work out as expected.

With those changes, I can only eat 4 muffins before I'm full. So. Sorry for the long-winded investigation that can be summarized as: "yes, we can fix this by updating the JSON values".

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label Jan 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2023
@Karol1223
Copy link
Contributor

I do appreciate the fact that two years on from this issue being posted we've seen some moves on that front.

Pumpkin muffins are no longer 20g/ml... they're now 30g/ml...

@Terrorforge
Copy link
Contributor Author

Terrorforge commented Jun 4, 2024

I love game development.

e: fun fact, that makes pumpkin muffins the densest material on earth. As far as I know, the only materials in the universe denser than that is stuff like the hadron soup that composes neutron stars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility stale Closed for lack of activity, but still valid.
Projects
None yet
Development

No branches or pull requests

3 participants