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

Realistic nutrition #13649

Closed
illusionofchaos opened this issue Sep 24, 2015 · 11 comments

Comments

Projects
None yet
9 participants
@illusionofchaos
Copy link

commented Sep 24, 2015

Don't you think that nutrition should be made more realistic?

The values of the existing "nutrition" and "quench" properties can be made optional and be used to reflect changes to the perceived levels of thirst and hunger. But the real nutrition and hydration variables can be represented by two new item parameters - "calories" and "water percentage" (the percentage of water in the item's weight).

The character then should have "energy" (in calories) and "hydration" (in ml of water) properties, which should affect the body physically, while hunger and thirst should have a psychological effect and give player a rough estimation of real energy and hydration levels. These values can be decreased every turn taking into the account current weather, activity, weight, etc.

These properties will also make items' descriptions more realistic. The following:

Nutrition: 50
Quench: 12

can be replaced by

543 Calories
This item contains 250ml of water.

or (if the water percentage value is negative)

This item causes dehydration. Your body will lose 500ml of water.

Right now you can survive on zero protein (or the opposite - consume nothing but meat and feel great). This can be fixed by having a full-featured nutrition system that tracks the basic nutrients and vitamins. And the proposed changes can serve as the foundation for such system.

Another proposed change is to provide contents for items like this:

"contains" : {
    "alcohol":40,
    "caffeine":1,
    "orange juice":19,
    "water":40
}

and process effect, addiction and nutrition for each item recursively.

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

@drbig

This comment has been minimized.

Copy link
Member

commented Sep 24, 2015

I remember we had a rather long discussion about this on IRC. There was also that issue about fasting for 5 days and then having to eat 5 days worth of food :) In any case I'll maybe try to read this over the weekend (just being honest).

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2015

Changing nutrition display to calories sounds good to me, because then new players could quickly figure out how much food per day do they need.

Water content sounds rather unintuitive to me, because of the whole dehydration thing. It would need some really clever wording.
Instead I'd use the same unit for nutrition and water content for a while. "Water calories", except with some better name.

As for recursive content: that sounds like a lot of work and thus would require a good justification.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Sep 24, 2015

@illusionofchaos

This comment has been minimized.

Copy link
Author

commented Sep 24, 2015

@drbig, I believe this issue can be solved by limiting the volume of human stomach to 1 kg of food and digesting 0.5 kg food per hour. Some mutations should increase the digestion rate or the volume of your stomach. There should also be a parameter which increases by 1 point every turn when your energy(calories) equals zero. If this parameter increases above the certain value, you die from hunger (the energy won't ever fall below zero). While your energy is above zero, that parameter will decrease by 1 point every 10 turns.

@kevingranade, I've just had another idea. We can specify the percentage of macronutrients and calculate the calories using the following rules:

Carbohydrate = 4 calories per gram 
Protein = 4 calories per gram 
Alcohol = 7 calories per gram 
Fat = 9 calories per gram

It's not necessary for the percentages to sum up to 100.
So if we take the following item:

{
    "weight": 250,
    "contains" : {
        "carbohydrate":12,
        "alcohol":10,
        "protein":5,
        "water":40
    }
}

we can calculate the calories as 250*12%4 + 25010%7 + 2505%*4 = 345 calories.
The alcohol effect can also be precisely calculated based on 25g of alcohol.

As for perceived hydration, there is an issue with the sports drink that has quench value higher than water, because it won't look good if the description of 0.5L bottle says if contains 0,6L of water. Apart from that, the perceived hydration serves no purpose.

We can also keep a separate json with all micronutrients and drugs, containing their default units (g, mg, µg). Any item can optionally specify its micronutrient contents, vitamins should contain the daily recommended intake of all micronutrients. This will allow to create the comprehensive system without much effort.

For example, if we separate THC and CBD into different drugs, we can create various strains of weed with different potency and effects.

@Coolthulhu, I think it's easier to keep in mind that you should drink about 3 liters of water per day. If it's hot and you sweat a lot, you need to drink more.

About dehydration, for example, if an item that weighs 250g has water content of -200, its description should reflect the following instead of the water volume:

To account for dehydration caused by consuming this item, you should drink an additional 500ml of water.

If that value is positive, it is simply converted to ml and displayed next to the calories. (It will be like "water calories").

The recursive comestibles can be rather simple. Here is the example of pseudo-code:

void func consumeItem(item, int modifier = 1) {
    processEffect(item.effect) //any stuff not dependent on weight
    if item.childItems.isEmpty {
        processNutrition(item.nutrition * modifier) //any stuff dependent on weight
    } 
    else for (childItemId,percentage) in item.childItems {
        var childItem = getItemById(childItemId)
        consumeItem(childItem, item.weight * percentage / 100 / childItem.weight)
    }
}

The benefit would be in the very simple addition of new items without thinking about their effects and nutrition. All you need is to specify item's weight and child items' proportions.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2015

We can specify the percentage of macronutrients and calculate the calories using the following rules

Those rules do not adequately represent what nutrition does represent right now.
For example, chugging oil would give you lots of calories.

The benefit would be in the very simple addition of new items without thinking about their effects and nutrition.

I don't see how would that result from a change that actually introduces complexity.

Consider flour and oil vs johnnycakes.
Just going by macroingredients should give equal values on both sides. So instead of just balancing nutrition in game terms, you'd have to figure out how to properly represent increasing nutritional value in cooked food.

Most food items aren't just mixtures or sandwiches. Cooked meat is made from raw meat, but doesn't contain any raw meat.

@illusionofchaos

This comment has been minimized.

Copy link
Author

commented Sep 24, 2015

@Coolthulhu, well, in real life chugging oil also gives you a lot of calories.

I proposed macronutrients as the minimal required properties for any food item. Their intake should be balanced and protein consumption should be sufficient. It should be possible, but completely optional to manually specify calories and micronutrient contents of any item. But the main source of micronutrients in 2040 are probably vitamin pills.

Even now a single vitamin pill contains all required micronutrients for a whole day. Other than that, a person needs 0.8-2g of protein per kg of body mass daily, and everything else should be balanced between fat and carbs. The perfect balance is consumed energy = spent energy.

So it's possible for the daily menu to look like this:

  • a vitamin pill
  • 200g of meat / a vial containing a mixture of amino acids
  • oil and starch/sugar

And when I said about complex food, I didn't mean that all comestibles should contain child items, only the ones that are combined without further processing (mixtures, sandwiches, salads, alcoholic cocktails).

Also, judging from this article, the macronutrient calorie values mentioned by me are valid for cooked or otherwise processed foods, so it's possible to use "raw" flag and decrease effective calorie value by 25-50%. As for micronutrients, there are actually big losses from cooking.

All in all, this is just a discussion. I'm not advocating these changes, but it would be great for the game mechanics to be more realistic. I also think that complexity is a good thing for a roguelike.

@Headjack

This comment has been minimized.

Copy link

commented Sep 24, 2015

I think food needs a rebalance in some fashion, and I'm not opposed to this more simulationist kind of thing. One aspect I do feel strongly about is the value of superior recipes versus how worthwhile they are to bother making. In the current system, there are only a few higher-tier recipes that actually benefit you in any real way; it's only economical to eat cooked meat, biscuits, etc from a standpoint of maximizing Hunger restoration. There are things like wastebread, which let you use otherwise worthless ingredients, and things like soups that let dehydrated meat sub for fresh to allow stockpiling, but besides the big, brief morale boosts that lasagna and s'mores gives, almost all recipes are worthless.unless they convert spoiling foods into stable ones. Pelmeni, for example, isn't worth the flour or the meat to make when compared to Bread or Cooked Meat.

If cooking is reworked, morale boosts should extend over a long period, similar to shaving/haircuts, to represent 'living well' in the post-apocalypse. Some manner of rolling buff, seen when eating good food for a long period of time, such as 1% speed up or a constant morale increase would make better cooking worthwhile for the survivor. I'd even go so far as including dinnerware and a table in the equation; I'll make the effort to act civil if I had the time for it in the end of the world.

Cata food is intentionally a little weird and cartoony. Instead of Potions Of Speed we have Atomic Coffee. I think letting Spaghetti Al Pesto give you happy feelings and a spring in your step is in line with that philosophy.

@tyrael93

This comment has been minimized.

Copy link

commented Sep 26, 2015

One thing is discussing about a complete food rebalance that is not .json editing, the other is actually working on it. Can you actually make this yourself or do you need help with it? Because since it looks like a trivial, but of course interesting, change, this looks like one of the hundreds of brainstorming issues or threads in the lab that end up not being able to get off the ground.
So, you have the skills or not? Do you have a friend that can help you do that or not? 'Cause all the good coders are doing other stuff.

@adrianrieck

This comment has been minimized.

Copy link

commented Sep 29, 2015

It would be interesting if the player could become fat and slower as a result of fat but be able to use that fat later when the stomach is empty and then burn said fat.

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2015

@kevingranade commented on another PR that nutrition should relate to calories 1:1. Anyone know a good source on calories as far as our in-game foods are concerned?

@mugling

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2016

Effectively this is the vitamins system

@mugling mugling closed this Aug 11, 2016

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.