Patch project: make weapon screen info like spell screen


Questions, Explanations, Howtos

User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 14th January 2011, 07:14

Patch project: make weapon screen info like spell screen

Okay, I've checked out trunk using git and I'm looking at fight.cc to at least get a sense of the damage and to-hit calculations. I want to make sure I'm reading this right, because I'm not familiar with C or C# or C++ or whatever language this is:

- the main function / class / procedure / widget for melee damage is player_calc_hit_damage (3830)
- it starts with potential_weapon_damage, which is the base damage of the weapon, modified for hands required and body size (3834) and for shield penalty if applicable (3843)
- then base damage is modified for player stats (3846)
- then base damage is modified for slaying bonuses (3851)
- So by this point, you have something like 14 or whatever as your potential damage. Up to this point everything is calculated and now it's time to start rolling dice

- Now, the first roll is for potential damage, and then extra damage gets rolled for each of weapon skill, fighting skill, misc. modifiers (for might & starvation), and weapon bonuses (enchantment level & racial). (3852-3857)
- Stabbing damage if any is added
- Damage is reduced by monster AC

- Now there's a check to see if the monster is dead.
- If not, weapon brand is applied (3173 is the function but different brands get handled differently from here on and I have to go to bed... also as noted above weapon brands should not be factored in to the damage estimate, but just listed separately)

I think I could code a function that would generate some measure of damage potential from the above .... Speed is probably easy compared to this, and probably To_hit is easier too. I can crunch these formulas. Then I'll have to figure out the interface issues. I think I can do this!
Okay, I think I'm starting to make sense of this. If I need pointers, where's the most appropriate place to ask these kinds of questions?

For this message the author danr has received thanks:
evktalo
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 14th January 2011, 09:52

Re: Things that should be more transparent

good that you're tackling this! You seem to have figure it out fine (even though you haven't chosen the easiest patch to make as your first). If you want to take a look at the spell listing function (for the interface), it's in spl-cast.cc:195

For help, there's always ##crawl-dev. You can also create a coding section here on the forum.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 14th January 2011, 15:44

Re: Things that should be more transparent

galehar wrote:For help, there's always ##crawl-dev. You can also create a coding section here on the forum.


Thanks. I didn't want to create such a section without dev blessing.

It could perhaps be restricted for access by devs and mods only (as I'm not technically a dev) or anyone nominated by the devteam.

I've thought of an easy way to do it: basically copy and paste all the damage-determining functions, and then just replace the randomizing aspects of them with mathematical determinations. So eg (25 + random2(basedamage))/25 would simply become (25 + (basedamage+1)/2)/25.

Then you just determine damage using the same central control function as in melee, you just get a calculated instead of a randomized results.

It would also be good to take the constants (78, 25, etc.) that are used various places and make those globally accessible so that they can be updated centrally and the damage estimating function remains accurate if those constants are ever tweaked. Failing that, proper documentation could ensure that both places are updated.

Or: is there a function than can calculate the min, max and average values that a certain function might generate?
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 14th January 2011, 16:18

Re: Things that should be more transparent

danr wrote:
galehar wrote:For help, there's always ##crawl-dev. You can also create a coding section here on the forum.


Thanks. I didn't want to create such a section without dev blessing.

It could perhaps be restricted for access by devs and mods only (as I'm not technically a dev) or anyone nominated by the devteam.

I wouldn't restrict it. There are more and more players who are submitting patches and it is great. Let them help each other. My guess is that a lot of devs just won't come here, but I'll help if I can. For the most tricky stuff, you'll have to go ask the real experts on ##crawl-dev :)

danr wrote:I've thought of an easy way to do it: basically copy and paste all the damage-determining functions, and then just replace the randomizing aspects of them with mathematical determinations. So eg (25 + random2(basedamage))/25 would simply become (25 + (basedamage+1)/2)/25.

Then you just determine damage using the same central control function as in melee, you just get a calculated instead of a randomized results.

I'm not sure exactly what you mean, but copy/paste code is the wrong way to do it. Avoid code duplication at all cost. I think you need to create a new function with a boolean parameter that returns either a static result for display (max or average), or a random result for actual damage in combat. As a general advice, don't write your code "on top" of the existing one by fear of breaking what is existing, or it will end up ugly and hard to maintain. Almost every change leads to some refactoring.

danr wrote:It would also be good to take the constants (78, 25, etc.) that are used various places and make those globally accessible so that they can be updated centrally and the damage estimating function remains accurate if those constants are ever tweaked. Failing that, proper documentation could ensure that both places are updated.

Or: is there a function than can calculate the min, max and average values that a certain function might generate?

Replacing hard coded numbers by const, #define or enums is always a good move. Most of them go in defines.h, but they can also go in local header (ie: fight.h) if they have only local relevance. No written rules for that, so there's already some inconsistencies regarding that. Myself, I often wonder where to put them when I create new constants.

Also, I have a great news for you and all other patchers and future devs: we're just starting a project to properly document the source code!
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Thursday, 3rd February 2011, 21:52

Re: Patch project: make weapon screen info like spell screen

Okay, I've completed my exercise of calculating weapon damage via spreadsheet so that I have a grasp of the factors before trying to work on this patch. It also gives me a sense of scale and of what kind of information is doable and would be useful.

On that 2nd point, here's what I think I've learned:

- Speed is best shown as attacks / turn, as this is most intuitive.
- Here the possible range is from a max of 5 (delay of 2 can be achieved with haste) down to a minimum of 0.5. A ten point scale showing increments in 0.5 would be perfect. Speed brand should be factored in here.

- Accuracy - this is easy to calculate. A default EV of 10 or 12 can be used for the calculation. Your to hit roll might be something like 30, and against a monster with EV 10 this means you have to roll >10 out of 30 to hit. That means a 10/30 chance to miss and a 20/30 chance to hit. So hit % again can be on a scale of 1 to 10, with each pip representing 10%.

- Damage - this is trickiest to scale. An adjusted base damage should be used, and shown in whole numbers just as base damage currently is. This would probably be roughly double the average damage per hit shown in my spreadsheet. Accuracy, delay, and brands should NOT be factored in here. Neither should monster AC.

On that last point, I did an experiment with my spreadsheet. A dwarf with 27 levels in fighting and in axes, total strength (incl. might) of 40, a +9 dwarven executioner's axe, and +10+10 in slaying, would average 50.9 damage per hit.

By contrast, I think the minimum average damage per hit would be 0.5, because I think there is always a chance of doing 0 damage and there is always a chance of doing at least 1 damage.

This is difficult to set a scale for because it ranges so widely over the game (from 0.5 to 50) but in the earlier part of the game small differences are much more important.

For example a halfling hunter starts with a dagger, no fighting skill and no weapon skill. For them, a short sword will do 2.8 on avg. per hit, while a sabre will do 3.3 on avg. per hit. That is a significant difference when hobgoblins are still a real threat.

It would be best to show something like base damage, just adjusted for skill, shield, stats, etc. This would probably be something roughly double the average damage. This now creates a meaningful differentiation - the short sword above would round to 6, and the sabre would round to 7, which matches the base attributes of those weapons. Then the player sees a whole number that is directly comparable / consistent with the base weapon information.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 3rd February 2011, 22:35

Re: Patch project: make weapon screen info like spell screen

danr wrote:Okay, I've completed my exercise of calculating weapon damage via spreadsheet so that I have a grasp of the factors before trying to work on this patch. It also gives me a sense of scale and of what kind of information is doable and would be useful.

Good work. Thanks!

danr wrote:- Speed is best shown as attacks / turn, as this is most intuitive.
- Here the possible range is from a max of 5 (delay of 2 can be achieved with haste) down to a minimum of 0.5. A ten point scale showing increments in 0.5 would be perfect. Speed brand should be factored in here.

I don't think so. That would mean # = 0.5 attack per turn = delay 20. ## = 1 attack per turn = delay 10. You've lost all the delays in-between 10 and 20. Better use the delay as a scale, but it doesn't have to be linear. A difference between 18 and 20 is much less significant than between 5 and 7.

danr wrote:- Accuracy - this is easy to calculate. A default EV of 10 or 12 can be used for the calculation. Your to hit roll might be something like 30, and against a monster with EV 10 this means you have to roll >10 out of 30 to hit. That means a 10/30 chance to miss and a 20/30 chance to hit. So hit % again can be on a scale of 1 to 10, with each pip representing 10%.

But when you reach 100%, you still have a hard time hitting a monster with EV 30.

danr wrote:- Damage - this is trickiest to scale.

It would be best to show something like base damage, just adjusted for skill, shield, stats, etc. This would probably be something roughly double the average damage. This now creates a meaningful differentiation - the short sword above would round to 6, and the sabre would round to 7, which matches the base attributes of those weapons. Then the player sees a whole number that is directly comparable / consistent with the base weapon information.

I'm not sure. The player is going to wonder about the relationship between the 2 numbers. It might not be really helpful. Or maybe I misunderstood your proposal.
You might want to use a logarithmic scale, like the one used for spell power. It might seem counter-intuitive, but it's a great way to always show relevant information, which is what the "not showing number" policy is about.
Also, don't spend too much time on the damage formula. I don't know when it will happen, but it needs to be rewritten (so that weapon skill, attributes and strength weighting have a bigger impact). So don't bother if it is a bit inaccurate and focus on the speed, accuracy and general interface.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 01:24

Re: Patch project: make weapon screen info like spell screen

minmay wrote:
galehar wrote:You might want to use a logarithmic scale, like the one used for spell power. It might seem counter-intuitive, but it's a great way to always show relevant information, which is what the "not showing number" policy is about.

Going to have to disagree here, as the spell power scale confused me to no end until I read spoilers.

Because you expected it to be linear?
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 4th February 2011, 02:46

Re: Patch project: make weapon screen info like spell screen

Okay, getting a bit off track...

To refocus:

SPEED

Galehar, you're right, my idea was wrong. It's best to show delay, not attacks/turn.

ACCURACY

As I understand it, 100% is impossible to achieve unless you had 0 EV. Also, unless I misunderstand, a player with a To Hit roll of 30 could NEVER hit something with EV 30 (or it might be a 1/30 chance). Again, I calculate chance to hit (accuracy) as 100% * (1-(EV/To Hit)). So:

To Hit: 20 vs EV:5 = 1-(5/20) = 75%

To Hit: 20 vs EV:10 = 1-(10/20) = 50%

To Hit: 40 vs EV:5 = 1-(5/40) = 87.5%

To Hit: 30 vs EV:27 = 1-(27/30) = 10%


DAMAGE

I went back to my spreadsheet and found I was able to easily come up with a score that is"compatible" with the current "base damage" that people have been happy to use to compare weapons with.

The result for a starting MDFi is that: a regular mace would show base damage of 9 instead of 8 (a result of str weighting, and a dwarven mace would show base damage of 11 for a starting MDFi. This accurately portrays the actual comparative effectiveness of the weapon in the game, and I think it makes sense that a character would intuitively know how good / comfortable they are with a weapon.

Now, rather than showing it as an "adjusted base damage" obscuring the base weapon properties, we could show a "character bonus" that captures all the hidden bonuses as well as the effect of slaying bonuses. This is easy to generate - just take my "adjusted base", substract the original base damage, and you have your "character bonus". It would exclude the weapon's own enchantment, that is a weapon property, not a character bonus.

All that's necessary then is to add a line like "Your (race skill/equipment/stats) provide a further +3 to the base damage of this weapon". The MDFi who chooses the spear and does no unequip their shield will see something like "Your equipment (etc whatever) results in a -2 penalty to this weapon's base damage."

The character doesn't need to be told how much bonus comes from each variable, or explicitly what the total is, though it is easy to add base damage + weapon enchantment + character bonus.

This is very minimalist in a way. Weapon info is exactly as now, it just adds transparency to those many obscure factors.

I hope people are receptive to this, I have had my head buried in this and think I have a good grasp on it. Seeing how complex these factors are, I don't blame anyone for not making them clear to the player before this, but I've done the work, I see it as doable, and would like to make it happen.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 4th February 2011, 09:37

Re: Patch project: make weapon screen info like spell screen

minmay wrote:
galehar wrote:You might want to use a logarithmic scale, like the one used for spell power. It might seem counter-intuitive, but it's a great way to always show relevant information, which is what the "not showing number" policy is about.

Going to have to disagree here, as the spell power scale confused me to no end until I read spoilers.

Actually, I found it confusing when I started reading spoilers on it and trying to understand how it works. It's logarithmic compared to the numerical value of the spell power, but I think it is linear (or somewhat linear) with the actual effect the power has on the spell.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 4th February 2011, 09:38

Re: Patch project: make weapon screen info like spell screen

danr wrote:All that's necessary then is to add a line like "Your (race skill/equipment/stats) provide a further +3 to the base damage of this weapon". The MDFi who chooses the spear and does no unequip their shield will see something like "Your equipment (etc whatever) results in a -2 penalty to this weapon's base damage."

That's an interesting and original approach. It's certainly worth trying out.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 11:32

Re: Patch project: make weapon screen info like spell screen

danr wrote: [snip ideas]
I hope people are receptive to this, I have had my head buried in this and think I have a good grasp on it. Seeing how complex these factors are, I don't blame anyone for not making them clear to the player before this, but I've done the work, I see it as doable, and would like to make it happen.

This is good, but it'd be best suited for inspecting weapons from the inventory, I assume? That's useful, but different from the weapon stats screen we're also talking about?
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 4th February 2011, 16:59

Re: Patch project: make weapon screen info like spell screen

I have some ideas brewing for both interfaces. I'll do some mockups and post them for discussion.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 4th February 2011, 18:40

Re: Patch project: make weapon screen info like spell screen

Image

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 21:16

Re: Patch project: make weapon screen info like spell screen

The two lines for the weapon inspection screen are awesome. They should come immediately after the line with the base stats, though.

For the wield screen, it's very desirable to get the information for each weapon on a single line. I have a feeling that is possible. If need be, we could use two screens, as we do for spells (but hopefully not).

Good work!
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 4th February 2011, 21:32

Re: Patch project: make weapon screen info like spell screen

Great!

I'll give a shot at condensing it. However, some weapon descriptions could be very long.

What is the max # of columns that should be used? 80?

Abbreviations for the three attributes are an option, e.g. Acc: Dam: Delay:. Also, these could be column headings so they don't take space in each row. Actually, that would make it easy. I'll do another mockup, also demonstrating a few other permutations. I should do one for a high level character too.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 21:47

Re: Patch project: make weapon screen info like spell screen

Yes, 80 columns. And I was thinking of column headings, just as the spells and skills screen use.

Server Admin

Posts: 89

Joined: Wednesday, 15th December 2010, 23:13

Location: Germany, Europe

Post Friday, 4th February 2011, 22:58

Re: Patch project: make weapon screen info like spell screen

While you guys are at it - would it be very difficult to also show attack speed for ranged weapons (crossbows/bows/slings)? Currently the @ screen seems to always show "average attack speed", even though I have a shield that, according to the game, significantly slows the rate of fire. Thanks!
Please report bugs to the bug tracker, and leave feedback on the development wiki. Thank you!
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 4th February 2011, 23:00

Re: Patch project: make weapon screen info like spell screen

A few comments:

I moved delay to the first column to make it easier to fit in the additional brand descriptor next to the damage amount, as I think that's the best place to indicate that as brand effect is closely tied to damage for many brands.

The column for "enchantments" is where the speed reduction from speed brand would show up. Haste, skill, shield effects all show up in the last line for "all other"

"Weapon Accuracy" includes the base 15 to hit that applies to every weapon.

Image

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 23:17

Re: Patch project: make weapon screen info like spell screen

Napkin wrote:While you guys are at it - would it be very difficult to also show attack speed for ranged weapons (crossbows/bows/slings)? Currently the @ screen seems to always show "average attack speed", even though I have a shield that, according to the game, significantly slows the rate of fire. Thanks!

Really good point. Those should be addressed, indeed.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Friday, 4th February 2011, 23:56

Re: Patch project: make weapon screen info like spell screen

danr wrote:A few comments:

I moved delay to the first column to make it easier to fit in the additional brand descriptor next to the damage amount, as I think that's the best place to indicate that as brand effect is closely tied to damage for many brands.

The column for "enchantments" is where the speed reduction from speed brand would show up. Haste, skill, shield effects all show up in the last line for "all other"

"Weapon Accuracy" includes the base 15 to hit that applies to every weapon.

This looks great.

A couple of comments: it might be a good idea to actually split the new line into two: one for permanent effects (skill, shield etc.) and the other for temporary things (might, haste)... not sure.
I needed some time to understand the -6 attack delay for the weapon of speed. Not sure something special is needed there... the speed brand isn't the best of them anyway.
In the wield screen, it is probably not necessary to reserve a line for the randarts. But that's a minor detail.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Saturday, 5th February 2011, 00:37

Re: Patch project: make weapon screen info like spell screen

dpeg wrote:I needed some time to understand the -6 attack delay for the weapon of speed. Not sure something special is needed there... the speed brand isn't the best of them anyway.


Can you clarify what you mean by this? Are you suggesting just not showing the modifier?

In terms of things that affect accuracy, speed and damage:

character size / weapon size / weapon hands
is it a staff?
staff w/ shield?
1.5 hander w/ shield?
Armour EV penalty
armour skill
Shield EV penalty
shield skill
shield size / character size
rings / randarts of slaying (inc. amulet of inaccuracy)
might
haste
berserk
starving
slow
invisible without SInv
fighting skill
weapon skill
str
dex

I've probaby missed some. I could look at it, but I think it would be tricky to separate these into two types. Perhaps into direct "slaying" type bonuses / penalties and other? It's tough though because many of these are interrelated.

I also don't want to get into too many rows of different modifiers, it starts feeling too metagamey / minmaxy. If players want to know e.g. the effect of their shield, they can unwield the shield and see what happens. Or invoke Might and see the result. In fact I'd even be inclined to collapse the enchantments and others into one line called "total modifiers" or something like that.

One snag that comes to mind is that the wield weapon screen is not accessible while berserk. I guess you can still look at it through the inventory info though.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Saturday, 5th February 2011, 01:08

Re: Patch project: make weapon screen info like spell screen

danr wrote:
dpeg wrote:I needed some time to understand the -6 attack delay for the weapon of speed. Not sure something special is needed there... the speed brand isn't the best of them anyway.


Can you clarify what you mean by this? Are you suggesting just not showing the modifier?

I was talking to myself whether the -6 should be explained with a (speed) or similar.

danr wrote: In terms of things that affect accuracy, speed and damage:
character size / weapon size / weapon hands; staff; staff w/ shield; 1.5 hander w/ shield; Armour EV penalty; armour skill; Shield EV penalty; shield skill; shield size / character size; rings / randarts of slaying (inc. amulet of inaccuracy); fighting skill; weapon skill; str; dex
might; haste; berserk; starving; slow; invisible without SInv

The ones in the last row (might, haste,...) are of a different nature than the rest. They come from temporary in-game effects (I'd add Agility, too). The distinction is probably not necessary, but, as I see it, the weapon figures without effects from this last row are the meaningful ones.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Saturday, 5th February 2011, 04:15

Re: Patch project: make weapon screen info like spell screen

The difficulty is that the status effects affect speed/damage/accuracy in part by modifying the str/dex/speed that feed into the first set of modifiers. I guess the effect could be teased out by calculating both with and without the status effects and subtracting.

However, rather than separating them out into separate lines, I'd be inclined to either just not show the effect of status effects at all, or just lump them together.

There's no real loss in lumping them together though. The player can just review weapons when not subject to any temporary status and then with. Once they get the sense of the kind of effect might has it's pretty easy to understand.

Another approach could be to not include status effects in the inventory screen, as that is a general description of the weapon and your general ability with it, but then DO include status effects in the calculation in the wield weapon view, as that shows the effect of wielding that weapon at that precise moment.

That would create a problem of not being able to see the effects of berserk because one can't access the wield weapon screen while berserk. Two possible solutions: in inventory, display the current properties of the wielded weapon together with the (weapon) indicator for the wielded weapon, or let berserk characters access the wield weapon screen, and just give a "fail" message if they actually try to select another weapon.

However, to start, I say KISS (Keep It Simple) - just show the total effect. If in future there's a desire to break things down more we can do that then.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Saturday, 5th February 2011, 14:31

Re: Patch project: make weapon screen info like spell screen

danr wrote:However, to start, I say KISS (Keep It Simple) - just show the total effect. If in future there's a desire to break things down more we can do that then.

Yes, of course. Keep it up!
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Monday, 7th February 2011, 10:42

Re: Patch project: make weapon screen info like spell screen

I think you shouldn't split temporary and permanent effects. Either show only permanent, or show current. Showing current is probably better and more consistent with the rest of the interface. I've been thinking of changing the colours of numbers depending on status effect, but it's going to get complicated if you're subject to several.
Also, about the wield screen, I think you should use # lines for speed and damage. That way, you can compare both the current values of weapons, but also their potential. So the player can quickly see that weapon A is better than B, but also that weapon B has the potential to be better than A if the player trains the skill high enough.
So precise numbers like you suggested in the weapon description, but dashes and adjectives (for accuracy) in the wield menu so that comparing weapons doesn't feel like reading a financial spreadsheet.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
dpeg

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Monday, 7th February 2011, 19:01

Re: Patch project: make weapon screen info like spell screen

I'd support showing current stats as well. This interface is looking great!

I know there's been a discussion of this recently, but here's my two cents. The number of attacks per turn (speed) is a more intuitive measure (to me!) than delay: Speed = 10 / delay. The trouble with delay is that a delay of 2 is much much better than a delay of 3 (5 attacks per turn versus 3.3), while a delay of 15 is only marginally better than a delay of 16 (0.7 versus 0.6). Using attacks/turn, players can make better guesses about damage potential more easily.

This has made me realize that weapon skills and speed interact in a funny way. Take a dagger. As the short sword skill trains from 0 to 2, a relatively smaller improvement is made in weapon speed than when short sword trains from 8 to 10. This is not so bad in and of itself but is kinda funny when no improvement is make when training from 10 to 12. (This effect is more noticeable for quicker weapons.)

I've heard the same critique of miles-per-gallon. You have to invert it to yield gallons-per-mile to get a good measure of how much gas will cost or of the amount of carbon released. It makes potential buyer think that they can save as much from going from 10 to 15 mpg as from going from 15 to 20. In reality, going from 10 to 15 will save more money/carbon than going from 15 to 20.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Monday, 7th February 2011, 19:28

Re: Patch project: make weapon screen info like spell screen

Image

I thought the inv. info screen could use a little tightening, see above.

As for the wield screen - I think I'd need to see a mockup of what you are describing, galehar.

I hear you about the reading a financial spreadsheet thing, though. I'm just not sure how to make a useful ### line when damage potential can range from 5 to 100. If a scale is set using 0-100, the problem is that at most points in the game the current carried set of weapons is all going to be in the same range, so eg. in the early game every weapon you're likely to have would show up as "#........." even though there may be big differences between them.

Using my spreadsheet, the upper range I can envision for modified base damage is a troll, str. 40, Dex 15, Fighting:27, M&F: 27, +8,+8 slaying bonuses, berserk, with a potion of agility, and a +9,+9 giant spiked club. By my spreadsheet's reckoning, this combination would have +86 to the base damage of 22, so that means a total "score" of 108! So a ### scale would have to have that as the upper end, but almost all the time the player wants to know the difference between scores of 15, 18, 20 etc. and that detail would be lost in the wield screen.

Dungeon Master

Posts: 3618

Joined: Thursday, 23rd December 2010, 12:43

Post Monday, 7th February 2011, 19:42

Re: Patch project: make weapon screen info like spell screen

You probably know my aversion to numbers by now. So I second galehar that trying to set up a graphical display is worth the trouble.

If we think the scale is too long, we could indicate the upper bound of the current wield screen: damage [up to 80].

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Monday, 7th February 2011, 20:21

Re: Patch project: make weapon screen info like spell screen

What about using accuracy/damage/speed ranks among weapons held?
Sabre: 3/1/3
Dagger: 2/2/2
Quick blade: 1/3/1

Picking up a dagger of speed might change it to:
Sabre: 4/1/4
Dagger: 3/3/3
Quick blade: 1/4/2
-1 +1 Dagger of speed: 2/2/1

Yes, they're numbers, but ordinal not cardinal. It would solve a potential issue in a graphical interface that a +2 battle axe and a +0 executioner's axe might have the same number of damage pips (when all the player wants to do is know which one does more damage). And it would be compact like the cardinal numerical display that danr mocked up.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Monday, 7th February 2011, 20:35

Re: Patch project: make weapon screen info like spell screen

That wouldn't really be that helpful because what's really important is speed * accuracy * damage. Now, I suppose you could roll those up into a single "power" descriptor which would be something like the avg. damage/turn calculated by my spreadsheet.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Monday, 7th February 2011, 22:57

Re: Patch project: make weapon screen info like spell screen

danr wrote:Image
As for the wield screen - I think I'd need to see a mockup of what you are describing, galehar.

I hear you about the reading a financial spreadsheet thing, though. I'm just not sure how to make a useful ### line when damage potential can range from 5 to 100. If a scale is set using 0-100, the problem is that at most points in the game the current carried set of weapons is all going to be in the same range, so eg. in the early game every weapon you're likely to have would show up as "#........." even though there may be big differences between them.

Try using a 10 dashes logarithmic scale (n = sqrt(damage)) like for spell power. The maximum is for using the weapon at skill level 27. You need to use damage/turn or we need to fix the formula to see the effect of skill though.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Tuesday, 8th February 2011, 04:42

Re: Patch project: make weapon screen info like spell screen

danr wrote:That wouldn't really be that helpful because what's really important is speed * accuracy * damage. Now, I suppose you could roll those up into a single "power" descriptor which would be something like the avg. damage/turn calculated by my spreadsheet.


You're right! Would such a the "power" descriptor depend on the opponent's AC and EV? If so, it might more transparent to let the player work it out.

Just using "Damage per turn" and accuracy might be sufficient, despite it being a bit harder factor in opponent AC/EV.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Tuesday, 8th February 2011, 16:51

Re: Patch project: make weapon screen info like spell screen

The player could work it out using the full info on the inventory screen, and the "power" displayed on wield weapon would use something like Kobold stats (AC 2 EV 12) or just AC 0 EV 10. So if a player really wants to work it out, what their power is against an ancient lich or something, they can do the math or use my spreadsheet.

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Thursday, 10th February 2011, 00:03

Re: Patch project: make weapon screen info like spell screen

Sure, that'd work -- and it'd be nice to display fewer stats!

It would, however, occasionally generate the odd outcome that a ## weapon is more powerful than a ### weapon against an opponent with AC or EV that differs a lot from the reference opponent's AV and EV. That's fine, but it would be nice to indicate this possibility somehow, maybe just in the manual.

Blades Runner

Posts: 546

Joined: Monday, 20th December 2010, 14:25

Post Friday, 11th February 2011, 17:56

Re: Patch project: make weapon screen info like spell screen

Another thought on speed/delay.

The Fibonacci numbers are 1,1,2,3,5,8,13.
Dropping the first number and adding one we get 2,3,4,5,9,14; there are good number of the min delay on a weapon speed bar.
Thus: #=5 attacks, ##=3.3, ##=2.5-, ###=1.7-, ###=1.1-, ####=.7-, #####=0.5-.

This isn't all that important but I say the more Fibonacci in Crawl, the better.
User avatar

Vestibule Violator

Posts: 1533

Joined: Thursday, 16th December 2010, 20:52

Post Friday, 11th February 2011, 20:05

Re: Patch project: make weapon screen info like spell screen

I'm starting to think that it may not be realistic for me to try to code this, time-wise. So if anyone else is chomping at the bit to work on this...

Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.