Where is the hit chance formula?

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
I've searched through all the default js scripts but I can't find where the hit chance is calculated.
Does anyone know where it is?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
there is no calculation
the actors and enemies get the chance by trait, and that value is simply added up from all equipment, states, class and actor that have that trait.

If that answer is not enough, please state what exactly you want to know and what you want to change.
 

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
there is no calculation
the actors and enemies get the chance by trait, and that value is simply added up from all equipment, states, class and actor that have that trait.

If that answer is not enough, please state what exactly you want to know and what you want to change.
I'm writing a script that displays the chance to hit
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
 

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
I saw analogical thread under rpg maker vx ace
and it says that the engine calculates the chance to hit (100 - actor.hit) and then chance to evade (100 - enemy.eva) is this the same for rpg maker mv?
and they also said the hit chance calculation can be changed in vx ace
can I change it in mv as well?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
that is wrong.
as I said above, there is no calculation.
the engine rolls one check on HIT% to determine if the actor hits.
then it rolls a different check on EVA% to determine if that hit was evaded.

and so on - most values are independent of each other.

calculates the chance to hit (100 - actor.hit)
yes and no - that is NOT the chance to hit, it is the chance to miss.
and that is why you didn't find anything in the code - the code never checks for if hit, it checks for if missed. And yes, it's absolutely the same for both Ace, MV and MZ
 

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
that is wrong.
as I said above, there is no calculation.
the engine rolls one check on HIT% to determine if the actor hits.
then it rolls a different check on EVA% to determine if that hit was evaded.

and so on - most values are independent of each other.


yes and no - that is NOT the chance to hit, it is the chance to miss.
and that is why you didn't find anything in the code - the code never checks for if hit, it checks for if missed. And yes, it's absolutely the same for both Ace, MV and MZ
is there any way to change it?
so the hit and eva became interrelated and the engine only checked one time like this (actor.hit - enemy.eva)?
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
542
Reaction score
255
First Language
German
Primarily Uses
RMMV
I'm writing a script that displays the chance to hit
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
I cant give you a proper solution, but the SRPG Core does that..
Also its a TBS system thats why some variables might not fit in other rpg projects.. like you have to figure out "target/user" for your usage..
So if you can read JS well enough (what i cant^^) that might be helpfull..
You can find the SRPG Core in order to look for yourself on my GitHub
(or in the SRPG Thread for other version but that makes no differense in that case)
Here some Images for better understanding
Screenshot_1.png
Screenshot_2.png
Screenshot_4.png

Sry that i cant give you better Infos, when i wanted to change the Hitrate myself i used States to do that..
 

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
I cant give you a proper solution, but the SRPG Core does that..
Also its a TBS system thats why some variables might not fit in other rpg projects.. like you have to figure out "target/user" for your usage..
So if you can read JS well enough (what i cant^^) that might be helpfull..
You can find the SRPG Core in order to look for yourself on my GitHub
(or in the SRPG Thread for other version but that makes no differense in that case)
Here some Images for better understanding

Sry that i cant give you better Infos, when i wanted to change the Hitrate myself i used States to do that..
tnx I'll take a look at it
btw I was able to find this in rpg_objects
1604927167939.png
1604927186823.png
it looks like a hit chance formula to me
still can't figure it out but I think I'm getting closer now
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
542
Reaction score
255
First Language
German
Primarily Uses
RMMV
tnx I'll take a look at it
btw I was able to find this in rpg_objects
View attachment 167204
View attachment 167205
it looks like a hit chance formula to me
still can't figure it out but I think I'm getting closer now
Yes i allready checked the rpg objects & and found the Hit stuff aswell but thats to complicated for me at the moment..
But perhaps you might be interrested in one of Yeps Plugins..
Yep Plugin Info said:
You can use the following notetags to alter the various aspects that modify
the extra parameter values:
Extra Parameter Formula (YEP)


edit
also if its just about to get the current hitrate data , that can be done like with every Stat..
i explained it here #365.
But i think you probably knew this allready..

(thats why i didnt mentioned it earlier, also it can only give the data info , NOT change it ,because that happens in rpg objects as far as i understand it)
 
Last edited:

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
okay so i experimented with those code lines a bit and found out an interesting fact
hit parameter doesn't affect magic attacks
if you attack with magic even if your character has hit rate of 0% the actual chance to hit is 100%
okay so now i will try to make it that way so magic attacks would also be dependant on hit rate and I'll replace the default miss and evasion check with (hit - eva) formula
i will share the results once I'm done
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
hit parameter doesn't affect magic attacks
of course not, that is how magic attacks are defined.
physical attacks use HIT and EVA
magical attacks use MEV

And it is one reason why I linked you to the damageflow in my answer above - that already states what you found out from the code
 

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
okay so I made it
heres what i changed:
this change makes magical attacks dependable on hit rate
1604940383299.png
1604940458052.png
and this change replaces miss and evasion checks with hit-eva formula
1604940607363.png
1604940633557.png
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
542
Reaction score
255
First Language
German
Primarily Uses
RMMV
okay so I made it
heres what i changed:
this change makes magical attacks dependable on hit rate
View attachment 167230
View attachment 167231
and this change replaces miss and evasion checks with hit-eva formula
View attachment 167233
View attachment 167234
If you can, try to build that in a Plugin ,instead of editing the default rpg Plugins, thats the better solution..
(just incase that you edited the rpg plugins here and didnt replicated them in another plugin already^^)
=> also if builded into a Plugin, $GameSwitches that can enable or disable the change are always usefull
=>On my Github is a Plugin "SRPG_Blank" . That is a nearly naked Plugin that can be edited to build new Plugins.. also the name can be changed of course. If you want you can use it .
 
Last edited:

UniqueName

Veteran
Veteran
Joined
Nov 12, 2018
Messages
78
Reaction score
12
First Language
Russian
Primarily Uses
Other
If you can, try to build that in a Plugin ,instead of editing the default rpg Plugins, thats the better solution..
(just incase that you edited the rpg plugins here and didnt replicated them in another plugin already^^)
=> also if builded into a Plugin, $GameSwitches that can enable or disable the change are always usefull
=>On my Github is a Plugin "SRPG_Blank" . That is a nearly naked Plugin that can be edited to build new Plugins.. also the name can be changed of course. If you want you can use it .
nah i don't think such small changes deserve its own plugin
plus yanfly already got one that does that (tho its not free)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
nah i don't think such small changes deserve its own plugin
it doesn't matter how small the changes are - the problem is another one:
ANY update to the corefiles will overwrite them with the original code.
So if you make the changes into a plugin they are protected from being overwritten by updates.
If not, you're forcing yourself to forego any and all future updates or core changes.
 

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top