RMMV Strange Armor Penetration Stacking (YEP_X_ArmorScaling)

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
So I noticed that when I stack multiple instances of the tag <Physical Armor Penetration: x%>, the result isn't added together correctly, nor is it added multiplicatively. For instance, I have a character w/ a passive state that grants +50% Armor Pen, then I equip an Axe that supposedly grants +10% Armor Pen. The result should be either +60% if calculated additively (0.5 + 0.1 = 0.6) or +65% if calculated multiplicatively (1.5 * 1.1 = 1.65). However, the result I'm getting is +55% Armor Pen...
1627432951105.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,764
Reaction score
2,114
First Language
EN
Primarily Uses
RMMZ
I think the "damage stopped by armor" is stacking multiplicatively:
  • 50% pen => armor applies to 50% of damage
  • 10% pen => armor applies to 90% of damage
Put together: armor applies to 50% * 90% = 45% of damage, i.e. 55% armor penetration.

This is similar to element rates vs resistances.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Hmm, in that case...how can I phrase the descriptions so that the player doesn't feel misled?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,816
Reaction score
934
First Language
English
Primarily Uses
RMMV
I wouldn't feel the need to explain it any special way. Your confusion notwithstanding, that functionality is pretty common in video games.

And do you expect your players are going to be fighting enemies, recording their damage, then changing gear, fighting the same enemies, recording the damage again, and comparing it to reverse engineer the stats on their items? Or just see the numbers on this item are better than the numbers on that item, so I'll use it.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Lol, good point...I guess I'm just being overly paranoid.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
So I was actually able to get the result I wanted by editing the plugin somewhat.

Before:
JavaScript:
Game_Battler.prototype.physicalArmorPenetrationRate = function() {
    var value = 1.0;
    if ($gameParty.inBattle()) value *= 1 - $gameSystem.armorPenetrationRate();
    for (var i = 0; i < this.states().length; ++i) {
      var state = this.states()[i];
      if (state) value *= 1.0 - state.physArmorPenRate;
    }
    return value;
};

After:
JavaScript:
Game_Battler.prototype.physicalArmorPenetrationRate = function() {
    var value = 1.0;
    if ($gameParty.inBattle()) value *= 1 - $gameSystem.armorPenetrationRate();
    for (var i = 0; i < this.states().length; ++i) {
      var state = this.states()[i];
      if (state) value -= state.physArmorPenRate;
    }
    return value;
};

Basically, it turned it into an additive formula by changing...
value *= 1.0 - state.physArmorPenRate;
...to...
value -= state.physArmorPenRate;
Now I just gotta do this across the board for all the notetags lol.

Edit: Hmm, I need a 2nd opinion...should I allow it to go negative? If not, I'll need to add this line:
if (value <= 0) value == 0;
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,764
Reaction score
2,114
First Language
EN
Primarily Uses
RMMZ
Basically, it turned it into an additive formula by changing...
value *= 1.0 - state.physArmorPenRate;
...to...
value -= state.physArmorPenRate;
I think personally I'd just change the status display, either:
  • Show the element rates as resistances (1 - rate), or
  • Show the armor penetration as "armor damage" or something (1 - pen).
Edit: Hmm, I need a 2nd opinion...should I allow it to go negative? If not, I'll need to add this line:
if (value <= 0) value == 0;
Negative armor penetration would mean that you're experiencing more resistance from armor than usual. If that makes sense in some in-game situation then sure, go for it. Otherwise, remember that you need to use a single = for assignment: == is a loose equality check.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Oh, that's right...I need to use a single "=" instead of two, thx!
 

Latest Threads

Latest Profile Posts

Another comic with Backstage Malak...
If you want to ask him anything, you can ask on my DeviantArt page! I'm not sure if you're allowed to do it here.
Forum tip of the day ...
If you get a temporary suspension for being a jerk to people who are trying to help you, and arguing with mods and admins, don't go making new accounts. Chances are, if you p**s us off enough to suspend you for a week, we're not going to hesitate giving you a permanent ban when you give us a reason.
E_6fAErVkAQILXu.png
I'm so close to releasing my game on steam! :blush::blush::blush:
Us:
"This game is awesome! I wish there are more games like this in the future."
Also us:
"I hate how games stopped being original and start copying other successful games."
Should've done this a few days ago but...
PRI_200136808.jpg
Rest in Peace, Sir Clive Sinclair
1940 - 2021
Entrepreneur, Technologist, Father of the Modern British Computing Industry, and protagonist of Legend of ZUN.

Without you, England's games and tech industry wouldn't be where it is.

Forum statistics

Threads
115,287
Messages
1,088,667
Members
149,918
Latest member
BlakeVit
Top