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

Perspiration, evaporation cooling #44880

Closed
wants to merge 4 commits into from

Conversation

Robik81
Copy link
Contributor

@Robik81 Robik81 commented Oct 15, 2020

Summary

SUMMARY: Features "Perspiration, Evaporation cooling, heat effect balancing"

Purpose of change

Human body is awesome. And one of its awesome features is perspiration - thermoregulation via evaporative cooling.

I had some problems while cooking near the stove in late spring... well, I had to cook naked to not cook myself as well. Which led me to GitHub issues where I found issue #43451 this PR hopefully at least partially fixes. Issue talks about heat effect in general and ways to balance it, but what struck my eye the most was mention about perspiration.

I started digging in the code and I found that in relevant function that handles character wetness are following lines:
// TODO: Make evaporation reduce body heat
and
// TODO: Make clothing slow down drying

It was like a glove to be picked up.

Describe the solution

  • material breathability in material.json to relevant clothing materials, range is 0 - 100 (none to full), defaults to none, I did my best to set appropriate values, but comments are welcome
  • new perspiration effect used in hot effect, which causes... wetness, it can be potentially used in other effects that cause non-heat perspiration, like some kind of fear effect or illnesses
  • evaporation cools you body, wetness does not have to come from sweat, you can also submerge yourself in the pool for a moment, or something
  • evaporation rate is reduced by clothing, light summer clothing is quite okay, but running around in leather duster during summer can lead to drenching yourself in your own sweat and nasty morale penalties
  • heat effect now causes more thirst (i feel it was negligible before)
  • reduced speed penalty of heat slowdown effect to half, it is per body part and just being warm caused quite harsh penalty

notes about implementation

  • uses current wetness and does not track sweat as a separate entity, from the cooling effect perspective, it should not make a difference where the liquid came from
  • increased range of drench capacity of body parts is to achieve finer granularity of evaporation
  • wet-o-meter tool prints info about wetness and heat level of all body parts, just for testing, not added to any item groups
  • reduced average drying time from 2 hours to 30 minutes, now that is is later affected by clothing

Describe alternatives you've considered

It was possible to just tweak existing heat effect around the edges, but...

Testing

I tested that the code is running without any noticeable issues and it appears that it does what was intended. What is yet to come is live play test, hence the WIP tag in the caption.

Useful tool for testing is wet-o-meter. Feel free to spawn one.

Additional context

Perspy was not harmed in any way during the testing...
image

@CountAlex
Copy link
Contributor

That's pretty awesome feature to have! Would you consider adding an action of pouring water on player character? Like putting water from a flask or w/e on your clothes if there's no place to dive into to get wet.

@Robik81
Copy link
Contributor Author

Robik81 commented Oct 15, 2020

Would you consider adding an action of pouring water on player character? Like putting water from a flask or w/e on your clothes if there's no place to dive into to get wet.

Indeed I am.

I thought about leaving it to separate PR, but having this feature for my test run might be quite useful.

@mlangsdorf mlangsdorf added <Enhancement / Feature> New features, or enhancements on existing Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics labels Oct 16, 2020
@Robik81 Robik81 force-pushed the perspiration branch 2 times, most recently from 2bedee1 to 811a949 Compare October 16, 2020 06:23
@Robik81
Copy link
Contributor Author

Robik81 commented Oct 16, 2020

I implemented the pouring action via unload from container / interaction with other sources of water on map, though I am probably going to PR it as a followup.

To keep things simple for reviewers and the person who can do the merge.

@NickVolynkin
Copy link

Earlier, being wet used to lower your morale. Now it can be useful, so being wet when it's hot should raise morale, right? As a general rule, if being wet decreases heat from positive values down to zero (or 30), it's fun, otherwise not fun.

@Robik81
Copy link
Contributor Author

Robik81 commented Oct 17, 2020

Whether you gain or loose morale for being wet depends on clothing you have. Swim and some sports gear give morale bonus.

Just being sweaty is not going to give you a penalty, as sweat should evaporate before lots of it accumulate. Unless you are running in leather or similarly unbreathable gear while sweating.

@dissociativity
Copy link
Contributor

would low stamina not cause additional heat and thus perspiration too?
I don't think, unless there's been recent changes, that the game replicates this.

@Robik81
Copy link
Contributor Author

Robik81 commented Oct 18, 2020

There is new Weariness system #43985 that tracks weariness from activities that have activity level ranging from NO_EXERCISE to EXTRA_EXERCISE. I can definitely see the possibility of modifying it to not only raise weariness, but also body heat. That will in turn cause perspiration once the body part reaches the Warm status.

There is also a discussion about weariness in issue #44326.

@kevingranade
Copy link
Member

uses current wetness and does not track sweat as a separate entity, from the cooling effect perspective, it should not make a difference where the liquid came from

It doesn't make a difference where it came from, but it matters where it is when it evaporates. Only evaporation very close to the skin carries heat away from the body. Water in clothing is going to evaporate, but not impact body heat much, unless the clothes are so soaked that it acts like a big heat sink.

Overall I'm a bit concerned about the lack of either reference to IRL sources or in-game use cases. This really needs some stuff like, "character wearing so-and-so outfit doing exercise foo is comfortable" for validation.

@Robik81
Copy link
Contributor Author

Robik81 commented Oct 20, 2020

Only evaporation very close to the skin carries heat away from the body. Water in clothing is going to evaporate, but not impact body heat much, unless the clothes are so soaked that it acts like a big heat sink.

True, though I believe that the game tracks only wetness that actually got to your skin, not wetness on the gear itself, that did not penetrate. Given that wetness causes morale penalty.

Overall I'm a bit concerned about the lack of either reference to IRL sources or in-game use cases.

Body using perspiration as a way to regulate its temperature is not in a dispute I believe? Nor is the evaporative cooling? In-game use case is that the player has currently good options about dealing with cold, not so much with heat. It seems to me (individual player experience, though if we go by the referenced issue I am not alone) that it is pretty easy to get warm in mild temperatures. It could be solved by tweaking the numbers instead of introducing new system, but given the existence of TODO comments in the code, I thought that something akin to what I implemented was planned to be added at some date.

Other use is, that it fit well in tandem with suggestion about activities raising your body heat, if that was implemented at a later date.

This really needs some stuff like, "character wearing so-and-so outfit doing exercise foo is comfortable" for validation.

Hmm, wouldn't such stuff be related more to a PR that would tweak what clothing gives what morale bonus during activity x? This PR is not changing what clothing is giving bonus / penalty when character is wet. These are kept as they are, sorry if I implied differently.

@dissociativity
Copy link
Contributor

dissociativity commented Oct 20, 2020

Player is in summer, heat sucks for movement speed and extra thirst, player perspires.
Player is wearing nasty leather gear like a leather trenchcoat, jacket, duster, survivor gear, and is drenched in sweat, not terribly comfortable nor breathable, morale aint doing so great.

Player instead wears light nomad gear for summer, is far les wet, is able to perspire and cool down, therefore not getting heat penalties nearly as much nor horrible morale from wetness without having to strip down to essentially naked and take full damage from dangers.

case made.

@Robik81
Copy link
Contributor Author

Robik81 commented Oct 21, 2020

I can see that I did a pretty bad job explaining things in the Purpose of change section, though @dissociativity got it right. I am not good at explaining my thoughts, sorry about that. Let me try to amend it.

The purpose of change is to simulate the fact, that human body is capable to handle excessive heat on its own, to a degree, and with associated cost of increased thirst, via perspiration through the evaporative cooling. The evaporative cooling is hindered by wearing clothing made from material with low breathability, thus incentivizing the player to choose more fitting clothing for his current situation.

Now that I read it after myself, I am not sure if I did better job than before... well, I tried.

@Robik81 Robik81 force-pushed the perspiration branch 2 times, most recently from 4517b0f to 793e155 Compare October 25, 2020 05:05
@anothersimulacrum
Copy link
Member

anothersimulacrum commented Nov 8, 2020

Suggestion: replace the integers for breathability and similar with string values, that the loading turns into integers. Raw integers are messy, provide too much control, and don't really mean anything to humans. Having a few enumerated states would be better.

@stale
Copy link

stale bot commented Dec 8, 2020

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.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Dec 8, 2020
@Night-Pryanik
Copy link
Contributor

@Robik81 is this being worked on?

@stale stale bot removed the stale Closed for lack of activity, but still valid. label Jan 4, 2021
@Robik81
Copy link
Contributor Author

Robik81 commented Jan 4, 2021

@Night-Pryanik I didn't have time to test it properly, though I do plan to return to it this month.

@Night-Pryanik
Copy link
Contributor

Ok, could you please convert it to draft and remove the WIP tag then?

@Robik81 Robik81 marked this pull request as draft January 4, 2021 09:22
@Robik81 Robik81 changed the title [WIP][CR] Perspiration, evaporation cooling Perspiration, evaporation cooling Jan 4, 2021
@Shodan14
Copy link

Any chance that the scent system could eventually link in what that? e.g. more sweat-stronger scent etc.

@actual-nh actual-nh added the (P5 - Long-term) Long-term WIP, may stay on the list for a while. label Aug 8, 2021
@I-am-Erk
Copy link
Member

I didn't realize there was a WIP pr for this, I had just started writing up an implementation.

I would really like to see this get done. @Robik81 are you still around? if you'd like, we could try to get this in as one of the last big parts of 0.G, calling it part of the armour revamp. If you're not around, I may see if we can get someone to adopt this and not let it languish.

@Robik81
Copy link
Contributor Author

Robik81 commented Dec 14, 2021

@I-am-Erk I am currently busy with work and only god knows when I will be able to return to finish it. Feel free to take it over completely, in part or as an inspiration for your own implementation.

That goes for everyone who is willing and able to do it, of course.

Though I don't have time to play CDDA currently, I would be really happy if something akin this is implemented when I will have time to play again!

@I-am-Erk
Copy link
Member

Thanks for the quick reply. I'll look and see, maybe this can be quickly made functional and merged and we can sort out the fallout from there.

@I-am-Erk I-am-Erk marked this pull request as ready for review December 15, 2021 01:05
@I-am-Erk
Copy link
Member

Was going to take this over directly but on second thought if I do, I'd prefer it to be another PR. I have moved it to the appropriate projects so it doesn't get missed and I will close this PR.

@I-am-Erk I-am-Erk closed this Dec 15, 2021
@LyleSY LyleSY added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON labels Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Mechanics: Temperature Freezing, cooling, thawing, heating, etc. mechanics (P5 - Long-term) Long-term WIP, may stay on the list for a while.
Projects
Development

Successfully merging this pull request may close these issues.