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

Nutrition values depending on hunger of character are not continuous #13729

Closed
BevapDin opened this issue Oct 7, 2015 · 11 comments

Comments

Projects
None yet
9 participants
@BevapDin
Copy link
Contributor

commented Oct 7, 2015

The effective nutrition of food is altered based on the hunger of the character (see player::nutrition_for). However, the formula used there produces non-continuous values as shown in this table:

hunger nutrition
0 10 (value from JSON)
99 10
100 6.7
150 10
300 20
301 8.6
2800 60
2801 46.7

That means if the hunger increases by one point from 99 to 100 or from 300 to 301, the nutrition that will be extracted from the food is actually decreased. This seems very wrong. In the range 100 to 149, the character gets less nutrition as when they would be not hunger at all.

For reference, this is the current code (slightly reformatted, hunger >40 is hungry, >100 is very hungry, >300 famished):

if( hunger < 100 ) {
    return nutrition;
} else if( hunger <= 300 ) {
    return hunger / 300.0 * 2 * nutrition;
} else if( hunger <= 1400 ) {
    return hunger / 1400.0 * 4 * nutrition;
} else if( hunger <= 2800 ) {
    return hunger / 2800.0 * 6 * nutrition;
} else {
    return hunger / 6000.0 * 10 * nutrition;
}

Btw. the item info shows the hunger-dependent values, not the plain value, is that intended?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 8, 2015

So many things wrong here...
One, it shouldn't be adjusted by the food at all, if there's an
adjustment it should happen when the nutrition is applied to the player, in
the player (or character) class.
Two, it is definitely intended to be a steady increase, not a discontinuous
one.
Three, I'm sceptical of the whole concept of nutrition increasing based on
how hungry you are. (Acknowledging that hunger isn't what we normally call
hunger, it's more like starvation level at the point when this stuff is
kicking in).
Four, (a side effect of 'one'), the post-adjustment values definitely
should not be used.

Personally I'm for nixing the whole thing.

@Rivet-the-Zombie

This comment has been minimized.

Copy link
Member

commented Oct 8, 2015

Three, I'm sceptical of the whole concept of nutrition increasing based on how hungry you are.

So am I; the whole thing is silly.

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

Yeah, it seems...hmm. Is it meant to represent some psychological factor? Seems like the only psychological factor that would affect a food stat would be morale, for example desperation leading to eating food normally regarded as unpleasant.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 8, 2015

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2015

If anything, you should perhaps suffer from lowered metabolism when starving, which would mean you don't get hungry as quickly, but also are impaired in other ways

I like this idea.
Though our current hunger system (inc hunger once per x turns) is a bit hard to adjust. The simplest way would be to make it all floats, but there may be a more elegant one.

@Midaychi

This comment has been minimized.

Copy link

commented Oct 9, 2015

Unreal world has hunger separated out kind of neat.
They have a 'fullness' meter that operates a lot like cata's current nutrition system does. You drink or eat something and you get fuller, and sometimes get more full if you go a long while without eating or eat in small amounts for along time.
The second meter is their overall healthiness of their diet, which tracks how many calories and nutrients on average you're clocking a day compared to how many calories and nutrients you're using just survivng the environment and doing work.
If you eat poorly in that game, you can easily get into a situation where you're wasting away but full, and vice versa.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Oct 9, 2015

@tivec

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2015

Take a look at #11514.

Back then, we found it very strange that one would need to eat 10+ cooked meat just to raise from famished to very hungry. The system there was conceived during that process, to make it a bit less unrealistic.

@chaosvolt

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2015

While I see the gameplay reasoning for that, the other issue (besides the realism concern) is that the net effect of that scaling isn't continuous, it's less of a ramp-up and more of a roller coaster.

@caland

This comment has been minimized.

Copy link

commented Oct 28, 2015

I think the concept of the code was if hunger is less then 100 return base nutrition value.
and if hunger is between 100 - 300 it should scale to return 1 time to 2 times the nutrition value.
and 300 - 1400 scale from 2 times to 4 times the value. etc.

if that is the case the code should be:

if( hunger < 100 ) {
return nutrition;
} else if( hunger <= 300 ) {
return ((hunger-100)/200 + 1) * nutrition;
} else if( hunger <= 1400 ) {
return ((hunger-300) / 1100 * 2 + 2) * nutrition;
} else if( hunger <= 2800 ) {
return ((hunger-1400) / 1400 * 2 + 4) * nutrition;
} else {
return ((hunger-2800) / 3200 * 4 + 6) * nutrition;
}

which give a consistence increase.

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2015

@caland: That is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.