So as many of you are aware, the various Params (Base, Ex, Sp) in RPG Maker are either calculated additively (traitsSum) or multiplicatively (traitsPi). Let's focus on Base Params 1st, aka the primary stats. The default formula (or Yanfly's at least) is the following:
As you can see, we can easily adjust a stat (ATK for example) w/ hard numbers, as in integers, if we want to. The "plus" & "flat" components allow for this. However, if we want to adjust a stat by a percentage amount, we are forced to calculate multiple instances in a multiplicative manner. For example, if our Hero has 2 pieces of equipment that granted +20% ATK each, the result from wearing both would be: 1.20 x 1.20 = 1.44 or +44% total. But what if we want it to be calculated additively (i.e. 20% + 20% = +40% ATK)?
The solution I came up with involves editing the default param formula from earlier to this:
This way, we can still utilize hard integer adjustments via the "plus" component while changing the role of "flat" so that we can use it to make % adjustments in an additive—not multiplicative—manner. Then simply use the <stat Flat: +x> notetag to make said adjustments.
On a side note, for those that are willing to fiddle w/ some JS files, Ex-Params and Sp-Params can be changed between additive and multiplicative as well. In "rpg_objects.js" line #2458-2464 you'll find the following:
Simply put, "traitsSum" means it's calculated additively, while "traitsPi" means it's multiplicative. You can change any of them (not just xparam & sparam) to either Sum or Pi. However, when changing from Pi to Sum, you'll have to make sure the values start at 1.00 (100%), or else the values will start at 0. Here's a screenshot to show what I mean (Element Rate changed to Sum).
Basically, I just created this passive state that I put on all actors and enemies so their Element Rates would start at 100% instead of 0%. Otherwise, it would be super tedious adding these traits for each actor & enemy in the database! Anyway, I'd like to hear everyone's preferences opinions regarding this topic. What's your overall philosophy on "numbers" management for your game/project?
(base + plus) * paramRate * buffRate + flatAs you can see, we can easily adjust a stat (ATK for example) w/ hard numbers, as in integers, if we want to. The "plus" & "flat" components allow for this. However, if we want to adjust a stat by a percentage amount, we are forced to calculate multiple instances in a multiplicative manner. For example, if our Hero has 2 pieces of equipment that granted +20% ATK each, the result from wearing both would be: 1.20 x 1.20 = 1.44 or +44% total. But what if we want it to be calculated additively (i.e. 20% + 20% = +40% ATK)?
The solution I came up with involves editing the default param formula from earlier to this:
(base + plus) * (paramRate + (flat / 100))This way, we can still utilize hard integer adjustments via the "plus" component while changing the role of "flat" so that we can use it to make % adjustments in an additive—not multiplicative—manner. Then simply use the <stat Flat: +x> notetag to make said adjustments.
On a side note, for those that are willing to fiddle w/ some JS files, Ex-Params and Sp-Params can be changed between additive and multiplicative as well. In "rpg_objects.js" line #2458-2464 you'll find the following:
JavaScript:
Game_BattlerBase.prototype.xparam = function(xparamId) {
return this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
};
Game_BattlerBase.prototype.sparam = function(sparamId) {
return this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId);
};
Basically, I just created this passive state that I put on all actors and enemies so their Element Rates would start at 100% instead of 0%. Otherwise, it would be super tedious adding these traits for each actor & enemy in the database! Anyway, I'd like to hear everyone's preferences opinions regarding this topic. What's your overall philosophy on "numbers" management for your game/project?