LUK is bugged?

tl;dr : luk, supposed to affect state efficiency, doesn't *actually* do it

Hi rpg maker people of the forum,

The hardest part is to hope I didn't duplicate a thread that already exists about this '^' but I didn't find any, and I'm surprised because this is noticeable

So the LUK stat is supposed to increase/reduce the chance rate of applying or not status effects ; someone with a high luck is more likely to affect a target with a status like poison, berserk, etc

But, well, from what I tested, LUK doesn't work :S This is the formula used for luck, straight taken from the rpg_objects.js file from the source code

Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);

This means, as an example ; say your skill adds a Poison status with an initial 100% chance. Can't miss, in short.
The user (this.subject()) has, lets say 1 LUK and its target has 999 LUK. Just so we notice greatly the difference

Math.max(1.0 + (1 - 999) * 0.001, 0.0) ==> Math.max (1.0 - 0.998, 0.0) ==> > Math.max(0.02, 0.0) ==> it returns 0.02.
That means your initial Poison value that is 1.0 (100%) will drop down to 2%. A.k.a will only land the status every full moon.
But well, it somewhat still hit often ^^ at the same initial rate (100%) I'd say? and thats why I say LUK is bugged.
You can try this in a fresh new project, a new game. No plugin, nothing.

I can't add screenshots, they're not really a proof '^'

But here's something else, if you edit the formula in the code :
return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
into something simple :
return 0.0;
the above means multiply the initial status chance by 0. So basically all the status will miss. Well, this is ignored and you can still actually successfully land your status

Unless I'm missing something? that would be a bug imo
Your understanding of the formula is correct (although I'd point out 1 - 0.998 = 0.002 or 0.2%, not 2%). The one thing I can think of that would cause 100% application in the scenario you described would be if the caster and the target are allies (using a skill on Allies will ignore the "LUK Effect", I think).

Outside of this, LUK should be affecting the % Chance to inflict States exactly as you're assuming it should - which makes it very weird that your tests have shown different. I always recommend Saving changes to the database before testing, but that shouldn't really matter either for a simple Battle Test with no plugins.

Anyone else finding this same behavior?
Some oddity I've not quite understood in the RMMV:
By default, LUK and the targets state rates are ignored for normal states if the item is set to "Certain Hit" (states added through "Attack State" traits are still affected by those effects).

At least if that's the reason, you could change that behavior by modifying the following procedure:
Spoiler: rpg_objects.js, line 1865ff.
Code:
Game_Action.prototype.itemEffectAddNormalState = function(target, effect) {
    var chance = effect.value1;
    if (!this.isCertainHit()) {
        chance *= target.stateRate(effect.dataId);
        chance *= this.lukEffectRate(target);
    }
    if (Math.random() < chance) {
        target.addState(effect.dataId);
        this.makeSuccess(target);
    }
};
@Another Fen
Why do you consider that behaviour odd?
That is what "certain hit" is (and has always been) intended to do: make sure that the effect of the skill/item always hits the target and can never be evaded or disabled by any option.
Because if there is something that makes the effect uncertain then it cou'ld be called "certain hit" anymore.
@Another Fen
Why do you consider that behaviour odd?
That is what "certain hit" is (and has always been) intended to do: make sure that the effect of the skill/item always hits the target and can never be evaded or disabled by any option.
Because if there is something that makes the effect uncertain then it cou'ld be called "certain hit" anymore.

Probably because "Certain Hit" is for making the skill hit (avoid evades, etc.). It would be completely reasonable for a designer to want a skill to be guaranteed to hit, but to allow the target to resist the state application with their natural defenses (LUK). It's also completely reasonable for a designer to want both to be guaranteed, but that's already doable through 999% Add State chance.
@Internet Explorer
I wouldn't say Luck is broken, it makes sense to me.
State Rate is a hundred percent, if the luck between the 2 are the same and thus equal, means a 100% state rate and thus you should hit them.
If you're luck is higher than the target's than it should have a better chance of hitting them.
However if it's way less, then you have a smaller chance.
Just view state rate as the chance you could hit someone, if you're luck wasn't in play. If you make everyone luck the same then everyone has the same chance of being hit with said state.
@Wavelength Yup that was 0.2% mb.
I did a checkout of your situation because it interested me too '^'
And guess what, when you use a skill on an ally to inflict status, it IS influenced by your ally's luck 😮 Just checked it, If your 1 LUK actor wants to give Berserk to the 999 LUK ally, with an initial say, 50% chance, it'll actually have a 0.1% chance of working :V

But now, that's ONLY if your skill's hit type is Physical or Magical Attack. If that's "Certain Hit" like @Another Fen figured out, then yeah it actually ignores LUK and thus will keep the basis value. Thanks for this answer, it solved my problem ^^ LUK not bugged, just a bit confusing in some cases

While I agree Certain Hit should only affect the SKILL's accuracy and not the effects afterward, I think this hit type was meant for skills and items you cast on allies.
When you want to throw a heal or a revive on your ally, makes sense your ally won't try to dodge your ability in any way (LUK-wise or EVASION-wise). In a similar fashion, healing spells -usually- don't take the target's DEF or MDF into account to reduce the healing effectiveness like an offensive ability would do, since it's casted on your ally T^T

Moooooost of the time, all offensives abilities will never use Certain Hit because the enemies will try to dodge anything negative for them.
The only case I'd see Certain Hit odd, is if you make an "undodgeable" attack (such as Pokémon's Feint Attack) which adds a status on-hit. The status will keep its initial chance value even tho it should vary depending on LUK

Original thread: https://forums.rpgmakerweb.com/threads/luk-is-bugged.81797/