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

wp_skill makes you avoid bad weakpoint #78797

Merged
merged 4 commits into from
Dec 30, 2024

Conversation

osuphobia
Copy link
Contributor

Summary

Balance "wp_skill makes you avoid weakpoint not beneficial"

Purpose of change

e4e3e1c introduced is_good which separates good weakpoint that is beneficial for you to hit from bad wp. I think we can make use of it.

Describe the solution

When calculating probability of hitting wp, use erfc if the wp does not benefit the attacker.
Now when you are good at hitting beneficial wp, you will also be tend to avoid bad wp.

Describe alternatives you've considered

Adjust the default difficulty of wp, but that will lead to many side effects.

Testing

It compiled :)
With no skill and no wp prof, the probability of hitting the body armor is 40%.
With some wp_skill, the probability decreases, and reduces to nearly zero with max gun skills and full set of wp prof.
2024-12-28 004334
2024-12-28 004430
2024-12-28 004550
2024-12-28 004530

Additional context

I'm working on combining critical hit and weakpoint for ranged attack, and decide to cherry-pick this feature out first.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Game: Balance Balancing of (existing) in-game features. labels Dec 27, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 27, 2024
@Maleclypse
Copy link
Member

Can you share the math so with like no proficiency no gun skill =base chance to hit bad weakpoint? Half proficiency and 5 guns what percentage of base weakpoint chance. Same for max and max.

@osuphobia
Copy link
Contributor Author

osuphobia commented Dec 28, 2024

Can you share the math so with like no proficiency no gun skill =base chance to hit bad weakpoint? Half proficiency and 5 guns what percentage of base weakpoint chance. Same for max and max.

Yah, still take cop z as an example:

  FALSE TRUE
prof_gross_anatomy 0 0
prof_intro_biology 0 0
prof_physiology 0 2
prof_wp_zombie 0 2
prof_wp_syn_armored -4 4
  wp_skill wp_skill - difficulty difficulty_mult raw_chance hit_chance
no skill no prof -4 -14 1 40 40
3 skill no prof -1 -11 0.999999981 39.99999924 40
3 skill wp_z 1 -9 0.999996602 39.99986409 49
3 skill wp_z wp_phy 3 -7 0.999767371 39.99069484 59
6 skill wp_z 4 -6 0.998650102 39.94600408 57
6 skill wp_z wp_phy 6 -4 0.977249868 39.08999472 47
8 skill wp_z wp_phy 8 -2 0.841344746 33.65378984 36
10 skill wp_z wp_phy 10 0 0.5 20 25
3 skill all_wp 11 1 0.308537539 12.34150155 18
5 skill all_wp 13 3 0.066807201 2.672288051 5
6 skill all_wp 14 4 0.022750132 0.910005278 1.8
8 skill all wp 16 6 0.001349898 0.053995921 0.1
10 skill all wp 18 8 3.16712E-05 0.00126685 0.003

The reweighed hit_chance is directly tested in game.

skill means you got such level of both base gun skill and certain type of gun skill.

@Maleclypse
Copy link
Member

I’m concerned with where it ends up at the all tens but I’m also not sure that’s a realistic concern in game balance.

@osuphobia
Copy link
Contributor Author

Then maybe floor difficulty_mult at 10% or something for bad wp?

src/weakpoint.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 29, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 29, 2024
@Maleclypse Maleclypse merged commit 396eecf into CleverRaven:master Dec 30, 2024
25 checks passed
@Maleclypse
Copy link
Member

Thank you for doing this!

@osuphobia osuphobia deleted the avoid-bad-wp branch December 30, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants