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

Shivering mechanics are inconsistent #53443

Closed
NetSysFire opened this issue Dec 14, 2021 · 10 comments · Fixed by #61708
Closed

Shivering mechanics are inconsistent #53443

NetSysFire opened this issue Dec 14, 2021 · 10 comments · Fixed by #61708
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics

Comments

@NetSysFire
Copy link
Member

Describe the bug

My character, which is almost naked except for a straw hat, can not sleep due to shivering, yet the temperature in the panel says comfortable. The torso temp is -21, which is still in the green, quite literally. The area temperature is 14°C.

Steps to reproduce

This appears to be the part of the code causing wake-ups and many messages (see also #53411)

if( bp == body_part_torso && temp_after <= BODYTEMP_COLD ) {
add_msg( m_warning, _( "Your shivering prevents you from sleeping." ) );
wake_up();

Yet the code for the widget displays the most extreme part, which is still alright temperature-wise in my case:

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/panels.cpp#L723-L725

Expected behavior

No or only mild shivering. It is 14°C and it causes sleep deprivation because my character can not sleep due to the shivering.

The shivering mechanics only care about the torso and my character is not taking damage, so sleeping should not be prevented, at least not immediately and consistently. An occasional message about you feeling cold and shivering mildly would be appropriate.

As far as I know this was implemented so folks did not die in their sleep because of hypothermia which would have normally woken up the character but did not, this seems excessive in this particular case though.

Potentially introduced by #39827

Screenshots

No response

Versions and configuration

  • experimental

Additional context

No response

@NetSysFire NetSysFire added <Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics labels Dec 14, 2021
@Terrorforge
Copy link
Contributor

Your body temperature drops when you go to sleep, so if you're in the lower ranges of "comfortable" while awake, you'll become "chilly" while trying to sleep.

@NetSysFire
Copy link
Member Author

Interestingly enough, this also blocks poppy-induced sleep when you try to harvest one.

@NetSysFire
Copy link
Member Author

My concrete idea for a solution would be to decrease the sleep quality when you are cold and to prompt to wake up when you are taking damage from the cold. Also potentially a warning when the sleep quality is decreased.

  • You briefly wake up, shivering, noticing your cold hands. Go back to sleep?
  • Your limb hurts from the cold. Continue sleeping?

@LeahLuong
Copy link

@NetSysFire The 1st warning should prob be worded more generally. I could see it prompting players to find or produce sufficient hand coverings only to continue getting the warning, resulting in confusion. Something like:

"The cold is making it hard to get restful sleep. Continue anyway??"

This should prob only apply once per sleep cycle.

IDK about frostbite & sleep actually working as they do in-game vs. IRL. Cold tends to cause numbness & the effects of frostbite are not felt until limbs begin to warm up, although frostbite can be seen before then. When people die from exposure to the cold, it's usually after drifting off to sleep . . .

@NetSysFire
Copy link
Member Author

Yeah but in this case we are not talking about actual frostbite, just about a chilly night. It is around 14°C and your coldest limb in your character info is -4. None of your limbs take damage. You are a bit cold but that's it. The warning can of course be reworded since this was just a quick example to demonstrate what I mean.

Actual frost which causes frostbite also causes pain before your areas go numb. Have you ever been out in the winter without gloves? Your hands might start to hurt.
The usual progress should be: Feeling cold -> getting goosebumps -> shivering -> pain -> numbness

@I-am-Erk
Copy link
Member

This is cold enough to make you feel cold and give you problems sleeping but I agree it's being handled incorrectly.

I would suggest that rather than being woken by the cold, we have you get less effective sleep the colder you are, on a sliding equation, with a message like "you toss and turn, unable to stay warm enough" as you sleep. This should be pretty easy to do

@latogato
Copy link

latogato commented Apr 29, 2022

I'm not sure it just about the shivering mechanism. My naked toon shivering and can't sleep next to two fire rings, on a pile of leaves and already too exhaused (fall to sleep) to make a shallow pit for an improvised shelter which as far i know counts as indoor. The thing is, when the toon sleeps, the temperature calculated incorrectly and possibly only the ambiant outdoor temperature used, fires and other temperature sources seemingly not used in the calculation at all.

Here is a lets play video about it (3:55-4:26): https://youtu.be/V1RaKKecirY?t=213

Btw, why a shallow pit needed for an improvised shelter???

@NetSysFire
Copy link
Member Author

Btw, why a shallow pit needed for an improvised shelter?

You are thinking of https://commons.wikimedia.org/wiki/File:Living_on_the_rainforest.jpg

You do not need a whole load of sticks and pine boughs (or bark) if you just substitute the lower half of the above with earth. You more or less build a cone-shaped scaffold over the shallow pit and cover it with either bark or pine boughs, to build a "roof".
Additionally, you can fill the improvised shelter with straw or other dry plant matter for even more warmth.

@latogato
Copy link

latogato commented Apr 29, 2022

a cone-shaped scaffold over the shallow pit

I see, thank you for the explanation.

@NetSysFire
Copy link
Member Author

My naked toon shivering and can't sleep next to two fire rings

This should actually be fixed now. See #57218, you are blind when asleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics
Projects
None yet
6 participants