Health (not hp, the hidden stat) balancing

okay uhhh… how about first lowering the RNG range to something more reasonable? +/- 50 instead of 100?

[quote=“Alec White, post:12, topic:13824”]You need to eat 288 points of nutrition to have 0 hunger per day. If the “normal” top of healthy is 150, you “should” need to eat food that is 0.5ish healthy by every nutrition point.
So you could make every non-junk food consumable give 0.5 health by every point of nutrition. That could a way of balancing it, what do you guys think?[/quote]

This balances the way the system works now by tying health to nutrition directly and requiring more nutrition per day to remain at higher states of health. However, this doesn’t cover variety of foods as well as actual nutrients. It’s a good suggestion to balance health -as it is now-, I like the scaling idea even though .5 per nutrition is way too high for health (you’d get like 20 health for every piece of cooked meat), but I’d like something a little more in-depth.

I’d like nutrition to not just be a number value tied to food, nor health. The current nutrition value in the game should be replaced with a satiety value–which is influenced by the volume of the food item itself. How well your hunger is sated should be how much your food weighs and takes up volume in your stomach (of course, less nutritious stuff stay in the stomach for a less amount of time). Actual nutrition should be a value tied to the entirety of what a player character eats, not just a singular food item. Even if it’s just something as simple as having your character eat one apple, one piece of jerky, and one egg, then saying that the apple has a health/nutrition of 2, the jerky a health/nutrition of 3, and the egg a health/nutrition of 1, then adding those up, then adding a 3 on top of the value as a variety bonus for eating foods from 3 food groups and thus gaining 9 health total—that would be more interesting and encourage a variety of palate.

I’m also thinking that instead of tempering the gains of health from food items, to simply make losing health faster the higher you go. I’ve talked to bodybuilders who tell me that their diets are so strict that eating a single hamburger would be like missing a whole week of training. Meanwhile, someone who’s at an average fitness level can eat generally healthy stuff as well as unhealthy stuff and not see a real change. It’s just as hard to stay fit than it is becoming fit.

Maybe in the future they can eventually add macronutrients and tie the RDA for each one that you need to your nutrition and health.

That is also the current system. The only thing that did change was removal of health-boosting vitamin pills, leukocyte rework, radiation affecting health, and some of the effects of health (just their strength, not new mechanics).
This system did not go away when vitamins were added and is not disabled with simple nutrition.

It’s what I want to balance here, not the vitamins.[/quote]

Ah, ok, good - I got the impression that the individual nutrient system (calcium, etc) had supplanted that system entirely. Glad to hear that’s not the case.

I know, but that’s the topic of this thread. Finding a way to balance the simple-non-vitamin health/nutrition system.

Is kinda off-topic-sh ranting about RDA, micro-nutrients, macro-nutrients and all that jazz, when we still have the basic health system being as random as it is.

And speaking about off-topic stuff, I still can’t make the health calculator give normal numbers. Unless of course those are “normal” numbers. But then I doubt it.


Enter the desired daily nutrition for a 2 weeks estimation:
288
Running simulation…
Simulation complete, this are the results:
Randomly: [-201]
Min/max: [-200,116]
Enter the desired daily nutrition for a 2 weeks estimation:
-288
Running simulation…
Simulation complete, this are the results:
Randomly: [169]
Min/max: [165,201]
Enter the desired daily nutrition for a 2 weeks estimation:
50
Running simulation…
Simulation complete, this are the results:
Randomly: [-48]
Min/max: [-50,116]
Enter the desired daily nutrition for a 2 weeks estimation:
-50
Running simulation…
Simulation complete, this are the results:
Randomly: [41]
Min/max: [56,154]

[quote=“Alec White, post:24, topic:13824”]I know, but that’s the topic of this thread. Finding a way to balance the simple-non-vitamin health/nutrition system.

Is kinda off-topic-sh ranting about RDA, micro-nutrients, macro-nutrients and all that jazz, when we still have the basic health system being as random as it is.[/quote]

I know. I’m just stating what I’d like to see in the future. I believe I mentioned that. Coolthulhu mentioned in the OP that health is supposed to represent immune system function, toxicity of the diet, ability of the body to deal with hardships, and so on. I understand he said he wanted to focus more on toxicity for the purpose of this thread, though I still have high hopes in the future for an actual nutrition system based off of the revised health system that this thread aims to bring.

okay, idea, keep health and mod separate but change how health decides to match health mod. have both the check and a reset occur like clockwork, midnight every game day the game checks your health mod and then adds or subtracts from your health one point in the direction of your mod. example, you have 20 health mod at the end of the day and your health is at 0, so you are given 1 health and your mod becomes 0. but this also means you need to have extreme levels health mod to gain extreme levels of health, lets say you have 30 health but you ran out of whatever you were eating to give you 30 health mod daily and your health mod is now 20 at midnight, your health will go down to 29 on the midnight check and every day it will go down until it hits 20. things like leukocyte breeder while active causes you to have 10 health mod or something at the midnight reset instead of starting at 0, and to prevent people from turning it on only before midnight and turning it off again right after, you suffer a huge -30 health mod when you turn it off due to the shock to your system turning it off causes. this will directly cause mildly healthy living to give mild health and extremely healthy living to give extreme health while also causing unhealthy things to give negative health but still allow some negation. such as how discussed in this thread that they drink herbal tea instead of water to mitigate their leaky bionic. my system would mean they would get extremely low but never quite 0 healing because they are taking measures to negate the bad effects.

Tweaked the health simulator to handle any given amount of days, and gives the average.

http://cpp.sh/6n7vw

Edit:

http://cpp.sh/5y74r

Added a “add bad and good sims and divide by 2”, and it seems to give sensible consistent positive values when you enter positive nutrition values.
I can’t into math.

This thread is not about individual foods or current revision of “list of healthy stuff, as approved by [insert agency here]”.
Tweaking minor relations between individual foodstuffs won’t cause meaningful changes until the health system gets pronounced enough that such tweaking will have a visible effect.

The best advice regarding diet is probably just “Eat a variety of things”.
If you don’t over or under eat, drink plenty of water, and include some amount of fruits, nuts, greens, vegetables, proteins, fats, sugars, oils, etc. into your diet you’ll probably be fine unless you have some specific dietary requirement/problem.

My suggestion would be to just make the health value of all foods based on the most recent types of foods you’ve eaten.

I’d probably just give each type of food a value that starts at, say, 5 and goes down to -5 over time, whereas a multivitamin would benefit all the things, and the average gets applied to your health_mod (5 being an arbitrary value, and not every food should necessarily be equally important and thus would have a smaller range).

With specific issues like scurvy and such, of course.

There’s no way to implement a legitimately accurate nutrition system into the game so the goal should be something fairly intuitive or obvious, and “don’t eat one type of thing forever” qualifies as fairly straightforward, and this implementation wouldn’t be too difficult to do since we already have types of foods.

How exactly does the RNG and health system work? I’m having a hard time understanding how the health, affected by health mod, affected by RNG, all comes together. From what I’ve read at github (Basic health rewrite 1 by i2amroy · Pull Request #8390 · CleverRaven/Cataclysm-DDA · GitHub) and around the forums, it works like this:

-All consumables that affect health actually affect the health modifier.
-The health modifier then has an rng value from (-100, 100) added to it.
-Every six hours, the modifier is reduced in a way that it is largely nullified by the end of the day. A quarter reduction, I believe.
-Environmental conditions affect the modifier

How is health affected after all this is done? I assume that the health modifier is not directly added to health, because the huge range of the rng means that health would deviate immensely. Food gives only a tiny amount of health modifier to counteract this, which seems like bad design to make health almost entirely dependent on rng. So is it a single point increase of health per 6 hours if the modifier is positive, or something else? I just can’t find the answer anywhere.

Here’s the code that takes care of managing the the health calculation.

I’m going to try to explain how I think the health system works.

[code]// Over the long run, health tends toward healthy_mod.
int break_even = get_healthy() - effective_healthy_mod + external_modifiers;

// But we allow some random variation.
const long roll = rng( -100, 100 );
if( roll > break_even ) {
    mod_healthy( 1 );
} else if( roll < break_even ) {
    mod_healthy( -1 );
}[/code]

get_healthy() is the current health the player has.
effective_health_mod is the health modifier the total of calculating the nutrition plus CBM and drugs taken and whatever else may affect the health mod.
external_modifiers seems to only be used to subtracts to the health modifier depending of radiation or artifact.

So if health goes up or down depends on:

// But we allow some random variation. const long roll = rng( -100, 100 ); if( roll > break_even ) { mod_healthy( 1 ); } else if( roll < break_even ) { mod_healthy( -1 ); }

The rng() has the limit of -100 and 100, if the roll is bigger than break_even you gain 1 health, if not -1 health.

But given the small health simulator I did http://cpp.sh/5y74r that only takes into account nutrition, and that the random value it gives when you input a positive daily nutrition value, is consistently giving a negative number. I think I may have misunderstood the system at some point.

Okay, so essentially, the rng roll, which could be one of 200 different values (-100, 100), is made independently and after the calculations from current health, CBMs, drugs, and external factors are taken into account. If the rng roll is greater than the “break even” value, which is itself “health - health modifier + external factors,” then health is raised by 1. If the rng is less than the “break even” value, it is reduced by 1. This calculation is made every 6 hours, after which the health modifier is reduced by a quarter.

So, if my health was 5, I ate enough nutrition to change my current health modifier to 20, and assuming no external factors like rain are affecting me, then I plug into the equation “5 - 20 + 0” and get a “break even” value of -15. I have to roll a random value between -100 and 100. That gives me a 57.5% chance of rolling a value higher than -15, and thus my health is raised to 6. Otherwise, it is lowered to 4. The health modifier is then reduced by a quarter, to 15, and the calculation is made again after 6 hours.

In this way, due to normal distribution, health should eventually even out to 0.

Do I have this correct?

As far as I know, yes.
But then I still have problems with my simulator which may tell me that there’s still something that I don’t understand.

As far as I know, yes.
But then I still have problems with my simulator which may tell me that there’s still something that I don’t understand.[/quote]

Your simulation seems to for some reason invert the random health number. I tried entering negative nutritional values and ended up getting positive health numbers somehow. Seems like a coding problem on your end. Maybe a min/max problem? Why does your max health, if above 200, go back to 100, but your min health if below -200 go up to -200 again? Why the inconsistency?

Anyway, back on topic. Just from looking at the equation for health, it looks as though the problem lies with the RNG and with the health check—it’s too strict. Otherwise, it’s sound. Health should automatically move towards the health modifier due to normal distribution, and the bell curve should so to speak follow the health modifier around (though maybe introduce a limit to how far health can deviate from the health mod?). You would essentially have to eat a hundred points of nutrition just to guarantee yourself a single health point (assuming no external factors and your health is 0, otherwise you always just eat a hundred nutrition points above your current health modifier to out-range the rng, good luck with that), and then that modifier is reduced to 75% of what it was before… every six hours. That’s insane speed, but I understand it’s meant to force you to keep eating healthy.

And if you were at a health value greater than 0, it just gets more impossible to keep your health up. Let’s assume health is 20. Using that same equation, “break even value (y) = health (20) - health modifier (x) + environmental factors (0),” your health modifier has to equal at least 20 in order to “break even,” or in other words get a 50% chance to go up or down in health, since rng can land equally above or below 0 and has to be above or below the break even value of y. Think about that. You have to eat 20 nutrition points EVERY. SIX. HOURS.

This continues on. At a health of 75, you have to somehow feed yourself 75 nutrition points EVERY SIX HOURS. A fourth of that is reduced, and you have to re-feed yourself 18.75 nutrition points before the next check to get your modifier back up to 75. This is only for a 50% chance at going up or down (for a 100% chance to go up you would have to eat an impossible 175 nutrition points). Most food items in the game I believe give only between 1 and 3 nutrition (health modifier) points, and six hours is not long enough for your character to get hungry enough to eat so many nutrition points’ worth of food. You see the problem here?.

I am curious as to what the health values would look like after changing the nutritional value of all food to be about 3, 4, or even 5 times as healthy as it is now. Or, changing the checks to be every 12 or 24 hours, essentially doing the same thing by giving you more time to become hungry and eat, yet slowing down the rate of change of health. Or, alternatively, change the reduction in health modifier from a quarter reduction to, say, an 8th reduction, so you don’t lose so much. If it were easier to keep your health modifier up, you would see better gains in health, while still allowing RNG to temper your gains if you don’t put any effort in.

I think most players typically live off of cooked meat, fruit, and veggies. What are their nutrition values (health modifier)? What’s the healthiest item in the game? Is it actually even possible to become healthy at the high ranges?

This lends itself to a problem. Late game, the “best” foods are very filling, so you only get the nutritional benefit once or twice a day. Since nutrition is something that changes slowly IRL, I would expect a check to be reasonable at a frequency no greater than 24 hours, possibly as rare as once a week. Then you have the characters that simply don’t need to eat.