-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[WIP] [CR] Initial Cardio implementation. #44506
Conversation
I suggest you also take a look and maybe change |
Make sure to note this doesn't actually close #44370, it should say "partially fixes" |
Since this will be affecting the stamina pool, is there any chance that the indefatigable and languorous traits will get reworked to use this system? |
That's the plan. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
Go away stalebot, you're supposed to ignore feature freeze. |
I was just thinking about how to go about this myself (holy hell can i not code), but my idea was to tie it to one or more stats, since I'd assume most people would be using STS or STK |
Please feel free to take this code and improve it. Due to new responsibilities I don't have much time to work on CDDA these days, and I'd hate for my work to be wasted. |
I would very much like this merged, are you still around? |
Hey there. Unfortunately I am unable to dedicate any serious amount of time to modding anymore due to other obligations, but I’d be happy to see this merged, as long as someone else is there to implement the other half of this PR (cardio_acc). |
@@ -8265,9 +8267,12 @@ int Character::get_stamina() const | |||
int Character::get_stamina_max() const | |||
{ | |||
static const std::string player_max_stamina( "PLAYER_MAX_STAMINA" ); | |||
// ^^ this is now base max stamina, name not changed (for now) to avoid code changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments go above the line of code you're referring to, not below.
const int baseStamina = get_option< int >( player_max_stamina ); | ||
const int staminaMod = get_option< int >( player_cardio_stamina_mod ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const int baseStamina = get_option< int >( player_max_stamina ); | |
const int staminaMod = get_option< int >( player_cardio_stamina_mod ); | |
const int baseStamina = get_option<int>( player_max_stamina ); | |
const int staminaMod = get_option<int>( player_cardio_stamina_mod ); |
int Character::get_cardio() const | ||
{ | ||
return cardio; | ||
} | ||
|
||
void Character::set_cardio( int new_cardio ) | ||
{ | ||
cardio = new_cardio; | ||
} | ||
|
||
void Character::update_cardio() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would have this be a function that calculates cardio on the fly, instead of updating a cached value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't caching cardio; it's adjusting - actually, simply setting - cardio. OK, I see what you mean.
void Character::update_cardio_acc() | ||
{ | ||
//WIP- LATER PR | ||
cardio_acc = 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe dont' include this until said later pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If cardio_acc is 0, that leaves cardio based on half of BMR only.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
This pull request is now included in and superseded by #51880 |
Summary
SUMMARY: Infrastructure "Adds a cardio modifier to the player character that affects stamina max and regeneration"
Purpose of change
Look at #44370!!
Adds a general purpose Cardio modifier to the player character that affects the max stamina, stamina regeneration and weariness stats. Currently WIP, details of implementation based on issue linked, credit to @I-am-Erk.
I do NOT plan on adding the exercise (cardio_acc) aspect of Cardio in this PR. It will come later.
TODO List:
↓↓ These 3 should be investigated further in a new PR.
↑↑ These 3 should be investigated further in a new PR.
Describe the solution
Many changes to many files. Old functions refactored to use the Character::get_stamina_max() function and not to read directly from json.
Describe alternatives you've considered
Testing
Currently builds ( a true miracle ), although actual balancing cannot be undertaken until the addition of cardio_acc, which is going to be in a separate PR. Consider all values below to be of totally sedentary humans.
Character with Indefatigable, great health and 10 swimming skill.
Same character, without that trait and with 0 in swimming.
^^ EXTREMELY WIP NUMBERS (traits and skills shouldn't have that big an impact).
Additional context
Currently need comments and a lot of help on the implementation details. I have never attempted such far reaching code changes before. Specifically:
Comments Requested:
How often should update_cardio() be ran? Should it be recalculated after a certain amount of time (far more efficient but slow-to-react), say, every time bmr is recalculated, or should it be recalculated before every single instance of it's use (high performance impact, far more accurate)? Currently being calculated every 10 min.
How should stamina now be modifiable in json? Currently I make use of existing MAX_STAMINA json modifier, and I just use it as the base stamina before adding to it the cardio value, multiplied by another json modifier.
^^ Same question about stamina regen.
Check NPC behavior. Make sure these values don't apply to them.
New athletic proficiency?