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

Stamina rebalance for 1s turns - take two #31781

Merged
merged 3 commits into from Jun 26, 2019
Merged

Stamina rebalance for 1s turns - take two #31781

merged 3 commits into from Jun 26, 2019

Conversation

nexusmrsep
Copy link
Contributor

@nexusmrsep nexusmrsep commented Jun 23, 2019

Summary

SUMMARY: Balance "Stamina rebalance for 1s turns - take two"

Purpose of change

Second try after failed attempt of bringing stamina back in line with desired values in reverted #31692.
At a glance it looked like a simple division would do the trick but the truth was different.

This time it's way deeper, as I literally walked the code there and back again for every instance of stamina.
This rework / rebalance forced me to redesigned some concepts and introduce some mechanics.
Where possible I stayed as close to original intent as possible, in other parts I had to do new stuff to make it work.

Describe the solution

  • initial stamina pool was raised from 1000 to 10.000
  • base regeneration and base burn ratios were added to external options,
  • stamina base regeneration rate was raised to 20 / turn, this means that resting 8m20s to get from 0% to 100%, slightly faster then before but not much
  • base stamina burn was raised to 26 15 (16 effective) per 100 moves, corresponding to about 250 stamina burn per 100 tiles (2,5% of max stamina)
    - this means that walking WILL slowly burn stamina, and this change is intended; with updated pool this also means that the burn will allow a very long continuous stroll before you need to rest few minutes
  • worth mentioning - existing mechanics imply progressive increase of stamina burn while walking/running due to how current stamina to max stamina ratio affects speed and movement, but this is intended too, and works smoothly - tiredness imply more stamina use
  • running burn ratio is almost as it was (relative to area traveled), x3 x7 walking, progressive
  • refactored stimulants/depressants effect on stamina bonus/malus accordingly to above - long story short, you don't want too much depressants if you're running away from something
  • oxygenator effect was remade, it bumps stamina regeneration x5 using 1/10 of applied bonus as power consumption (side note: I love the subtle internal mechanic of that CBM)
  • new mechanic: whenever ANY stamina drain passing mod_stat( "stamina", ... ) finds the bottom of stamina pool effect_winded is applied (previously it was only linked to running too much); this effect deals pain among other things so it allows bail-out from some activities (pulping for ex.)
  • effect_winded duration was raised to 10 turns, because it was barely noticeable and in some cases ended before you even have a chance to notice it and it's limiting effects; tl;dr: don't push your character to this limit, just don't
  • coughing was refactored to use percentage drain (5% max base stamina) instead of fixed value
  • new mechanic: muscle powered vehicles - stamina burn rewritten to be based on load which promotes drain when thrust comes into effect to gain speed and stabilizes on upkeep when desired speed is achieved; also follows the principle of more speed = more load = more drain; tl;dr: on a bike low and moderate speed will be easier to maintain stamina-wise
  • ranged/throwing burn rate - x10 to adjust to new pool + added offset for the stamina regeneration on turn when the throw takes place
  • smashing things - as above streamlined with the new pool
  • gun_fire stamina drain 0.02% base stamina, streamlined with the new pool
  • changed the obnoxious code that limited stamina loss while pulping, preventing it to go down half the bar, and replaced it with stamina burn each time you deliver a hit to the body, based on your pulping power; if you ever go down to the bottom of the pool, you will get effect_winded and pain, and will be prompted to bail out - you don't lose progress by doing so - damage is applied to dead bodies incrementally; if you don't bail out - effect_winded will mess you up
  • butchering - as above - I've unlimited capped stamina drain, dropped burn rate to 1/turn (those are looong actions), but here I've added a new mechanic to automatically halt the progress and wait for stamina regain when stamina drops to bottom; it may make the butchering significantly longer, but you will not end up in the middle of the job with no results. Starting fresh is a good advice, rest before butchering.
  • I simply had to fix the butchering times within this PR, because without it any balancing of butchering corpses would be futile, I think butchering time for items is also bonkers, but that was outside the scope
  • artifact stamina drain x10 to correspond pool change
  • melee stamina drain was also brought up to date

Describe alternatives you've considered

N/A (I think)

Additional context

  • Pinging @KorGgenT - I've did some touch-ups on your Magicalysm code, but you may want to take a look at energy_cost() when applied to stamina drain. I didn't want to touch it, because you may want it to be done in a particular way.
  • I've also added few debug lines in crucial places, so in debug mode you may observe the stamina drain/regen of movement and in vehicles. other were cut in cleanup
  • if someone could write some tests for the stamina, to do some sanity-checks, it would be splendid for the long run -- its a fragile code, but I'm not familiar to writing tests, so can't do it myself (yet)
  • this was pre-tested in game for individual elements, any synergy effect that I couldn't see, along with fine-tuning if needed - has to be the result of a prolonged gameplay on experimental
  • one more thing: this rebalance- in broader scope - might require visiting the jsonized stamina effects - those were not touched in this PR

@nexusmrsep nexusmrsep changed the title Stamina rebalance for 1s turns - take two [CR] Stamina rebalance for 1s turns - take two Jun 23, 2019
@nexusmrsep
Copy link
Contributor Author

After a bit of discussion walking will be returned to net positive balance of drain to regen ratios.

@esotericist
Copy link
Contributor

Subjective experience so far while testing:
I'm able to run a lot farther than I "expect" to. It seems something like twice as long? Not sure, since I didn't measure it beforehand.
I'm also able to carry things farther while burdened than I expect (even setting aside the fact that walking is currently stamina negative, when walking is made stamina positive this will be magnified).

I don't know that either of these things are necessarily a problem, but I didn't see anything in the PR that stated these were intended so I thought I would mention.

The run-for-longer thing is at least probably pretty neutral since it also takes quite a while to rest if you do manage to run out the meter.

I'll keep playing to see what else comes up.

@KorGgenT
Copy link
Member

RE: Magiclysm
My spells should just need to be adjust in json, which i will take care of myself, but i wanted to be kept in the loop so i can have it adjust roughly at the same time as this PR.
I don't see any issue with your adjustment to the code, actually. i'm not sure why i had that extra layer of caution on it, but i don't forsee any oddities there, as it should pan out since you won't be able to cast a stamina spell if you don't have enough stamina.

@nexusmrsep
Copy link
Contributor Author

nexusmrsep commented Jun 24, 2019

@esotericist
Thanks a lot for testing. Your observations mean that I'll have to pull the 0.D and do some extra side to side tests and comparisons to double check the excent of those deviations for fine tuning.

And if you plan to playtest it more could you check the stamina drain in melee combat? It might also be something that still needs tuning.

@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics Game: Mechanics Change Code that changes how major features work Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame <Bugfix> This is a fix for a bug (or closes open issue) labels Jun 24, 2019
@EvgenijM86
Copy link
Contributor

EvgenijM86 commented Jun 24, 2019

I have not tried this specific patch, but with current 1 second turn the game give you too much turns to acquire food and travel. I don't even use cars anymore to travel between cities - why bother, it takes less than an hour and does not tire you. In a single day I did two raids on a far away city and returned with 150 L shop cart each time, while killing and pulping hundred of zombies. And I was not even tired at the end of the day! Or is it normal for a 14 strength, 12 dex character?

edit: And pulping is ridiculously fast - it takes somewhere between 3-6 turns. Don't even need to wait until combat ends.

@nexusmrsep
Copy link
Contributor Author

I don't even use cars anymore to travel between cities - why bother, it takes less than an hour and does not tire you.

Perhaps city spacing should be higher - irl you'd have to travel much further to get from city to city. And I've been told that normal healthy person should be able to walk all day without getting tired stamina-wise.

And pulping is ridiculously fast

That can also be adjusted, but not in the scope of this PR

All in all: can you submit issue for both cases? That way it'd be easier to track down the things that need further rebalancing.

@EvgenijM86
Copy link
Contributor

All in all: can you submit issue for both cases? That way it'd be easier to track down the things that need further rebalancing.

It's not really an issue or suggestion. It's just my feedback. I was not sure were to put it, so I put it were devs try to balance 1 second turns. Maybe it was intended to be balanced that way.

@nexusmrsep
Copy link
Contributor Author

Ok, so I've run some extra side by side tests with 0.D and:

  • set the base walking stamina burn to 15 (effective 16) - this means it's net positive regen to burn ratio, even with high mouth encumbrance,
  • as a result running multiplier was moved to x7, and this also fixed what @esotericist noticed with the running distance - it should be now roughly the same as in 0.D
  • I've also used this comparison to test melee stamina burn, and also made some tweaks, so in effect current burn rate should be closer to what it used to be.

This I think settles the changes for this PR, unless someone points out some other things that are maybe not quite right.

@esotericist
Copy link
Contributor

I'll continue play testing shortly

@nexusmrsep
Copy link
Contributor Author

In this commit I've added extra small "buffer" for stamina in butchering action. Player will rest not at 0 stamina, but slightly above it - this should prevent instant winded effect on first move after the activity ends and you are low on stamina. Also reduce the chance of message feedback for character taking that rest, to reduce spam.

@esotericist
Copy link
Contributor

Having been playing with this for the last few hours, at this point nothing really "feels" off about this. I can sprint for short durations as needed, walk it off in a timeframe that doesn't feel too bad... it still takes quite a bit, even with no mouth encumbrance, to refill while walking.

So subjectively, I think this is good.

@nexusmrsep nexusmrsep changed the title [CR] Stamina rebalance for 1s turns - take two Stamina rebalance for 1s turns - take two Jun 25, 2019
@kevingranade kevingranade merged commit cf50251 into CleverRaven:master Jun 26, 2019
@nexusmrsep nexusmrsep deleted the stamina_rebalance_1s branch June 26, 2019 13:57
@TechyBen
Copy link
Contributor

@nexusmrsep Cannot dissect with the new update. Shall I post a bug report? Get exhausted then "nothing to butcher" error.

@nexusmrsep
Copy link
Contributor Author

nexusmrsep commented Jun 26, 2019 via email

@nexusmrsep
Copy link
Contributor Author

@TechyBen check #31873, it looks like a fix for that

@micage
Copy link

micage commented Jun 26, 2019

After butchering 3-4 corpses at once my stamina ran out and left me with unmanageable pain and far above my carry weight capacity. This new stamina change is significantly slowing down gameplay. I effectively have to wait until my breath comes back after butchering each single zombie. If that's the desired behaviour how could you even clear a single road part? You also have to be very careful on how much unbutchered corpses are stacked on one tile. Otherwise it could be your sudden end.

Game version is from today.

@nexusmrsep
Copy link
Contributor Author

nexusmrsep commented Jun 26, 2019

@micage thanks for confirming that it works as intended. Your observations are wrong - remember - there is a failsafe in there - so you NEVER drop to zero when butchering - it clearly says to you that you took few seconds breather during the activity to keep it going. Stamina bar follows. If you ignore the fact you're literally running on your last breath, and take a stroll, you're giving yourself a winded effect. Pain is a direct result of that. Rest few minutes. Zombies' bodies will wait.

Edit: also: dismembering and pulping will take less stamina then any long-duration butchering.

@esotericist
Copy link
Contributor

Also moving around overburdened costs stamina, even if you're walking.

Get a cart or travois if you absolutely must harvest parts from every zombie. Or just dismember or pulp them, as nexusmrsep said.

@micage
Copy link

micage commented Jun 26, 2019

Sorry, I ment pulping not butchering. I hit "s" on a tile with 4 unpulped corpses and stamina dropped to zero. I did not move after pulping but pain was unmanageable. Further pulping on the surrounding spots increased the pain even more, also decreasing my stats of course to ridiculous levels.
I tested this behaviour on OS X 11.6 and Windows 7 with the latest cdda version from github and different character setups.

Your observations are wrong

Really, dude?

@chphilli
Copy link

I haven't done anything particularly scientific here and I'm fairly novice in CDDA, so take this with a large grain of salt: but this feels like it went quite a bit too far.

I was playing around build #9220 and my character could literally wade through massive piles of zombies without getting winded, tired, or injured. ( Zui Quon is OP & needs a nerf. ) This was probably somewhat too strong...

... but then I updated to this patch and literally died to 3 regular zombies because my stamina plummeted to zero basically instantly while fighting, my stats plummeted to nothing, and then I couldn't escape. That character had something like dodge 8, melee 6, and unarmed 7 -- 3 zombies should have been a piece of cake even without Zui Quon at that point.

So I reset the world, started a copy of the same character and failed to even make it long enough to find a house where I could rest enough to cover my stamina. Any fight with even one zombie, for this new character with a 4 unarmed, 3 melee Zui Quon fighter drained stamina to basically nothing and left me with no way to recover.

Don't get me wrong, I love the idea of the balance change -- stamina should matter; but to basically be unable to fight at all, even for a character designed specifically for that seems like too much.

Thanks for reading & the work you put in to this!

@nexusmrsep
Copy link
Contributor Author

@micage

Sorry, I ment pulping not butchering.

Really, dude?

You said it was butchering, and if it would your observations would be in fact wrong. No offence. But now as you corrected that it was in fact pulping, then it's a different story and yes, that could happen. You see: in pulping there is no Fail-Safe, and you will get winded during the action if you start it on low stamina. The only Fail-Safe here is that you are primpted to continue when your winded effect gives you pain. Previously the calculation wouldn't allow stamina to drop below half the bar and it was simply stupid so I removed the limit. Pulping as a mechanic deals several blows to the bodies each taking some stamina. Pulping many bodies may drain you, and that's normal - it's intensive work repeated by number of bodies you pulp and their size. Hulk take lot more hits to pulp thus more stamina drain.

That said - I may consider adding a Fail-Safe here, same as in butchering. That would prevent getting winded during action but you'd have to rest afterwards anyway. What do you think?

@nexusmrsep
Copy link
Contributor Author

nexusmrsep commented Jun 27, 2019

@chphilli
For the melee stamina drain I'm open for discussion about fine tuning, since the change is not exact 1:1 port from previous mechanic. It is also possible that some rare interactions may take place to amplify the effect, and that needs to be considered if it's ok or not. There were also changes other then this to melee system that could add up.

In your observations: what was the main reason of stamina drain? Was it normal punches? Was it technique that multiplied punches? Did you use weapons? Would it not happen with the martial art off? Give me something more so I can try to replicate and test it.

My time is very constrained now as I'll be away for several days so I only have a tiny window to test that. In other case it may need to wait or be approached by someone else. Thanks for reporting.

@micage
Copy link

micage commented Jun 27, 2019

I have not observed a fail-save prompt before getting pain. I just pulped a pile of say 4 zombies and suddenly I had unmanagable pain. With my dropped stats running away was not possible. Even fighting a standard zombie that was approaching was impossible. Character had melee 4, light survivor gear and a fire axe. Normally this situation would be no problem for such a character.
As it is now pulping is a risk that you can not afford if there are any zombies arround. Also fighting 3 or more easy zombies could drain your stamina to a level where your stuck and not able to run away.
What about taking the situation before your change and making changes a bit more moderately.
Preventing a character getting into serious trouble in standard situations.
The discussion is complicated because each setup is different. But from my observations even mid-game characters with good gear and good melee stats are getting problems in easy standard situations.
Also waiting for breath coming back after each little fight and pulp is not very enjoyable from a game-playing perspective. Considering the vast amount of zombies you have to fight.

@Canivir
Copy link

Canivir commented Jun 27, 2019

I just realized what I thought was off with this PR: Stamina was completely time-agnostic. Everything besides butchering that took stamina was balanced around, and worked fine with, number of turns, not seconds, so it didn't need to be adjusted due to the turn time change.

Looking at a basic series of actions, say killing and pulping two zombies while a zombie walks toward me from about 50 squares away, since the zombie took ~50 turns before to reach me, he still will take ~50 turns now.

This means that since, after some code-diving, you seemed to have multiplied max stamina by 10, most action costs by 6-10, but effective regen rate only by ~2 (stationary:10->20, walking 3->5), you now end up at much lower stamina when the zombie reaches you than before.

In a more practical example, when I started a new game with the stamina rework, and using a reach melee weapon, I faced a "mob" of about 6 zombies. Now, I was fast enough to basically run circles around these guys, so this is a fairly trivial fight. But in order to not run out of stamina, I had to kite the last few zombies about halfway to the next town, vastly increasing the real time spent, and number of inputs needed to deal with 6 lowly standard zombies.

Don't get me wrong, I love the fact that you changed Winded to now actually matter, so I might hold tab next to 50 zombies on my kitted out melee char a little less, but the fact that stamina regen was effectively cut by about half per turn makes a lot of previously routine activities quite a drag.

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/1s-per-turn-and-stamina-action-economy/20799/1

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` Game: Mechanics Change Code that changes how major features work Mechanics: Character / Player Character / Player mechanics Time / Turns / Duration / Date Issues concerning any activities being too fast or too slow. Also issues about time and date ingame
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants