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

max stamina modifiers from mutations now affect stamina regen #39533

Closed

Conversation

CodeBandit
Copy link
Contributor

@CodeBandit CodeBandit commented Apr 13, 2020

Summary

SUMMARY: Bugfixes "Max stamina modifiers from mutations now affect stamina regen"

Purpose of change

To normalize the time needed to recover stamina to 500 turns regardless of maximum stamina, and make certain traits make more sense in terms of time to recover stamina. Previously, languorous only needed 375 turns to recover all max stamina, and indefatigable required 625. Realistically, it makes no sense for an "unfit" person to recover faster than a "fit" person.

This also affects walking stamina regeneration, where indefatigable would gain 10 stamina instead of 5, and languorous would be at 0 net stamina from walking. The numbers for walking emulate fit/unfit stamina more realistically this way. Sprinting and crouching are barely affected.

Describe the solution

Apply max_stamina_modifier to stamina_multiplier for regen purposes. Movement costs remain untouched.

Stamina regen are as follows:
no mutation: 20 (net 5 stamina gain when walking)
Languorous: 15 (net 0 stamina loss when walking)
indefatigable: 25 (net 10 stamina gain when walking)

Testing

Enable debug mode to see stamina consumption
Check stamina regen and consumption across no mutations, languorous, and indefatigable.

@Brian-Otten
Copy link
Contributor

Brian-Otten commented Apr 13, 2020

I like this, since players being able to make a "fit" character in chargen with higher stamina regen has been in peoples wishlist for a while and this is a sensible way to do it.

If this change happens i'd seriously consider making these two four point traits, because they will have notably more effect. languorous in particular becomes really nasty with its net stamina drain while walking, even if carrying a light load with no mouth encumbrance, and indefatigable probably becoming the single best trait for melee characters.

@anothersimulacrum
Copy link
Member

I think this is the wrong solution. To fix the problem stated in purpose of change, the time spent should be multiplied by the modifier, not the stamina regen.

@CodeBandit
Copy link
Contributor Author

If this change happens i'd seriously consider making these two four point traits, because they will have notably more effect. languorous in particular becomes really nasty with its net stamina drain while walking, even if carrying a light load with no mouth encumbrance, and indefatigable probably becoming the single best trait for melee characters.

I agree langourous would be especially annoying in very long on-foot travel, but taking even half an hour of game time in manual steps game turns would be a long endeavor. Indefatigable becoming the single best trait for melee characters because of a slight enhancement to stamina regen is a bit of an exaggeration imo. Melee costs will far overtake the extra stamina regen that, by the time you run out of stamina, you may have only recovered enough stamina for about 5 more attacks. For movement, fleet-foot is far superior as a 2 pointer

I think this is the wrong solution. To fix the problem stated in purpose of change, the time spent should be multiplied by the modifier, not the stamina regen.

I'm curious as to how you would even multiply time spent when each turn is 1s (the smallest unit of time in CDDA)? Stamina regen is on a per-turn basis.

@anothersimulacrum
Copy link
Member

Oh, sorry, I misread the post. I thought you were saying it took 500 turns always, even when you may have only needed 375 or may have needed 625.

@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) <Exploit> Unintended interactions or behavior, usually breaking how the game is balanced [C++] Changes (can be) made in C++. Previously named `Code` Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies Mechanics: Character / Player Character / Player mechanics labels Apr 14, 2020
@Brian-Otten
Copy link
Contributor

I went ingame to double check and you were right, i somehow thought stamina costs for melee weapons were lower, but my 8/8/8/8 0 skill survivor needed 140 stamina for his 100 movecost hockey stick, so the indefatigable trait would have gained him 1 "free" hit every 28 hits.

Calculated as amount of hits till 0 stamina, it's 71 hits versus 93, which is a 30% increase.

I think that might be enough to go from 2 points to 3 points but it's a bit of an edge case.

@CodeBandit
Copy link
Contributor Author

CodeBandit commented Apr 17, 2020

I went ingame to double check and you were right, i somehow thought stamina costs for melee weapons were lower, but my 8/8/8/8 0 skill survivor needed 140 stamina for his 100 movecost hockey stick, so the indefatigable trait would have gained him 1 "free" hit every 28 hits.

Calculated as amount of hits till 0 stamina, it's 71 hits versus 93, which is a 30% increase.

I think that might be enough to go from 2 points to 3 points but it's a bit of an edge case.

If the stamina cost was 140, it would be 135 with indefatigable (applying the +5 stamina to it). That would make 12.5k/140 ~=89.3 hits for with the trait pre-buff and 12.5k/135 ~= 92.6 hits for with the trait post-buff. That's just an extra 3 hits with the trait, before and after the buff

This is of course without the consideration of increased stamina costs as stamina decreases

edit:corrections to calculation and explanation

@kevingranade
Copy link
Member

Negative net stamina regain when walking doesn't really work, walking is roughly defined as, "an indefinitely maintainable pace", and the system is tuned to make that happen.
Other than that I like this change and am inclined to apply it once we can sort out the walk thing.

@CodeBandit
Copy link
Contributor Author

CodeBandit commented Apr 19, 2020

@kevingranade

Negative net stamina regain when walking doesn't really work, walking is roughly defined as, "an indefinitely maintainable pace", and the system is tuned to make that happen.
Other than that I like this change and am inclined to apply it once we can sort out the walk thing.

Maintaining an indefinitely maintainable pace for walking (without mouth encumbrance) and also keeping the 500 steps is technically already true as the game is already coded. PLAYER_BASE_STAMINA_BURN_RATE is 15. The numbers shown above were what I got through testing with starting survivor gear which includes a slight mouth encumbrance, hence why I used 16 as the base instead. The real numbers without mouth encumbrance/max stamina are:
Langurous: +0 net
normal: +5 net
Indefatigable: +10 net

ZhilkinSerg and others added 16 commits April 20, 2020 14:56
Correctly namespace more math functions.
re-incorporates vehicular shelving that marries ceonvention between the vanilla `cargo_rack`, the `rack_blaze` from old blazemod and the `afs_hauling_space` from Aftershock. Predominately uses Shard's (from Shard's additions) `cargo_racks` as a direct reference.
take into account the opening and closing of doors/trunks
…op-construct

Fix compilation: use reference in loop, not copy
Migrate panel manager to ui_adaptor
…zemod-PR18

Blazemod Mini-PR: Re-incorporate shelving unit for vehicles
…easant-scenario

Make medieval peasant scenario more consistent
jbytheway and others added 21 commits April 27, 2020 07:41
Fixes CleverRaven#39879.

We now stop tracking requirement values when the achievement is
completed or fails.  Moreover, fixes a bug where a completed achievement
could be un-completed by further changes to the underlying statistics.
Use points instead of int pairs, point arithmetics.
Several helper methods added.
…_tracking

Revamp achievement requirement tracking
Fix items having inappropriate charges in chargen
* dynamic aim window

Make aim window dynamically shrink in size whenever sidebar is set to compact

* fix astyle regressions

* use right_print

Right align text using right_print instead of janky solution

* Set up to split project into two parts

Add conditionals to exclude Numbers indicator style, to work on later. Also fix minor bugs.

* Right align "moves to fire" text and remove hotkeys display

* fix translation markers

fix translation markers and clean up some code

* text handling

Minor refactor of aim strings, change "moves to fire" to "moves", detect length of "symbols" line and wrap if necessary

* revise text wrapping

* commit suggestions

* use correct types

* Fix conflicts

Fix conflicts by adapting code into new existing code

* astyle

* trim includes

remove the unnecessary includes that I accidentally added during fixing conflicts
…eyes-and-mouth

Barbute helm now covers eyes
@CodeBandit
Copy link
Contributor Author

Will Re-PR due to rebase (Is there a less verbose way to do this?)

@anothersimulacrum
Copy link
Member

Yeah, it looks like you rebased incorrectly somehow. I've been continually rebasing #38912 (roughly every force-push is that), and the commit history is still intact.

@CodeBandit
Copy link
Contributor Author

Likely because I'm just pushing the changes from the rebase of upstream/master, not force-pushing. I will keep that in mind for the future, thanks!

@CodeBandit CodeBandit deleted the Max-Stamina-on-recovery branch May 7, 2020 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Exploit> Unintended interactions or behavior, usually breaking how the game is balanced Mechanics: Character / Player Character / Player mechanics Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.