Cataclysm-dda: Rule #1. CARDIO

Created on 23 Sep 2020  路  12Comments  路  Source: CleverRaven/Cataclysm-DDA

Is your feature request related to a problem? Please describe.

image
We've got these great stamina and weariness systems to represent humans tiring, and they're balanced well to a middle-of-the-road North American office person. However, a year into the apocalypse, survivors should have a lot more impressive endurance and physique, if they haven't starved to death.

Describe the solution you'd like

Introduce a new hidden stat, Cardio.

Cardio equals:
[ 1/2 BMR ] + [ Health ] + 10 * [ Athletics skill ] + [ Trait modifiers ] + [ Proficiency modifiers ] + [ Cardio_Accumulator ]

In this example, "health" is whichever of the terribly named health and health_mod is the long term total. Athletics skill is currently called "Swimming", I'll be fixing that soon.

The first implementation of Cardio should allow traits and proficiencies to include an attribute that increases or decreases Cardio so that we can have certain starting traits that bump Cardio.

This implementation makes BMR remain important, so traits and mutations that change your BMR will automatically change your Cardio a bit as well. It gives the Health trait some play, which will relate obesity and starvation to Cardio as well. The Athletics skill is minor and mostly just a flavour role, but it does have a little impact. Most of the work is done by the Accumulator score.

Cardio_Accumulator

  • This hidden stat tracks how much you have been exercising and adjusts it accordingly. It starts equal to 1/2 BMR, so that by default the starting Cardio trait is more or less equal to your BMR.
  • Track total kcal spent per 24 hours. Let's call this Daily_Cardio_Track
  • Every 24 hours, check if Daily_Cardio_Track is higher or lower than your total Cardio score.
  • Adjust Cardio_Accumulator if Daily_Cardio_Track is higher or lower, based the formula:
    Cardio_Accumulator += sqrt[ (Daily_Cardio_Track) - (Cardio) ] if Daily_Cardio_Track is higher, or
    Cardio_Accumulator -= sqrt[ (Cardio) - (Daily_Cardio_Track) ] if Daily_Cardio_Track is lower
  • Reset Daily_Cardio_Track to zero

So if you're a day 1 character with a BMR and therefore Cardio of 1700, and you spend 2000 calories, your Cardio_Accumulator should increase by sqrt(300)=17. If you spend all day digging pits and fighting and spend 7000 calories, your Cardio_Accumulator should increase by sqrt(5300)=73. Keeping it a square root prevents too dramatic a cardio increase in a single day.

We will need a sane max value for Cardio_Accumulator. I would suggest that 3xBMR would be an okay cap to start with. At that level, a person would be able to dig pits for around 6 hours before feeling any effects of weariness, and would only be tiring a bit by the end of a full day. This is consistent with physically fit people who work hard labour regularly.

Use Cardio in Weariness

Cardio replaces BMR as the weariness threshold value. Currently weariness threshold is 1/2 BMR. Change it to 1/2 Cardio.

Use Cardio in Stamina

Stamina is currently hard-set to 10,000 points. I suggest we change this to 2000 + [ 5*Cardio ]. That will keep the starting value very close to the same, keeps a manageable lower cap, and allows stamina to improve with activity.

Use Cardio in Stamina Regeneration

Currently base stamina regeneration is 20/turn. I suggest we change it to 5 + [Cardio/100] per turn. This will slightly boost stamina regeneration, but allows cardio to have a significant impact on stamina regeneration.

Describe alternatives you've considered

There are other ways we could calculate this. We could possibly have a diminishing returns formula on some of these aspects, although the nature of increasing cardio is such that it is harder and harder to maintain a high activity level for it.

I have not yet run the numbers to see how many days it would take of high activity to cap out at max cardio. That needs a sanity check.

Additional context

This will help a whole bunch of systems.
Given that health plays a role here, implementing #37446 along with this would be nice.

(P4 - Low) <Suggestion / Discussion> Character / Player

Most helpful comment

I feel like improving cardio should improve health, not necessarily the other way around.

All 12 comments

Cardio_accumulator is functionally similar to a skill (it improves in the long-term by performing specific activities), is making it a hidden stat untrackable by players really warranted?

It doesn't need to be fully hidden, but Cardio is something better expressed through secondary things like displaying your character's heart rate. I don't think there'd be anything too wrong with a descriptive string for it in the @ menu though

Can our characters run laps around the evac shelter to build up Cardio?

You could yes, or do the in game exercise activity, or just dig a bunch of pits and stuff.

Presently at least, I think the average survivor will build up cardio pretty quickly

Would cardio interact with health? I can imagine there is a bit of crossover.
Further, should it interact with mood and therefore focus?
I could imagine a situation of a character getting good feelings after finishing a workout.

Cardio equals:
[ 1/2 BMR ] + [ Health ] + 10 * [ Athletics skill ] + [ Trait modifiers ] + [ Proficiency modifiers ] + [ Cardio_Accumulator ]

Cardio as a stat shouldn't interact with mood, no. Workouts could give a positive morale boost but that's totally unrelated.

I feel like improving cardio should improve health, not necessarily the other way around.

What about Indefatigable and Languorous? Will these affect Cardio?

@cosmo-naut see #37446, which basically covers that. It predates weariness but it's easy enough to extend it.

@Xenomorph-III covered in the original cardio equation there:
[ 1/2 BMR ] + [ Health ] + 10 * [ Athletics skill ] + [ Trait modifiers ] + [ Proficiency modifiers ] + [ Cardio_Accumulator ]

Actual effects from languorous and indefatigable are relatively trivial to this issue

Sounds like a fun project. I will try my hand at a first implementation of cardio, although it seems like a very far reaching system and I don't know if I will be able to manage to do it all.

@gkarfakis19 I don't know the code, but at a guess, a good start would be adding the cardio stat and its calculations and integrating it into weariness and stamina, without adding the cardio accumulator portion. Then a further PR could add the exercise improvement portion.

Sounds reasonable.

Was this page helpful?
0 / 5 - 0 ratings