LUCK, and how state/buff/debuff application chance works.

Percarus

The Normal One
Veteran
Joined
Nov 10, 2017
Messages
43
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
The Luck stat had always been vague- within the editor, it is described as "Affects the chance of things like status ailments occurring." All well and good, it can be assumed then that Luck applies to the application of Buffs, Debuffs, and Status Effects.

Here is my question: is there a definitive formula on how exactly it affects it? How does the probability in a skill's "Effects" tab interact with it?
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
624
Reaction score
838
First Language
German
Primarily Uses
RMMV
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.
We go with this instead:

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * (1 + (100 - 20) * 0.001)
= 0.48
= 0.432

So the chance to ACTUALLY inflict burn is 48% 43.2%.
 
Last edited:

Percarus

The Normal One
Veteran
Joined
Nov 10, 2017
Messages
43
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.
We go with this instead:

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * 1 + (100 - 20) * 0.001
= 0.48

So the chance to ACTUALLY inflict burn is 48%.
This is amazing- really cleared up a lot of things. Thanks so much!
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,113
Reaction score
5,810
First Language
English
Primarily Uses
RMVXA
First off, I am not sure if luk affects buffs and debuffs. I think they are always 100%.

In rpg_objects there is a function called lukEffectRate which determines how luk changes the probability of inflicting states.

JavaScript:
Game_Action.prototype.lukEffectRate = function(target) {
    return Math.max(1.0 + (this.subject().luk - target.luk) * 0.001, 0.0);
};

Translating this to "RPG Maker language", it would look something like this:

Math.max(1.0 + (a.luk - b.luk) * 0.001, 0.0)

Don't mind the Math.max, it just ensures that the %-Chance does not go below 0%.
We go with this instead:

1 + (a.luk - b.luk) * 0.001

The result of this formula is the modifyer for the state chance.

As an example:
You have a 40% chance of inflicting burn with a skill
You have 100 Luck
The enemy has 20 Luck.

0.4 * 1 + (100 - 20) * 0.001
= 0.48

So the chance to ACTUALLY inflict burn is 48%.
Nicely presented, but not quite accurate. What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance. You can see this in the methods itemEffectAddAttackState and itemEffectAddNormalState (they may have different names in MV; I am looking at the MZ code but I am certain the mathematical mechanics are similar between MV and MZ).

In other words, if the skill normally has a 40% chance to inflict burn, the modified chance will be 40% * (1 + ((100 - 20) * 0.001)) = 40% * 1.08 = 43.2% chance to inflict burn. As you can see, the effect of LUK is very minimal, which is why you'd want to either use it on other places (eventing, skill formulas) or just leave it out of your game entirely.

Also, lukEffectRate is not applied on any skill designated as a "Certain Hit" skill (which makes sense, as you wouldn't want it to affect, for example, a healing state given to an ally).

It looks like itemEffectAddDebuff is affected by lukEffectRate too, meaning that Debuffs (but not buffs) are affected by LUK of the user and opponent target.
 

Percarus

The Normal One
Veteran
Joined
Nov 10, 2017
Messages
43
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
Nicely presented, but not quite accurate. What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance. You can see this in the methods itemEffectAddAttackState and itemEffectAddNormalState (they may have different names in MV; I am looking at the MZ code but I am certain the mathematical mechanics are similar between MV and MZ).

In other words, if the skill normally has a 40% chance to inflict burn, the modified chance will be 40% * (1 + ((100 - 20) * 0.001)) = 40% * 1.08 = 43.2% chance to inflict burn. As you can see, the effect of LUK is very minimal, which is why you'd want to either use it on other places (eventing, skill formulas) or just leave it out of your game entirely.

Also, lukEffectRate is not applied on any skill designated as a "Certain Hit" skill (which makes sense, as you wouldn't want it to affect, for example, a healing state given to an ally).

It looks like itemEffectAddDebuff is affected by lukEffectRate too, meaning that Debuffs (but not buffs) are affected by LUK of the user and opponent target.
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
624
Reaction score
838
First Language
German
Primarily Uses
RMMV
What you missed is that the lukEffectRate is a multiplier for the base chance - it is not added to the base chance

Ah, yes. I did miss that. I even had that in my formula, but for some reason I added it instead of multiplied it. Edit: No I did not add it, instead I forgot to put another () in the right place. I just punched the formula into a calculator and got a wrong result.

It should have been
0.4 * (1 + (100 - 20) * 0.001)
not
0.4 * 1 + (100 - 20) * 0.001


I was wondering why the increase was 8% considering luck was never that impactful to begin with.
I corrected my first post.
 
Last edited:

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
913
Reaction score
394
First Language
english
Primarily Uses
RMMV
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?
some plugins can allow you to change the formula used. would also be able to change the formula in the rpg_objects base code but im no good with that stuff, so i just use yanfly's baseparam control plugin to change it from the plugin parameters.
(i changed "luck effect" so it just says "1" making luck have no effect at all on state rates so i could rename luck and use it however i wanted without it effecting anything else and state rates became just flat database apply/resist rates.)
 

Percarus

The Normal One
Veteran
Joined
Nov 10, 2017
Messages
43
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
some plugins can allow you to change the formula used. would also be able to change the formula in the rpg_objects base code but im no good with that stuff, so i just use yanfly's baseparam control plugin to change it from the plugin parameters.
(i changed "luck effect" so it just says "1" making luck have no effect at all on state rates so i could rename luck and use it however i wanted without it effecting anything else and state rates became just flat database apply/resist rates.)
Thank you for your responses friend, I appreciate it a lot :)
I'll make sure to take note of that.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,935
Reaction score
14,767
First Language
English
Primarily Uses
RMVXA
It would take a plugin to change it. I actually changed it in my last game to be (this is not in Javascript code, just psuedocode, FYI):

* 1.014^(your luck - enemy luck).

The ^ is raise to power. The result was that a difference of 50 LUK now returned about 2, which meant your chance had doubled.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,113
Reaction score
5,810
First Language
English
Primarily Uses
RMVXA
Ohhh I see. Thanks for the clarification! Is there a way to modify this lukEffectRate to make it more impactful status effects-wise?
You would need to either do it with a mini-plugin of your own, someone else's plugin, or by making a small change to the code in your project's js folder (I think you're looking for rpg_objects.js). Making that small code change is actually really easy - for example you could make Luck's effect on status application ten times as impactful by replacing 0.001 with 0.01 in the method that @ScorchedGround pasted earlier, and that's all you need to do. However, it is usually advised to use a plugin instead because if you update the core scripts, your changes may be reverted, and it can be a little wonky if other plugins that you use are also modifying the same method.
 

Percarus

The Normal One
Veteran
Joined
Nov 10, 2017
Messages
43
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
Thanks so much for the replies, my curiosities have been satisfied and confusions have been erased :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Sneak peak of my upcoming update! Who's holding her, you may ask? Find out tonight!
10.PNG
BCj
Finished another GUI! Turn indicator wasn't made by me.

ff981f8dc50b03cf58038c644334b454.jpg


3cb092fdc00087acfa0a190fd891f0ed.jpg
Added a small refining scene to my game.

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.

Forum statistics

Threads
115,245
Messages
1,088,337
Members
149,845
Latest member
thefixall
Top