Traits
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Traits
I've noticed that 'resilient, quick' and 'quick, resilient' units come to have different amounts of HP. Is it a bug or are there such notions as a 'primary' and a 'secondary' trait? In the latter case the 'primary' trait here appears to be stated the second. For example, a 'resilient, quick' dark adept would have 31 HP, while a 'quick, resilient' one would have 32. The version of Wesnoth is 1.10.6.
Last edited by jumpgate on April 25th, 2013, 1:03 pm, edited 1 time in total.
Re: Traits
this is intended behavior, see http://forum.wesnoth.org/viewtopic.php?t=21754&p=303183
Re: Traits
Well, that depends on what you mean by "primary". If you are thinking "larger effect", then no, the game does not try to make one trait "more" than the other. If you are thinking "order of application", then yes, one trait is applied before the other, making the effects of the first trait subject to modification by the second.jumpgate wrote:[...] or are there such notions as a 'primary' and a 'secondary' trait? In the latter case the 'primary' trait here appears to be stated the second. For example, a 'resilient, quick' dark adept would have 31 HP, while a 'quick, resilient' one would have 32.
What you are seeing is basically a consequence of mixing addition and multiplication. "Resilient" adds 5 hit points (to a level 1 unit). "Quick" multiplies hit points by 95%. A dark adept has 28 hit points. A resilient, quick dark adept has
(28 + 5) * 95% = 31.35
hit points, which rounds to 31. A quick, resilient dark adept, on the other hand, has
(28 * 95%) + 5 = 31.6
hit points, which rounds to 32. The order of calculation matters. And the game conveniently lists traits in the order they are applied.

Re: Traits
But ends doing just that, with the 31 HP dark adept somehow being "less resilient" than the 32 HP one.JaMiT wrote: ...the game does not try to make one trait "more" than the other.
I surely don't mean to complain, though. It doesn't count much anyway, and less so if it's not a bug and the developers intentionally coded it this way.
Re: Traits
That's just the way the math works out, not something the game does. Let's do a hypothetical. Suppose there was a "frail" trait that reduced hit points by 5, and we'll let goblins get this trait. Another (not hypothetical) trait goblins can get is "slow", which increases hit points by 5%. A goblin rouser has 31 hit points, so a slow, frail goblin rouser would havejumpgate wrote:But ends doing just that, with the 31 HP dark adept somehow being "less resilient" than the 32 HP one.JaMiT wrote: ...the game does not try to make one trait "more" than the other.
(31 * 1.05) - 5 = 27.55
hit points, which rounds to 28. A frail, slow goblin rouser, on the other hand, would have
(31 - 5) * 1.05 = 27.3
hit points, which rounds to 27.
So a resilient, quick unit (31) is in a sense "less resilient" than a quick, resilient one (32), but at the same time a frail, slow unit (27) is in the same sense "more frail" than a slow, frail one (28). Can you really say that the second trait is "primary"?
Re: Traits
I would still say any multiplications should always be applied before additions in such cases to avoid unnecessary, if slight, confusion of players, but...
Re: Traits
You would get less variety that way (and variety is a major motivation for having traits in the first place).jumpgate wrote:I would still say any multiplications should always be applied before additions in such cases to avoid unnecessary, if slight, confusion of players, but...
Also do you think that would really avoid confusion? What about the players that expect traits to be applied in order; might they not be confused if the second trait was applied first just because it was multiplicative? (As a general rule, there will always be someone who gets confused. Getting the confusion down to "slight" is pretty good.)