CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.33k stars 4.14k forks source link

Doubtful calculation of hunger description #30206

Closed Qrox closed 5 years ago

Qrox commented 5 years ago

Describe the bug
The current way of generating hunger description seems problematic, and may confuse the player.

To Reproduce

  1. According to the code below https://github.com/CleverRaven/Cataclysm-DDA/blob/65a05026e7306b5d1228dc6ed885c43447f128b5/src/player.cpp#L12929-L12979
  2. The following graph is drawn hunger
  3. Observe that when there's no calorie deficit, and stomach content is below 3/8, hunger description level does not change monotounously with regard to time and stomach content.
  4. Also note that when there's no calorie deficit, the "hungry" description is never used except when the stomach content is exactly 0 or 3/8 of the capacity. I don't think this is intentional.

Expected behavior
I'd expect hunger level to increase with time and decrease with stomach content and calorie level monotounously. (IRL hunger level does not change strictly monotonously with regard to time, but I don't think the current code is simulating this behavior.)

Greevv commented 5 years ago

Yeah, the hunger system is totally fucked right now. I wish they'd get over the "muh realism" thing because sometimes, in cases like this, "realism" doesn't make for good gameplay.

I-am-Erk commented 5 years ago

Currently the purpose of the hungry/peckish distinction is essentially to offer feedback on whether or not the player is running a calorie deficit, so it's working as intended for hungry to not appear when you're getting sufficient calories. That's partly because there's currently no calorie storage, so calories taken in after you get enough are basically lost. It's possible that will change with BMI stuff later, when it's less important to know you're calorically replete.

It's entirely possible to make hunger level change monotonously as a function of time, stomach contents, and calorie deficit... But since the hunger messages are discrete, you wouldn't see any difference on the user end.

Qrox commented 5 years ago

Ok, I see the hungry/peckish distinction is to offer feedback, but the logic still needs to be updated to cover the edge cases of stomach content being 0 and 3/8 of stomach capacity.

And by monotonous I mean the hunger level should not change from peckish to normal, and then peckish again after some time (which is the way it currently is as seen from the graph).

mlangsdorf commented 5 years ago

I think that just fixing the weird hunger spike at 3/8ths full, 0 time since eating should address the issue. Then you're peckish if you've just started eating (I can believe it) or if you're nearly empty and it's been a long time since you ate.

I also think that figuring out how to display those graphs in the help menu would be really helpful - once you see how the states are laid out with respect to hunger and time, the system really clicks.

Tharn commented 5 years ago

Thanks for drawing the graphs. It's hard to see for a layman how exactly hunger works now. I'm also in favor of anything that simplifies this (or makes it more realistic, if that also means simpler). I don't see the advantage to perfect realism when the old system with immediate feedback has not really produced any problems.

JeanLucVanDamme commented 5 years ago

@Qrox, how did you go about generating those (lovely) graphs?

Specifically, did you derive the numbers based on reading the code and your understanding of its logic? Or did you run the player::get_hunger_description() function with a range of input values to test it, then graph the results?

Qrox commented 5 years ago

I just read the code and drew the graph based on the if statements. I then understood the logic based on the graph :).

As for the realism thing: from my personal experience, any level of hunger is easily satiated even after the first few bites of my food (not that I've ever reached starvation though). Hunger only sets in again later, depending on the actual amount of food consumed. That said, I'm not an expert in physiology, so perhaps someone more well-informed can suggest a more realistic mechanism.

Tharn commented 5 years ago

I have fasted for several weeks before and have a general interest in nutrition. From my understanding it's like this. Feel free to correct me: There is 1) hunger as a reaction to an empty stomach. This is felt in the stomach. Gurgling, etc. It is however entirely unrelated to starvation. The body wants something as a simple biologically hardwired response. This could be represented perfectly by a morale penalty. 2) true hunger, which is a lack of free glucose in the system and an inability of the body to convert more from scavenged muscle tissue or fat stores. This is felt in the throat. It happens whenever the body really has run out of fuel, but for a body with fat and glucose stores may take days or even weeks to manifest. This could be represented by a counter. When it gets too low, introduce progressive penalties with death at value 0.

Generally, it is very very hard to keep eating and satisfying the 'hunger' stat while drawing a negative on the 'starvation' stat. It doesn't happen with i.e. a diet of pure sugar, or bread, or lard. It can however happen with an extremely fibre-heavy diet such as eating nothing but raw salad, greens and calorie-dilute non-starchy vegetables.

Eating such a diet generally leaves you unfulfilled and hunger returns quickly.

I-am-Erk commented 5 years ago

@Tharn that's... literally a description of the current plan. Most of that has already been implemented.

stale[bot] commented 5 years ago

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.

kevingranade commented 5 years ago

The discontinuities in this issue have been removed.