Mechanics thread

"
Malice wrote:
Modifier Stacking
Testing of the order modifiers take effect is currently not exhaustive, so there may be inaccuracies here. Especially, quality on gems is difficult to test.
In general (but not always), percentage modifiers stack additively, and integer modifiers are applied before percentages.

Imagine I have 100 life, and two passive skills that increase total life by 15%. The total bonus will be 30%, resulting in 130 life.
Now imagine I am wearing boots that give +40 life, and have a passive skill that grants +20 life. The integer bonuses are applied first, giving me 160 life, then the percentage bonuses are applied to that subtotal, for a final total of 208 life.

One exception is the quality modifier on armour and flasks (but not weapons), which applies after all other modifiers. For example:

[there was an item linked here that has since been wiped. It had +69 armour, +9% armour, and +20% quality]

This Horned Casque has a base armour rating of 428. Then the +69 is added to get 497 armour. Then the 9% bonus raises it to 541, and finally +20% quality results in 650 armour.

Quality on weapons stacks additively with other % modifiers on the weapon.


Modifier stacking for skills
Calculations for skills are slightly different, in that the damage stacks multiplicatively between gear (weapons), passive skills, and the skill itself. Modifiers from gear other than weapons are treated the same way as passive skills - they take effect after any on-weapon modifiers, and stack additively with passive skills.

For example, if you had a sword with base 10-20 damage and +50% damage, passive skills granting another +30% sword damage, and used a skill that gave yet another +40% damage, the calculation would would look like this:

Base damage: 10-20
Weapon damage: 10-20 x 1.5 = 15-30
Attack Damage: 15-30 x 1.3 = 19.5-39
Skill Damage: 19.5-39 x 1.4 = 27-55

For spells, there is no difference between on-weapon and off-weapon modifiers. Modifiers from weapons, gear, and passive skills stack additively with each other. Any modifiers on the spell or attached support gems will then stack multiplicatively with that amount.

For example, if you had a spell that did 10-20 base fire damage, passive skills granting +20% fire damage, +60% spell damage on your weapon, +10% spell damage on a ring, and +30% damage on a support gem:

Base damage: 10-20
Spell damage: 10-20 x (1 + 0.2 + 0.6 + 0.1) = 19-38
Skill Damage: 19-38 x 1.3 = 25-49
There some incorrect statements in here which have been confusing people in other threads.
All "% increased" or "% reduced" modifiers to a particular value stack additively with each other, while "% more" and "% less" modifiers stack multiplicatively. "additional" adds directly to the value (most commonly used on things like resistances), and in general "removes" or "subtracts" is I think used as the inverse of that depending on context.
The only major exception to the above that I am aware of is that "% increased" modifiers to weapon damage which are on that weapon will stack additively with ohter modifiers of the same type (if you can get multiples on the same weapon, which I'm not sure is possible at the moment), but because they modify the base damage of the weapon, they technically stack multiplicatively with other, off-weapon increases, which work off the base damage of the weapon, including the modifications from the weapon's own stats. Let me know if you have any other questions and I will do my best to clear them up.

EDIT: reworded to remove unintented nastiness, my initial post came off quite mean which I did not intend.
Last edited by Mark_GGG on Feb 2, 2012, 8:00:50 PM
"
FaceLicker wrote:
other specific terms like 'physical' or 'elemental', changes exactly how the 50% is applied.
What they apply to does not change how they stack, it just changes which parts of the damage they affect.
"
FaceLicker wrote:
Using Malice's numbers it would be 10-20 base damage, 50% Increased Physical Damage, 30% Increased Physical Damage with Swords, and for the skill it would be either 40% 'Increased' or 'More' Damage.


Base damage: 10-20
Weapon damage: 10-20 x 1.5 = 15-30
Attack Damage: 15-30 x 1.3 = 19.5-39
(Increased)Skill Damage: 15-30 x 1.7 = 25.5-51

OR

Base damage: 10-20
Weapon damage: 10-20 x 1.5 = 15-30
Attack Damage: 15-30 x 1.3 = 19.5-39
(More)Skill Damage: 19.5-39 x 1.4 = 27-55

Is this correct?
That looks about right, assuming by "Base Damage" you are referring to the damage range a weapon of that base type would deal if it did not have a modifier on it, and by "weapon damage" you are referring to the (modified) base damage of the specific weapon which has that local modifier on it (the damage values shown in blue on the weapon).
If I have some free time to do so over the weekend I'll come here and post some specific examples for different combinations of weapons/bonuses/skills etc and the effect they have, to help clear things up. I'm not gonna take the time to do that during working hours though, I've got more important stuff do get done for 0.9.6 :P
Last edited by Mark_GGG on Feb 2, 2012, 8:10:58 PM
"
FaceLicker wrote:
Right, I didn't mean to say they stack differently but merely that where(to which values) they are applied changes accordingly. I guess I should know by now that specifics are important!

I was just using the same format Malice used, lol. Blame him if it's confusing! =P
It's not so much as it's confusing as that there isn't necessarily a "correct" terminology to refer to this stuff, so given that I post in gold and people take my word as gospel and quote it all over the place, I want to make sure that I am interpreting your words correctly when I say "That's correct", because if we've misunderstood each other and I say it's right, or someone reading it misunderstands and sees I've said it's right, that leads to people going round quoting me elsewhere to back to interpretations which might be wrong. I try to be a bit cautious about such things, and usually check that actual code before posting to say something definitely works a particular way because I don't want to be the cause of any misunderstandings.
"
Malice wrote:
Is there a convention for when integer bonuses are applied? Generally they seem to be applied before percentages, are there any exceptions to this?
I am not aware of any exceptions to this rule. What Faerwin describes in his post (if I understand him correctly) is not an exception, it's simply that the "% increased physical damage" mod that spawns on weapons is specifically for physical damage. There are several cases where one or more of the percentage modifiers won't apply to some added integer values due to restrictions on what the % increases affect, such as only affecting damage from a weapon or of a particular type.

"
Malice wrote:
For a weapon with an integer elemental damage bonus, does an on-weapon %increased weapon elemental damage mod stack additively or multiplicatively with off-weapon %increase weapon elemental damage?
I believe additively, as that mod is not specific to changing that weapon's damage, but rather is the same mod that spawns on other gear and affects all elemental damage dealt with weapons. I will check on Monday. This is pretty much because in general weapons don't deal elemental damage, so there was no "local" mod created which would affect elemental damage only on that weapon. It's just about possible one has been added without my knowledge, but very unlikely as generally I'm the one who has to hook such things up in the code (plus, it's still not a very useful mod to have). So I'm 99% sure on this, but won't give you my guarantee that's how it is until I've double checked.
"
Malice wrote:
What about for integer elemental damage from a skill? Does it matter whether an %increased weapon elemental damage mod is on or off-weapon when affecting the damage from an added cold damage gem attached to an attack skill?
I do not believe so, and will check on Monday. Same as above, basically.
"
Malice wrote:
edit: another question:
Critical strike chance and critical strike damage multiplier mods on a weapon. Are they applied in a separate stage before off-weapon crit modifiers?
Not at the moment, no - the same is true of local attack speed bonuses on a weapon - I intend to discuss this with Chris, as some people have rightly pointed out in another thread that this is misleading, as in these cases the weapon's displayed value changes and is displayed in blue, but that value isn't actaully useful in calculating the actual value including passives - in contrast to damage (and things like armour/evasion/ES increases on armour pieces) where those increase the base value from the item, and then further calculations take that base value and work from there. To quote theexample from the thread:
"
faerwin wrote:
the only (current) difference is that local mods only affect the current weapon. With the only exception of physical damage on a weapon, they all stack additively with other similar mods.
Yes. "Local" with regard to a mod means that it affects only the item it is on.
Currently local mods for increased physical damage on weapons, and for increased defenses on armour, will work differently to other mods by affecting the base value of the item, effectively making them "multiplicative" with later increases.
Local mods for crit chance / atttack speed on weapons do not have this behaviour, but are still local - they affect only that weapon.
In general, if a mod can be local, only the local one can spawn on the item type it can be local to - i.e. weapons can get local attack speed mods, but not global ones, whereas other items can only get the global version (because local attack speed on something other than weapon wouldn't make sense).
The only specific counterexamples to this, so far as I am aware are the implicit mods for at least some weapon types do not follow this - the implicit mod on a dagger is global crit chance (and in this specific case the local version specifically says "with this weapon", so you can still tell which you have even though in this case both global and local versions could be on a weapon). Thrusting swords are the same for crit multiplier. I will check on Monday and list exactly which implicit mods are global/local.
However, for non-implicit mods (i.e. the ones an item gets for being magic/rare), you can't generate the global version on that item type, only the local, so that there's no confusion.
"
faerwin wrote:
"
In general, if a mod can be local, only the local one can spawn on the item type it can be local to - i.e. weapons can get local attack speed mods, but not global ones, whereas other items can only get the global version (because local attack speed on something other than weapon wouldn't make sense).


If a weapon got local crit chance, it can't get global crit chance too (assuming both are a possibility initially)?
No, I mean that if there is a mod with both global and local versions, then the item types which could have the local version can never have the global (except implicit mods, which are separate from restrictions of generating mods).
They aren't both a possibility - weapons can spawn local attack speed mods, but not global. (some) armour can spawn global attack speed mods, but not local.
There are no cases where an item could have either the local or the global version of the same mod spawn on it - the type of item determines which version could occur.

Implicit mods don't spawn on items, they're just a part of them, and thus get around that, which is why daggers can have a global crit chance increase as their implicit mod, despite that mod being impossible to spawn on them as an explicit mod (one of the ones it gets for being magic/rare), due to the global one never spawning on weapons.
My apologies, that always used to be the case, and was intentional, but checking now it has in fact changed for those mods. I'm gonna talk to chris today and ascertain whether this was intentional or something got confused.

But yes, at the moment it is actually possible for both the local and non-local crit mods to spawn on weapons.

I can confirm that local attack speed only spawns on weapons, and global attack speed only spawns on non-weapons.

EDIT: This was not intentional, and global critical strike chance spawning on weapons is a bug which I am now fixing (so it should be fixed in 0.9.6). This will not affect items generated before that patch.

Apologies for all the confusion caused by this - I knew it wasn't like that a couple of months back and wasn't meant to be like that, but it turns out it was like that anyway for a brief period.
Last edited by Mark_GGG on Feb 5, 2012, 5:54:45 PM
"
Malice wrote:
It's ok, thanks for clarifying all this stuff - we even found a bug as a result.
No problem, I'm happy to help, and thanks to you guys for questioning this stuff, because we would probably all have assumed that the mods were generating as intended for a long time if this hadn't come up here.
I'll be taking a look at the other local/global mods to see if there are any other weird ones, but haven't found any so far.

For the record, local crit chance and attack speed on weapons are likely to change in a future patch to behave like the local increased damage and defenses mods already do which will a) be more intuitive to players looking at those items, and b) mean that all local mods behave similarly (I think - I'm not aware of any other local mods off the top of my head, but I'll be sure to check when doing this), which makes the system as a whole easier to understand (and for you to describe here). So I'll let you know when/if that actually gets in, but it won't be 0.9.6
Last edited by Mark_GGG on Feb 5, 2012, 11:49:11 PM
Right, I knew crit damage multiplier (but forgot to mention it), and both accuracy and integer added damage are additions, and thus don't need to change their behaviour to be affecting the 'base value' since all the additions occur before any increases anyway.
"
Malice wrote:
The only thing I can think of would be if the sword accuracy auto-mod was local, but it's not is it?
In fact, the implicit mod for increased accuracy on swords is local, and I will make a not that in that case it also probably needs to change behaviour.

Report Forum Post

Report Account:

Report Type

Additional Info