How to increase EVA and HIT on level up

Kathor

Villager
Member
Joined
Aug 13, 2015
Messages
5
Reaction score
0
First Language
Spanish
Primarily Uses
Hi, I'm new to the forum and the software and I've been trying to tweak how progression and combat work in my game, but I haven't succeed so far.

My idea is that level does not increase the strength of a character, but it gives it "knowledge about how to fight", therefore it is able to land hits to more powerful enemies and evade some hits coming from weaker enemies. As I didn't know how to tweak the calculations according to character's level, I made character defense=level (level 1 defense is 1 and level 99 defense is 99).

I imported two scripts to my game in order to make this: https ://yanflychannel .wordpress.com/rmvxa/core-scripts/extra-param-formulas/   and  https://crazescriptasylum.wordpress.com/2012/01/11/third-script-accuracy-overflow/ , but I can only get two situations after modifying the formulas (changing the numbers): one in which everyone in battle evades everything (enemies and characters) and another one in which nobody evades (being enemy level def=95 and players level def=99).

I don't know if anyone knows another way to do what I want or what is wrong with my scripts.

Thank you in advance
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
We'd have to see your formula, but one thing to keep in mind is in the default system, battlers first roll to hit, then roll eva. This means that you can miss (to hit roll failed), or if you hit, then they can dodge (to hit roll succeeded, eva roll for enemy succeeded), or you hit. So a low to hit and a high EVA = a lot of missing.

Also, EVA is capped at 100% for a reason, as an EVA of 100% means you never hit, ever. Not unless you tweak how the calculation works.

So, to recap, we would need to see your formula to see what is going wrong, but there are a couple possible suspects.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,358
Reaction score
7,671
First Language
German
Primarily Uses
RMMV
EVA and HIT values are defined by features of the actors - and the scripts you downloaded redefine the way the engine handles the values, but not the features of single actors.

What you need instead is a dynamic feature script - Shaz wrote one and there are one or two more on the master script list.
 

Kathor

Villager
Member
Joined
Aug 13, 2015
Messages
5
Reaction score
0
First Language
Spanish
Primarily Uses
# This adjusts the formula for HIT. HIT is the physical accuracy rate. # This provided formula uses the average of the user's ATK and AGI as a # bonus contributing factor to increasing the user's HIT. If you do not # wish to use this formula, change it to "base_hit" to have it use # whatever the original HIT rate is. :hit_n_value => "self.def * 100", :hit_formula => "(n / 2) * 0.7250 + 0.050 + base_hit * 2/3", # This adjusts the formula for EVA. EVA is the physical evasion rate. # This provided formula uses the average of the user's AGI and LUK as a # bonus contributing factor to increasing the user's EVA. If you do not # wish to use this formula, change it to "base_eva" to have it use # whatever the original EVA rate is. :eva_n_value => "self.def * 1", :eva_formula => "(n / 1) * 13.25 + 0.000 + base_eva",^ That is the modified Yanfly script, the part I changed. The original scrpt can be found here https://github.com/Archeia/YEARepo/blob/master/Core/Extra_Param_Formulas.rb

The next one is the crazescriptasylum script, the one I imported and not modified at all, it is supposed to change success rate for a skill so can be higher than 100% so attacks can hit an enemy if it is high enough even if EVA is 100

#==============================================================================# # ▼ Craze's Script Asylum - Accuracy Overflow v1.00# -- Last Updated: 2012.01.10# -- Level: Normal# -- Requires: n/a# #==============================================================================$imported = {} if $imported.nil?$imported["CRZ-AccuracyOverflow"] = true#==============================================================================# ▼ Updates# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# 2012.01.10 - Started and Finished Script.# #==============================================================================# ▼ Introduction# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# In default Ace, skill success rate caps at 100%, meaning that even the most# powerful accuracy buff won't help you hit an evasive ninja. With this script,# hit rates above 100% are useful in hitting enemies with a high evasion or# magical evasion.# #==============================================================================# ▼ Instructions# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# To install this script, open up your script editor and copy/paste this script# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.# # -----------------------------------------------------------------------------# Skill & Item Notetags - These notetags go in those noteboxes in the database.# -----------------------------------------------------------------------------# <hit: x%> <hit rate: x%> <success: x%> <success rate: x%># Sets the success rate of the skill or item, replacing the input field# in the database. All of the tags do the same thing; use whichever one# makes the most sense to you.## Use <hit: 999%> if you want to make what will likely be a "guaranteed hit"# skill without actually using the "guaranteed hit" hit type in the database.# If you have any enemies that can combat 999% accuracy, I pity your players.# #==============================================================================# ▼ Compatibility# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that# it will run with RPG Maker VX without adjusting.## It is encouraged that this script be used with Yanfly Engine Ace - Extra# Param Formulas, so as to make your speed stats affect accuracy and evasion# if you so choose. ## Overwritten methods:# Game_Battler# item_apply## NOTE: item_apply is an important method, and many scripts likely alias it,# if not overwrite it themselves. If you wish to merge this script with that, # it is simple and you are free to do so without my permission. Look at the# script itself to see the lines you need to change.#==============================================================================module CRZ module ACC_OVER #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Evasion Message Setting - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # If true, evasion messages will still appear based on the target's # evasion rate. If not, all misses (due to evasion or not) will be # displayed as a common miss message. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- USE_EV = true end#==============================================================================# ▼ Editting anything past this point may potentially result in causing# computer damage, incontinence, explosion of user's head, coma, death, and/or# halitosis so edit at your own risk.#============================================================================== module REGEXP module USABLEITEM NEW_HIT = /<(?:hit|hit rate|HIT_RATE|success|SUCCESS_RATE):[ ](\d+)([%%])>/i end # USABLEITEM end # REGEXPend # CRZ#==============================================================================# ■ DataManager#==============================================================================module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_acc_over load_database; end def self.load_database load_database_acc_over load_notetags_acc_over end #-------------------------------------------------------------------------- # new method: load_notetags_acc_over #-------------------------------------------------------------------------- def self.load_notetags_acc_over groups = [$data_skills, $data_items] for group in groups for obj in group next if obj.nil? obj.load_notetags_acc_over end end end end # DataManager#==============================================================================# ■ RPG::UsableItem#==============================================================================class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # common cache: load_notetags_acc_over #-------------------------------------------------------------------------- def load_notetags_acc_over #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when CRZ::REGEXP::USABLEITEM::NEW_HIT @success_rate = $1.to_i end } # self.note.split #--- end end # RPG::UsableItem#==============================================================================# ■ Game_Battler#==============================================================================class Game_Battler < Game_BattlerBase def item_apply(user, item) @result.clear @result.used = item_test(user, item) # ALL CHANGES BELOW HERE rate = item_hit(user, item) - item_eva(user, item) @result.missed = (@result.used && rand >= rate) if @result.missed and rate < item_eva(user, item) and CRZ::ACC_OVER::USE_EV @result.missed = false; @result.evaded = true end # ALL CHANGES ABOVE HERE if @result.hit? 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 end end # Game_Battler#==============================================================================# # ▼ End of File# #==============================================================================Sorry for that long script and thank you for your help
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
:eva_formula => "(n / 1) * 13.25 + 0.000 + base_eva",
There's your problem. You are taking the def * 13.25, which means a defense of 1 is an evasion of 1325%! Remember EVA is a percent, so you need to covert your percents to decimals first.

Also, if you look at your TO HIT formula, you converted that one to decimals correctly (though I am leery of a boost of 72% per 2 points of defense). Hence the error.
 
Last edited by a moderator:

Kathor

Villager
Member
Joined
Aug 13, 2015
Messages
5
Reaction score
0
First Language
Spanish
Primarily Uses
I changed the formula as bgillisp said and it was hard to find through trial and error. The result is that the enemy is able to hit you when enemy def = 95 and character def = 99, but the character misses every attack when character def = 3 and enemy def = 5, so the method is not good enough.

It's difficult (if not impossible) to find the correct numbers for the formula to make that my progression system works in all situations.

Shaz's script looks quite hard for me atm

Here is my formula, I adjusted all 70.28442 decimals through trial and error and it took a long time.

FORMULA ={ # This adjusts the formula for HIT. HIT is the physical accuracy rate. # This provided formula uses the average of the user's ATK and AGI as a # bonus contributing factor to increasing the user's HIT. If you do not # wish to use this formula, change it to "base_hit" to have it use # whatever the original HIT rate is. :hit_n_value => "self.def * 100", :hit_formula => "(n / 2) * 0.7250 + 0.050 + base_hit * 2/3", # This adjusts the formula for EVA. EVA is the physical evasion rate. # This provided formula uses the average of the user's AGI and LUK as a # bonus contributing factor to increasing the user's EVA. If you do not # wish to use this formula, change it to "base_eva" to have it use # whatever the original EVA rate is. :eva_n_value => "self.def * 1", :eva_formula => "(n / 2) * 70.28442 + 0.050 + base_eva * 2/3",I ended up adding a __END__ at the beginning of this script and changed to a traditional progression system as I don't have the knowledge to make this one.

I'm still interested in this, so if anyone has anything similar to this and wants to share it, I'd be glad to hear your ideas :)

If you don't have any other tip/clue/idea, I'll stick to the default RPG Maker system with some extra changes (you permanently increase your ATK the more you use certain skills)

Thanks for your help
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
With that you posted, if DEF is 3 for you and 5 for enemy, here is what you get:

player to.hit = (3/2) * 0.7250 +0.50 + base_to_hit * 2/3, which is (assuming a base of 95%): = 169.16%

enemy evade = (5/2) * 70.28442 + 0.050 + base_eva * (2/3), which is (assuming a base of 5%) = 17,579.43%.

169.16 % - 17,579.43 = -17410.28% chance to hit that enemy (with the overflow script you mentioned and how it changes the system).

So, yeah, no wonder you're missing all the time, as your chance to hit is < 0%, so you will always miss.

You really should set up a spreadsheet to track the formula, so you can better see what you will have for the DEF values possible in your game, as well as the enemy DEF values. As it is, this seems to be an error in mathematics more than anything. As stated before, you *cannot* use 70.28442 for eva with 0.7250 for to hit, as each point of DEF is adding 72.5% to the to hit and 7,028.442% to the evade (which means if DEF is same for both, no one will ever hit each other! In fact, I'm amazed anyone ever hit anyone for a DEF above 0).

Why don't you try n * 0.01 + base_EVA for EVA, and for to hit, n * 0.01 + base_To hit? That way you would improve your to hit and EVA by 1% point per point of DEF (if you want more, use 0.02 instead for 2%). I've used that before in a project, and it seems to work well (and avoids the issue that 1 point improvement in your DEF means you suddenly can no longer be hit).
 
Last edited by a moderator:

Kathor

Villager
Member
Joined
Aug 13, 2015
Messages
5
Reaction score
0
First Language
Spanish
Primarily Uses
The excel spreadsheet is probably the best way to do it, yes. I'll try to make one with your suggestion and see the results both in the calculations and in-game.

Thank you
 

Matseb2611

Innovate, don't emulate
Veteran
Joined
Oct 15, 2012
Messages
4,568
Reaction score
6,389
First Language
English
Primarily Uses
RMMV
I remember running into this issue with that script too, because I thought it used %ges, when in fact it uses decimals. So if you want to add 5% chance of evasion, you have to use the +0.05 as a bonus for evasion rather than 5.
 

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

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
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:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top