# How to deal with raw values and percentages?

What is the standard practice for dealing with attribute modifiers in games where units have attributes, such as RTSs, MOBAs and RPGs? Specifically, in which order are "buffs" given to the unit?

Suppose the case where unit X has 10 blah-points (BP). It obtains two modifiers that add +10% blah-points, and another one that adds 30 blah-points. Finally, a enemy unit applies a -40% blah-points modifier. What is the usual way of processing this, for player familiarity's sake?

### Aggregate by grouped type

(10+30)*(1.0+0.1-0.4) = 28

### Obtention order

(10*(1.1)+30)*(0.6) = 24.6

### Aggregate iteratively by type

(10+30)*1.1*0.6 = 26.4

### Some other way?

• Armor and Weapon pieces usually have separate percentage-based calculations (eg. +60% damage on the weapon will be calculated for the weapon only (fixed-damage * 1.6) whereas +% damage modifiers on the armor will come into the calculation later. So basically the weapon(s) get evaluated first, resulting in the "base-damage" for the total damage calculation from skills, buffs and armor stats.
• An enemy could have a -40% physical damage modifier, which will only be evaluated once you hit that enemy. You'll deal total-damage * 0.6 damage to the enemy. Enemy effects on you (eg. a curse or a buff vs. an enemy type) will be factored into your base stat calculation.