Where is the Hit% formula in scripts? Hit Dmg Experiment question

Status
Not open for further replies.

watermark

Veteran
Veteran
Joined
Dec 25, 2012
Messages
613
Reaction score
545
First Language
English
Primarily Uses
RMMV
Hi, where can I find the hit% formula in the scripts? This is because my hit and dmg experiment is not working out as I thought.

According to this tutorial:

http://forums.rpgmakerweb.com/index.php?/topic/4219-rpg-maker-vxace-damage-flow/

The hit% is only affected by hit% and eva%. So if I give the hero 100% hit and enemy 0% eva it should hit all the time right? But it's not. 

Here's my experiment:

1. I gave the hero hit + 100%

2. I removed the eva param for the monster, so its eva should be at 0% right?

3. I made both hero and monster stats (atk, def,etc.) all 10s. And both have 100hp.

4. I gave the hero an axe with ATK of 10 and Physical Atk Element. That's all, nothing else.

5. I changed the default attack skill 1's formula to "a.atk". So theoretically, this should just apply the hero's attack (which is 10 + the weapon's 10 = 20) and ignore defense, right?

6. I ran Battle Test.

Here's the result:

1. The hero misses like half the time. So does the enemy.

2. The hero always does 19 dmg. (shouldn't he do 20?) and the enemy always does 9 dmg.

Why?

I only installed Yanfly's Battle Engine. Could that be causing it? Can someone point me at where the hit% formulas are so I can look at it? Thanks!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
1) Weird, if there's 0 eva and 100% hit, it should hit. Unless there's script that you have which includes agi in the eva count


2) Variance probably...
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
FYI:


The scripts themselves do not check for hit (random < HIT%), they check for miss (random > HIT%), and the functions are named that way. If you want to find the formulas and functions in the script editor, you have to search for MISS.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
the game checks for miss, then it it's not a miss, it checks for evade... it still doesn't explain the problem though...


if HIT is 100%, it shouldn't miss, and 0 eva should cause the enemy not to evade...


Are you sure the only custom script that you have is the battle engine and has nothing else that might be using another param to comput for hit? Also, can you post a link to Yanfly's battle engine?
 

watermark

Veteran
Veteran
Joined
Dec 25, 2012
Messages
613
Reaction score
545
First Language
English
Primarily Uses
RMMV
Ah! I found the problem! It is because I installed Yanfly's "Extra Param Formulas" that changed the hit formulas. I found this out when i ran a clean project and it worked as expected. I deleted Yanfly's Extra Param Formulas and it works as expected now. Silly me.
 

BoluBolu

Veteran
Veteran
Joined
Apr 24, 2014
Messages
452
Reaction score
117
Primarily Uses
I know this thread has been solved but I just want to add something so if anyone got same problem about this mattr, he/she can see the method that point out how a hit is success is being calcutated in rgss3

This method is inside the class Game_Battler

@result is a Game_ActionResult object

 #--------------------------------------------------------------------------  # * Apply Effect of Skill/Item  #--------------------------------------------------------------------------  def item_apply(user, item)    @result.clear      @result.used = item_test(user, item) # <= check this skill/item is used or not    @result.missed = (@result.used && rand >= item_hit(user, item)) # <= even if used, it's miss or not    @result.evaded = (!@result.missed && rand < item_eva(user, item)) # <= if not miss, the target evade or not    if @result.hit? # <= Used + not missed, + not evaded      unless item.damage.none?         @result.critical = (rand < item_cri(user, item))        make_damage_value(user, item)        execute_damage(user)      end      item.effects.each {|effect| item_effect_apply(user, item, effect) }      item_user_effect(user, item)    end  endLike miko said
the game checks for miss, then it it's not a miss, it checks for evade...
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Seriously, the engine wants you to not hit the enemy. XD
 

Gab8

Villager
Member
Joined
Feb 20, 2015
Messages
9
Reaction score
0
First Language
Spanish
Primarily Uses
And thus why even at 95% you miss more than you should.
Sorry to resurrect an old thread, but I'm having the same issue (hit 95, eva5 and there are a lot of misses, both from my party and from the enemy). I was trying to make sense out of the script used to calculate the miss rate but I'm not following that "random" parameter. Would that be the cause of "Hit 95% / Eva 5%" not working as it should seem to work?

EDIT: I'm not using Yanfly's extra param script as it gives me a stackTooDeep error without any config on my side, so until I solve that, I will not use the custom formulas.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
Sorry to resurrect an old thread, but I'm having the same issue
Gab8, please make a new topic for your problem as it's most likely not the same as this.

Your problem with finding hit% in the is because the engine doesn't track the hit, it tracks the miss.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top