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

increase kcal spent walking with carry weight #36862

Closed
wants to merge 1 commit into from

Conversation

KorGgenT
Copy link
Member

Summary

SUMMARY: Balance "Increases calories spent at higher activity levels and with higher weight carried"

Purpose of change

First, the purpose was to write some tests. So, i did a little bit of research on hiking:
https://www.outsideonline.com/2315751/ultimate-backpacking-calorie-estimator
https://www.runnersworld.com/training/a20801301/calories-burned-running-calculator/
http://www.nwhiker.com/calorieburn.html
The first link actually allows you to put weights into the calculator and outputs calories burned. I ignored any gradients, and I didn't really use the equations supplied in those websites. Instead, I wrote some tests and tried to form the outputs to a "close enough".
Currently, the only one that does not match is running, but I think some more research on running should be done.

Describe the solution

Using a similar logic in the monster test, use avatar_action::move to move the test player, checking if it goes off the map and resetting its position when it does. Tally up the calories spent per turn (they only update every ten minutes) and do this for an hour.

Testing

Ran the tests locally.

Additional context

Doing this research did make it immediately obvious that activity levels above "none" do not burn enough calories. Therefore, I had to manually adjust the game constants until they were closer to the test. NOTE: there needs to be a test for moderate and for extra exercise levels in order to make sure those constants are also reasonable.

@KorGgenT KorGgenT added Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics 0.E Feature Freeze labels Jan 10, 2020
@calibraptor
Copy link

Nice.

tests/hiking_test.cpp Outdated Show resolved Hide resolved
@Brian-Otten
Copy link
Contributor

One thing i'm slightly afraid of is that because survivors can get a lot done in a day, especially with the 1 turn seconds, it might be a good idea to give this a test drive for 1 day of survival and see if you end up somewhere between 2-8k calories spent.
If its much higher then it starts to get a bit out of hand and the rates might need to be turned down some, or it might be an interesting idea to introduce some kind of exhaustion from doing too much in one day.
If it turns out it's within the range expected no other changes should be needed to merge.

@ghost
Copy link

ghost commented Jan 10, 2020

This type of modeling warrants more comprehensive approach. You should look into calorie saving modes that organisms go into, simple implementation might look something like:

  • in mild caloric deficit (losing weight but not starving) player burns 20% less calories but recovers stamina and focus 20% slower
  • in severe deficit up ratios to 50%, also needs more sleep

@kevingranade
Copy link
Member

One thing i'm slightly afraid of is that because survivors can get a lot done in a day, especially with the 1 turn seconds, it might be a good idea to give this a test drive for 1 day of survival and see if you end up somewhere between 2-8k calories spent.
If its much higher then it starts to get a bit out of hand and the rates might need to be turned down some,

This is backwards, if the game lets you do too much stuff in one day and that leads to unreasonable calorie consumption:

  1. That is now the game pushing back on you being unreasonably active over long times, which is good. If the activity level allowed in the game is higher than what is physically possible, that itself is a problem.
  2. If that is normally unachievable, it's an indication that as you say, the game should be doing more to discourage you from exerting yourself that much.

@Brian-Otten
Copy link
Contributor

Fully agree with you there kevin, some form of exhaustion from overwork in the day would be a better solution than reducing calorie consumption arbitrarily. But if that system isn't ready yet it might feel weird if some survivors start needing 15k calories a day.

@JeanLucVanDamme
Copy link

JeanLucVanDamme commented Jan 12, 2020

Agreed w/Kevin, we should make the models approximate reality, and let the outcomes limit player activity.

That said, there's some evidence that extra activity doesn't always translate to higher calorie expenditure. This study from a few years back showed that, when controlling for body size, age, and gender, a sample of hunter-gatherers expended about the same amount of calories as sedentary Westerners, even with far higher daily activity levels. Source: TIME article

One interpretation is that people may have metabolism set points that the body aims toward by adjusting the efficiency of various processes. If that's true, there are still probably limits to this compensation ability - maybe it only works for low or medium intensity activities, and only happens once you're quite fit and have no extra fat to burn off, and only for activities you have tons of experience with.

With those limitations assumed, what's the in-game consequence? Basically, let's say a fit survivor has a baseline calorie expenditure of ~2500 per day. Maybe he can do all the light to medium activities he wants, and he'll still expend a maximum of 800 (arbitrary choice) additional calories per day. However, very heavy (and/or novel) activities will still add to calorie requirements as usual, and induce exhaustion if those caloric needs aren't met.

This is a relatively new and understudied idea. There may not be enough data to create an accurate model. Does anyone else know of relevant research?

@kevingranade
Copy link
Member

kevingranade commented Jan 12, 2020

I did run across a paper with similar findings recently, but there are caveats that I think indicate that we can look into trying to incorporate this effect, but not in the short term.
https://www.cell.com/current-biology/fulltext/S0960-9822(15)01577-8?_returnURL=https%3A%2F%2Flinkinghub.elsevier.com%2Fretrieve%2Fpii%2FS0960982215015778%3Fshowall%3Dtrue

They did find that within a given range of activity, total energy expenditure increased sub-linearly with additional activity. However, there are serious caveats.

  1. The study didn't measure extreme activity levels. No all-day marathons, which is specifically the kind of thing we're trying to capture. It is not conceivable that this effect can cancel out extremes like expending thousands of calories a day running. As has been noted, there are other things that keep several-times-base metabolic rate activity levels from being sustainable, and we need to look into adding those seperately.
  2. The averages being maintained are medians over time, not instantaneous or even daily levels of calorie expenditure. There is no indication that calorie expenditures from activity are being lowered somehow, but rather that they are offset by reductions to basal metabolic rate.
  3. Analysis suggests that there are tradeoffs to this lowering of basal metabolic rate, like lowering cellular repair mechanisms or immune system activity. If we add discounted energy expenditure, we should also add the tradeoffs. Some might be practically free from a survival point of view, but others might be significant.

One interpretation is that people may have metabolism set points that the body aims toward by adjusting the efficiency of various processes.

I haven't seen this seriously proposed, it doesn't make any sense for the body to ever be less efficient at doing things, what I've seen proposed is that in particularly sedentary people the body might burn calories relatively gratuitously by e.g. triggering fidgeting, and at the other extreme the body might become overly parsimonious with energy by e.g. reducing essential mechanisms until an energy surplus is regained.

@ghost
Copy link

ghost commented Jan 12, 2020

Caloric deficit does slow down cellular repair (well, at least the game relevant - 'healing' aspect of it) but unless going into extreme deficit immune function is actually increased, and vice versa in surplus. This can be traced back down to simplest organisms exhibiting basically two operating modes - repair existing cells (to survive as long as possible) if low on food, and multiply as much as possible if enough food.

@JeanLucVanDamme
Copy link

JeanLucVanDamme commented Jan 14, 2020

Thanks for the thoughtful response, Kevin. Your analysis seems quite accurate, wrt the caveats of existing research and the likely tradeoffs of metabolic adaptations.

With those ideas as a base, two other things occur to me:

  1. IRL, daily marathons and the like may be more limited by physical recovery than by the calories needed. (Even if you could guzzle down 8,000 cals a day, after a few back to back marathons, you'd be bedridden for a while.)
  2. There's definitely physical/neurological (non-metabolic) adaptation to exercise - that is, a movement can become easier because you learn to perform it more efficiently. This might mean a small reduction in calories burned for the same apparent work. The effect is probably really small compared to the daily marathons we're talking about - it can't counteract the tradeoffs. But at least there's a lot more research on this aspect IIRC.

tests/hiking_test.cpp Outdated Show resolved Hide resolved
tests/hiking_test.cpp Outdated Show resolved Hide resolved
tests/hiking_test.cpp Outdated Show resolved Hide resolved
@KorGgenT KorGgenT force-pushed the carry-weight-kcal-burn branch from 5d84d0e to 15d9eb2 Compare April 5, 2020 02:44
@KorGgenT
Copy link
Member Author

KorGgenT commented Apr 5, 2020

upon further investigation, it looks like the calculations for how many calories you burn at elevated activity levels is wrong. https://www.hss.edu/conditions_burning-calories-with-exercise-calculating-estimated-energy-expenditure.asp

You're not burning anywhere near enough calories. This is not something i want to resolve right now, as it looks like a pretty significant amount of research and extrapolation, and i am not prepared to give up any brain space from the other projects I have going on right now. Ideally someone else can step up and help out to boil down this chart and related information for calculation of "what's the amount of calories you'll burn in 24 hours given an activity level"

@KorGgenT
Copy link
Member Author

KorGgenT commented Apr 6, 2020

So i'm going to close this pr as i found that rabbit hole that i can't dedicate time to right now and i don't want it clogging up the PR list right now. I may come back to it later.

@KorGgenT KorGgenT closed this Apr 6, 2020
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` Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants