Yanfly's Hit Accuracy plugin may not be working

Hi, I have Yanfly's Hit Accuracy plugin to control how HIT and EVA affect each other. I have the formulas below (Please don't mind the factor 1, as they are placeholders):
- Accuracy: (skillHitRate * userHitRate * 1) / Math.max((skillHitRate * userHitRate * 1) + (targetEvadeRate * 1), 0.00001)
- Evasion: 1 - (skillHitRate * userHitRate * 1) / Math.max((skillHitRate * userHitRate * 1) + (targetEvadeRate * 1), 0.00001)

My actor has 75% HIT, with all skill hit rate = 100%, while the enemy does not have any EVA trait (meaning 0% EVA), but sometimes my attacks still miss the target. I don't know what's wrong because, based on my formula, Hit chance should be 100% while evade chance should be 0%. I feel like the system keeps using the default formula instead of the ones I set in the plugin. Am I doing something wrong, or is the plugin not even working?
Is the skill considered a physical or magical skill, or a "Certain hit"?
Is the skill considered a physical or magical skill, or a "Certain hit"?
Physical and Magical. I set them to use HIT and EVA in the Plugin Parameters already.
1756661965642.png
for physical you will miss 25% of the time.
for physical you will miss 25% of the time.
Even with Yanfly's plugin overriding the default formula? And could you tell me where that 25% is defined in the RPG files?
You may have made the accuracy be 100% if the target has no EVA, but the evasion formula is still being ran afterwards and in this case it ends up being a 25% for the skill to miss via evasion after the accuracy calc
Void your evasion formula. Your accuracy one already uses evasion in it
In your plug settings it says the physical hit rate is user.hit. So a physical hit is going to land at that rate, which you said is 75%. Magical hits are 1 plus user.hit, which means they will always hit unless evasion is very high, enough to make the hit rate negative.
In your plug settings it says the physical hit rate is user.hit. So a physical hit is going to land at that rate, which you said is 75%. Magical hits are 1 plus user.hit, which means they will always hit unless evasion is very high, enough to make the hit rate negative.
I think you missed the custom formulas I mentioned above, which are already set in the plugin parameters:
- Accuracy: (skillHitRate * userHitRate * 1) / Math.max((skillHitRate * userHitRate * 1) + (targetEvadeRate * 1), 0.00001)
- Evasion: 1 - (skillHitRate * userHitRate * 1) / Math.max((skillHitRate * userHitRate * 1) + (targetEvadeRate * 1), 0.00001)

So with these formulas:
- Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 1 (100%)
- Evasion: 1 - 1 = 0%

You may have made the accuracy be 100% if the target has no EVA, but the evasion formula is still being ran afterwards and in this case it ends up being a 25% for the skill to miss via evasion after the accuracy calc
Void your evasion formula. Your accuracy one already uses evasion in it
So basically, I should set Evasion to be 0, or just leave it blank? And in that case, if only accuracy is calculated, the damage pop-up will just display Miss, and no Evade, right?
I should set Evasion to be 0, or just leave it blank?
0, but i did get a bad look at your formula at first off of my phone.
While what i said is still true about evasion formuas being ran after accuracy and forcing skills that otherwise hit into ones that missed, with 0 eva it should be as you said. Youd be double dipping with evasion later though if you dont negate the evasion formula and start giving stuff EVA. Youre basically rolling hit twice and requiring consecutive success.

Just to be sure, you arent testing the plugin on an old save file from before you installed the plugin, right?
the damage pop-up will just display Miss, and no Evade, right?
Unless you have a plugin handling it and possibly a modified damage.png, there are no dodge popups. Both missed and dodged skills give a miss popup.
I tried to set the EVA formula to 0, and now it always triggers, even if I set the enemy's EVA trait to 300% :oops: . Well, at least the plugin is working, I suppose. But need to find another way for EVA formula instead of 0
Just to be certain, when youre in a playtest press f12 to open the devtools window, go to the console tab, and type in $gameParty.members()[0].hit and press enter to see the first party member's hit, and then type in $gameTroop.members()[0].eva and hit enter to see the first enemy's eva value ingame.
If those look correct you might have another plugin interfering.
Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 1 (100%)

Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 0.75., actually. Because 0 times 1 is zero.
Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 1 (100%)

Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 0.75., actually. Because 0 times 1 is zero.
I ran this to check it. By order of operations:

* is first, inside the (), and times goes left to right, so:

(0.75 * 1)/(1 * 0.75 * 1 + 0 * 1)
(0.75)/(1*0.75 * 1 + 0 * 1)
(0.75)/(0.75 * 1 + 0 * 1)
(0.75)/(0.75 + 0 * 1)
(0.75)/(0.75 + 0)

Now with all the multiplies done from left to right, + is next inside the ()
(0.75)/(0.75)

Now we remove the () as they are calculated as far as possible.

0.75/0.75

Order of operations starts here again, / is the first operation it will run, so:

0.75/0.75 = 1

Its returning 1 by standard order of operations, which every computer runs and uses. If the OP is getting anything else a () is off, or one of the values is not really set to what they thought it was.

Moved to Plugin Support
Accuracy: (1 * 0.75 * 1) / (1 * 0.75 * 1 + 0 * 1) = 0.75., actually. Because 0 times 1 is zero.
with standard order of operations it does result in 100%
Edit: now thats a ninja i didnt see coming 🤣
I will try to check for the attacker's HIT and the defender's EVA during battle and run the formulas directly in the console to see the results, as you suggested. For now, what I can confirm is that the plugin is running 😀
Updated: After checking my console, I don't know how, but my enemy has 20% EVA from somewhere. I do not have any EVA traits for him in Class or Enemy database. It only happens to enemies, not actors. Besides, I have HIME's Enemy Class and Enemy Class Table plugins too.
1756720112001.png


Edit: Aw, that was my bad. I set this enemy to the wrong Class (which has 20% EVA) 😕 Thank you all for your assistance. Things should be working now.
Besides, I have HIME's Enemy Class and Enemy Class Table plugins too.
Dude, you didn't tell us you also have Hime's plugins too.
Dude, you didn't tell us you also have Hime's plugins too.
Haha, sorry. Did not think of it. Still, there is a rare case where my attacks still miss, and I could not figure out why. So I decided to put a 5% EVA to all enemies as the default EVA value, so things will make sense 😛

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-hit-accuracy-plugin-may-not-be-working.179875/