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

feat(balance): strength affects movecost of drawing bows #4145

Merged
merged 6 commits into from
Mar 2, 2024

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Jan 21, 2024

Purpose of change

This essentially serves as a followup #3575 by making strength also matter for drawing bows, which in turn gives a potential advantage to retaining a bow that's below what your strength could support instead of upgrading to one with higher damage.

Describe the solution

In character.cpp, set Character::item_reload_cost so that weapons that have STR_DRAW and a strength requirement gain a reduction in movecost if your strength exceeds the requirement. Same general idea as the STR_RELOAD effect right next to it, two main differences:

  1. The threshold to exceed depends on the weapon, unlike with STR_RELOAD which has a universal threshold to exceed.
  2. Since baseline movecost for drawing a bow is the same regardless of draw strength, unlike crossbows which have varied reload rates set up depending on how beefy they're implied to be, in this case we also the value to be penalized if you aren't strong enough.

Describe alternatives you've considered

Screaming.

Testing

  1. Set up a save in a test build with 10 strength, a shortbow, a longbow, and arrows in different tiles so I can test RAS time without this change.
  2. Compiled and load-tested the resulting saved test setup.
  3. Drew the longbow (10 str required), confirmed that the moves values shown are correctly still the same as during the first test.
  4. Drew the shortbow (8 strength required), confirmed that moves shown lower than before.
  5. Also tested handling a bow at lower strength, movecost goes up as expected.
  6. Checked affected file for astyle.

Longbow, before:
before 1

Shortbow, before:
before 2

Longbow, after (same numbers as before):
after 1

Shortbow, after:
after 2

As can be seen, actual reduction with the shortbow is ~88-90% instead of 80%. STR_RELOAD has the same issue where Character::item_reload_cost isn't the entire source of the total movecost as well, though given skill also affects the movecost it feels acceptable to have it not scale as aggressively.

Also, examples of longbow at 8 strength and 5 strength (lowest you can fire-at-penalty before it disallows drawing it), respectively:
8 str longbow
5 str longbow

As before, the total impact on movecost doesn't come out to exactly 200% movecost at half strength due to whatever other factors are involved, but probably for the best to not make the bonuses excessively extreme anyway.

Additional context

Checklist

@github-actions github-actions bot added the src changes related to source code. label Jan 21, 2024
@Coolthulhu
Copy link
Member

Coolthulhu commented Jan 22, 2024

What are the values in a typical situation? Sounds like it will only matter if you're debuffed into uselessness or using hydraulic.
How do the values compare to total firing time? It's OK to reduce the draw time component of it to 0, as long as it doesn't cause total draw+fire time to negligible.

EDIT: By typical situation, I mean "weak starting character" and "someone actually min-maxing bows to check if they're unbalanced"

@chaosvolt
Copy link
Member Author

chaosvolt commented Jan 22, 2024

What are the values in a typical situation? Sounds like it will only matter if you're debuffed into uselessness or using hydraulic. How do the values compare to total firing time? It's OK to reduce the draw time component of it to 0, as long as it doesn't cause total draw+fire time to negligible.

EDIT: By typical situation, I mean "weak starting character" and "someone actually min-maxing bows to check if they're unbalanced"

Values seem to be about what is seen above (though using a quiver or high hand encumbrance should push the values down and up, respectively) by default for all arrow handling, at or near 200 moves. Max seems to get hit at about 4 times the strength requirement of the bow but tends to actually reduce it to half in practice instead of down to a quarter, so making it uncapped should work without causing any weirdness if desired. Making it go up if you're under the strength threshold could also be done maybe, since unlike with STR_RELOAD there's no "the item's reload speed itself varies so the listed speed is the baseline for weak users already" thing.

The real issue is I dunno the most elegant way to make it scale up faster once you exceed the strength value, hmm.

@chaosvolt
Copy link
Member Author

Leaving this one for @Coolthulhu to weigh in on now that being below the strength requirement makes draw cost slower.

@scarf005 scarf005 merged commit f5b7547 into cataclysmbnteam:main Mar 2, 2024
13 checks passed
@chaosvolt chaosvolt deleted the str-draw-reload-speed branch March 2, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants