Additive vs Multiplicative % Params (+bonus tutorial)

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,546
Reaction score
1,134
First Language
English
Primarily Uses
RMMV
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: (base + plus) * paramRate * buffRate + flat

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:
(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);
};
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).
1603648781076.png

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?
 
Last edited:

Pootscooter

Veteran
Veteran
Joined
Jun 7, 2020
Messages
78
Reaction score
21
First Language
Mandarin
Primarily Uses
RMMV
What's your overall philosophy on "numbers" management for your game/project?
If I had to choose between additive vs multiplicative for percentage bonuses, I'd go w/ additive. That way a single effect w/ a low coefficient won't bring down ur stats as significantly. It's also more intuitive to calculate in one's own head.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I think I've created a monster.
...and I love it. <3
Today represents my one year anniversary of throwing out the tile map. :LZSexcite: One year ago my game looked like...


And now for those that don't know, it looks like..


What a year, what a year indeed. RIP Tile Map, nobody misses you. :LZSwink:
There is now a demo released for [Beyond the Mirror]! Check the team recruitment thread to learn more!
'Tis the season to see shipping prices and go 'Yikes'.

Forum statistics

Threads
105,698
Messages
1,015,718
Members
137,383
Latest member
abcdrm
Top