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

vitamins do things #50273

Merged
merged 6 commits into from
Sep 4, 2021
Merged

Conversation

dissociativity
Copy link
Contributor

@dissociativity dissociativity commented Jul 28, 2021

Summary

SUMMARY: Balance "Malnutrition is not good for you"

Purpose of change

PK rebalancing has had working penalties for malnutrition for a while, to my eyes they seem fairly accurate to real life, the scientific articles and 5000 word essays on what values should specifically be had at a given level can be had later, for now we have a missing feature existing and working from readily available json changes.

Describe the solution

Malnutrition didn't do things other than iron deficiency due to the blood system PR, now it has negative effects on the player for more than iron deficiency.
Drugs altering vitamin metabolism in a future PR, leading to these deficiencies being more common than a player who does not consume drugs would face.
Some are very unlikely to be faced as is, but are implemented largely in preparation for these steps.

Describe alternatives you've considered

Allow players to eat only iron rich diets, and ignore all other vitamins in shame forever.

Testing

play game, eat terrible diet or too many multivitamins, suffer

Additional context

using some data from #33776

Data:
Iron deficiency is unchanged other than the loss-rate, it should occur at about 100 days of no real iron intake, it's not terribly likely, but does occur with vegetarian diets, which I figured would have some level of intake that would make this take more than 100 days with most players, it's quite uncommon in the US population, at least 5 million adults have it.
Vitamin C deficiency results in pain, fatigue, and overall negative health, this gets worse with progression
it should take about a month of no intake
"max_intensity": 3, "base_mods": { "pain_max_val": [ 35 ], "pain_chance": [ 900 ], "pain_min": [ 1 ], "pain_max": [ 5 ], "fatigue_chance": [ 900 ], "fatigue_max_val": [ 500, 200 ], "fatigue_min": [ 10 ], "h_mod_min": [ -1 ], "h_mod_min_val": [ 0 ], "h_mod_chance": [ 900 ] }, "scaling_mods": { "pain_chance": [ -300 ], "fatigue_chance": [ -200 ], "h_mod_min": [ -1 ], "h_mod_min_val": [ -100 ], "h_mod_chance": [ -300 ] },
Hypervitaminitosis does nothing for now as it's implementation is very vague and abstract, I'm considering changing it to have a minor health stat debuff as generally it's probably not ideal to have too much vitamin A, and probably a few others, but it would be very mild given how vague it is as a concept.

@@ -1955,15 +1955,17 @@
{
"type": "effect_type",
"id": "hypocalcemia",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't Venera3 explain that basically hypocalcemia shouldn't be a thing because it can't devlop in the time frame of the game? #45564 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can comment it out,

Didn't Venera3 explain that basically hypocalcemia shouldn't be a thing because it can't devlop in the time frame of the game? #45564 (comment)

it shouldn't be, your intake should make it not happen unless it happens over many years assuming you eat something with calcium in it every once in while, and the maximum extent for it in this PR, is very mild to medium muscle stiffness, so only low level deficiency, especially given calcium pills exist around the place.

The reason it still exists, but in a very unlikely state, is so drugs that may impact the body's metabolism can make it happen over a more drastic timespan, thus the player has more consequences for their abuse longer-term.

Copy link
Contributor Author

@dissociativity dissociativity Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

300 days of absolutely no intake is astronomically unlikely in a normal gameplay situation, but I don't currently know enough about drugs or injuries to really have a take on how much they'd impact this.

Copy link
Contributor Author

@dissociativity dissociativity Jul 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically only implemented mild symptoms for these reasons as well, nerfing my already mild version, though I can probably reduce the speed malus if you think that works better.

@dissociativity
Copy link
Contributor Author

as I've edited the PR summary to suggest, to remove calcium completely would definitely require a new PR purging calcium from all food items and drugs involved.

@Venera3
Copy link
Member

Venera3 commented Jul 28, 2021

B12: a healthy nonvegan adult has about 2000-5000 mcg of it stored in their liver (that's 500-1250 day's RDA) so the timeline could stand to be bumped up by a factor of two at least. Adding a max value to represent it being stored would fit well. Also, #47291 added support for effects influencing vitamins, so you could hook up a nice B12/Red blood cell interaction instead of fudging it with fatigue/strength reduction.
A and Iron look fine.
Scurvy's fatigue could use a safety fatigue_max_val, otherwise it looks good.

@dissociativity
Copy link
Contributor Author

dissociativity commented Jul 28, 2021

alright, max is what would be 500 days (4000 game units) + effectively what it takes to reach the threshold for deficiency which is sort of arbitrary, it would be nice if I could define as a default starting amount and have units to base it on, but for now it makes sense just to keep it sort of arbitrary using the current system imo
oops we're doubling the time it takes to lose one unit, so that makes it 2000 max, which means assuming you max it out, you have around 1200ish days before deficiency kicks in, or 700 as a freshly spawned player.

Drugs like alcohol of course, can decimate one's b12 supply, and I'm sure plenty of others.

@dissociativity
Copy link
Contributor Author

dissociativity commented Jul 28, 2021

what's an ideal suggested fatigue_max_val value?
I've gotta go to bed, make any other suggestions and I'll try to just get this over and done with since I've been wanting this implemented for a long time, I'll then do a PR for adding b12 rate changes for alcohol use to deplete it rapidly while intoxicated

@Venera3
Copy link
Member

Venera3 commented Jul 28, 2021

I wouldn't go over 500 (about the midpoint between Very Sleepy and Dead Tired) for the highest intensity. You can scale up from 100 (almost Sleepy) in 200-point steps.
Alcohol is the main factor leading to B12 deficiency, but it does so in a very chronic manner (liver inflammation and low-impact GI bleeding depleting the stores, chronic gastritis leading to reduced IF production, and in general reduced uptake thanks to a liquid diet) so until we can define the starting stores for pre-cataclysm alcoholics/polytoxicomanic professions we're still not talking about a sudden thing.

@I-am-Erk
Copy link
Member

I'm really not sure it's worth including b12 deficiency. Its effects are vague and hard to spot for a very long time after it develops, and nutritional deficiencies are hard to get in the first place. You'd need to have an effect that kicks in after two years and doesn't have any significant sequelae for much longer.

Scurvy is the main one you want, and iron deficiency exacerbated by all the bleeding in combat. The other vitamin deficiencies just aren't going to happen unless we make them common due to mutations

@actual-nh actual-nh requested a review from I-am-Erk July 28, 2021 16:11
@actual-nh actual-nh added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Items: Food / Vitamins Comestibles and drinks Mechanics: Character / Player Character / Player mechanics labels Jul 28, 2021
@dissociativity
Copy link
Contributor Author

I'm really not sure it's worth including b12 deficiency. Its effects are vague and hard to spot for a very long time after it develops, and nutritional deficiencies are hard to get in the first place. You'd need to have an effect that kicks in after two years and doesn't have any significant sequelae for much longer.

Scurvy is the main one you want, and iron deficiency exacerbated by all the bleeding in combat. The other vitamin deficiencies just aren't going to happen unless we make them common due to mutations

I'm planning on adding effects that drain b12 far more quickly to the effects of some drugs like alcohol to roughly simulate their effects on b12 irl (a hyper-realistic approximation would take way more code knowledge than I have, but I think just changing the rate value while drunk would be a good start)

@The-Numbers
Copy link

Perhaps vitamins in gane could drain more quickly than real life. In the game due to the blob humans heal incredibly quickly. Where do these nutrients come from? I don't know if it would be a desirable direction to take things, but until we can automate tasks I think vitamins levels would have to decrease much faster. Once time can pass by faster, I think seeing 100 days for a deficiency would be much more common. But for now, there are a few questionable things. For instance, broken limbs are functional within 5 days and healed in 10. I know that's only possible because of the blob, but I imagine you would need a tremendous amount of nutrients to recover all the constant injuries you receive, and would need to eat way more to compensate. Until time passes more quickly, I don't think most people will ever see a vitamin deficiency.

@I-am-Erk
Copy link
Member

I think the amount of fun to be had from vitamin deficiencies is vanishingly small, there's no need to make it more punitive just to show off the system.

Even with severe alcoholism, B12 deficiency is fairly uncommon. It's just not a thing seem in an acute setting, you're looking at stuff that develops over long periods of time here.

I would suggest that you stop looking for ways to make the existing vitamins relevant and instead look into nutrient deficiencies in wilderness survival. For this pr in specific, adding scurvy would be wonderful. In the longer term, perhaps hyponatremia or hypomagnesemia is more relevant.

@Venera3
Copy link
Member

Venera3 commented Jul 29, 2021

If I may repeat myself from the discord, if you want to add something because of a gameplay consideration (in this case, "eat the right things", more or less), you can always brand it as a weird apocalyptic/transdimensional/mutation effect - if you don't try to sell it as a "realism" thing, it won't be measured up to reality and you can go crazy with it.
At this very moment the code exists for you to add a completely new nether monster that infects you with a mutation on its special attack that makes you sneeze portals if you don't eat a handful of shelled almonds every day - all using well-documented JSON systems. Not saying that exact thing would make it in, of course, but you have a lot more freedom in coming up with completely new weird things than with forced pseudorealism.

@dissociativity
Copy link
Contributor Author

alright, so we have scurvy, and iron deficiency takes longer to occur "naturally" without injury than in vanilla, excess conditions were removed as they'd never happen and would confuse the player as they have been already.

@dissociativity
Copy link
Contributor Author

dissociativity commented Jul 29, 2021

I may implement vitamin excess effects in a future PR, which one can see very apparently in the case of vitamin A for example off the top of my head, eating too many livers is a hazard seen in survival situations because of vitamin A from what I recall
What may also be good, is benefits from higher B vitamins, magnesium in future? just, rewarding the player for a /good/ diet, rather than punishing the player for something they're unlikely to experience, though this would I think be better in the case of B vitamins the body doesn't store as much of, like B1 from memory.

@dissociativity
Copy link
Contributor Author

I think this is ready?

@game2202018
Copy link

We are players which really like your game, and we find the vitamin system is no longer available after some tests and check CDDA browser. So we decide to check github to find out what is happening. After watched your discussion, we do believed that you think too compliacted for this system. The purpose of this system is force player to find various kinds of food, including meat, vegetable, fruit and so on. Only thing you need to do, is try to make a system look like enough "realism", and the player will try to fix it to reality by imagination. Like meat(VB, IRON), vegetable(VA), fruit(VC), that is enough for player. The symptom do not need too complicated, just show some influence or debuff(lower stat etc.) and player will do something, only thing you need to do is make the symptom enough "realism". But the calcium need to be fixed, because there are no too many way to get calcium in game, now you have to drink 4 milk per day to ensure your calcium is enough. We suggest that you can improve calcium of other food, so milk will not be the only way to get calcium. Hope CDDA will be funner in the future.

@kevingranade kevingranade merged commit c9f6454 into CleverRaven:master Sep 4, 2021
Venera3 pushed a commit to Venera3/Cataclysm-DDA that referenced this pull request Sep 21, 2021
* remove all unlikely deficiencies and excess json lines, max fatigue for scurvy
@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/what-are-your-thoughts-on-how-the-game-has-developed-over-the-years/26744/36

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` Items: Food / Vitamins Comestibles and drinks [JSON] Changes (can be) made in JSON Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants