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

Add damage prediction to weapon tooltip #2007

Closed
LEGOL2 opened this issue Jul 1, 2021 · 4 comments
Closed

Add damage prediction to weapon tooltip #2007

LEGOL2 opened this issue Jul 1, 2021 · 4 comments

Comments

@LEGOL2
Copy link
Contributor

LEGOL2 commented Jul 1, 2021

PLATFORM and OS or BROWSER:
Windows 10 client

DCSS VERSION AND GAME INFORMATION:
0.26.1

DESCRIPTION:
There is no easy way to say which weapon is better, due to complicated formula for dmg calculation. I suggest putting simplified calculation of weapon damage roll inside tooltip, similar to how armor showing how your AC will change if you equip it. Because real damage formula takes a lot things in account, I suggest this formula would use:

  • weapon base damage
  • strength modifier
  • weapon skill modifier
  • fighting skill modifier
  • weapon enchantment

Currently it's not clear if +3 Battle axe is better than +11 hand axe, because of your skill levels.

@ebering
Copy link
Contributor

ebering commented Jul 1, 2021

This is a long-desired feature request, though instead of a tool tip previous UI prototyping settled on a "wield weapon" menu. See the wiki page.

Your list takes almost all of the non-temporary things that determine damage (as opposed to the AC or brand parts). The only thing missing is slaying bonuses from other equipment.

It seems like your suggestion is to create some kind of approximate formula and communicate this, which I will say is not a good idea. The melee damage formula doesn't change often, but a separate approximation is brittle code-wise and has the potential for incorrect edge cases.

The formula is complicated enough that it's a pain for a human trying to have fun playing a game to work with, but it is not a computational obstacle. It is straightforward to programmatically calculate the expected and maximum damage for two weapons given a fixed character. The problem is that these two numbers don't determine the distribution, because the distribution is a product. I'm not sure what is the best way to communicate this difference.

To be concrete, let's consider a 10str character with 0 fighting, 18.6 short blades, and 0 axes; and no slaying bonuses. What's the best way to compare their damage roll with a +0 dagger and a +0 war axe? Every number in this chart is exact, no fsim was used.

weapon base dam avg dam max dam
rapier 8 5.5 13.9
war axe 11 5.5 11

(I'm aware these aren't super realistic "well played crawl character" numbers, but my point here is to illustrate the difficulties in communicating a random variable through summary statistics. Bonus exercise, calculate the variance of the two and see if it helps.)

@LEGOL2
Copy link
Contributor Author

LEGOL2 commented Jul 5, 2021

Can we then represent weapon damage as 1dx + y? I understand that showing specific one number is not a good option, nor calculating average value, but giving player an information about roll and additional bonuses can make it more understandable.

Edit: I see that formula multiplies roll * Weapon skill modifier * Fighting modifier, so we can do something like 1dx * y + z where:
x = roll
y = Weapon skill modifier * Fighting modifier
z = slaying bonuses

@ebering
Copy link
Contributor

ebering commented Jul 5, 2021

Weapon skill modifier and fighting modifier are also random rolls. This is what I meant by "the distribution is a product". They're also computed using fixed point arithmetic re-scaling, so they don't have good representations as "dice". To save you the code dive they are:

weapon skill modifier = (2499 + 1d(skill * 100 + 1) )/ 2500
fighting skill modifier = (2999 + 1d(fighting * 100 + 1) )/3000

so that all together the formula (before enemy ac, with non-negative slaying) is:

(1d(stat-adjust-base + 1) * (2499 + 1d(skill * 100 + 1) ) * (2999 + 1d(fighting * 100 + 1)  / 7500000 + 1d(slaying + 1)

Guessing in the dark isn't going to produce something that gives the player more information than they already have (base damage, strength, weapon skill, fighting skill, total slaying), which is why this is tricky.

@LEGOL2
Copy link
Contributor Author

LEGOL2 commented Jul 5, 2021

You are right, thank you for this explanation. I think we can close this issue, as implementing this as a tooltip would be tricky and probably unhelpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants