LEARNING TO USE DAMAGE FORMULAS IN VX ACE

Posts

Pages: first 12 next last
unity
You're magical to me.
12540
I'm making my new game in VX Ace, which I've just recently gotten my hands on, and I have to admit that I'm not very good with math, so deciding on how damage formulas work is a little daunting to me.

I have, however, noticed that in previous RPG Makers (Well, XP, at least) Magic damage doesn't seem to scale nearly as well as Physical damage, and if I'm understanding the formulas correctly, VX Ace follows this trend, as something like 150 + a.mat *2 - b.mdf *2 (the default Fire spell formula) won't get as much extra oomph from magic power as a physical skill would from increased physical attack. (For example, the Physical "Berserker's Dance" skill's formula is a.atk * 5 - b.def *2)

So, if I simply substitute a formula like the attack skills but use it for the magic skills instead, like maybe a.mat *5 - b.mdf *2, would that put magical skills on the same playing-field as physical skills?

I know a lot of this is just going to come down to trial-and-error and in-game testing, but if anyone has tips on building a robust skillset with damage formulas, I'd be really happy to hear them :D

Thanks!
author=unity
So, if I simply substitute a formula like the attack skills but use it for the magic skills instead, like maybe a.mat *5 - b.mdf *2, would that put magical skills on the same playing-field as physical skills?

Yes, it would do exactly that.

Personally, I always ask myself what I want the formula to accomplish and then design one accordingly. For example, sometimes I want defense to be able to reduce the damage to zero and sometimes I don't.
Backwards_Cowboy
owned a Vita and WiiU. I know failure
1737
I always completely wipe out the preset skills whenever I start a new project, since I feel the ones that are there weren't done as well as they could have been. I like to have defense-ignoring skills, skills that gain power if you have high speed, skills that utilize both attack and magic, etc. The formulas are a little hard to understand at first, but just holding the cursor over the box displays how to use them. It's a lot better than XP when it comes to balancing, since each individual skill can have its own formula.

When it comes to magic, a lot of the skills seem more poorly scaled than physical ones because by default, there are multiple levels of each elemental magic. Physical skills don't usually get additional tiers, so they need to be usable for the entire game. Fire only has to be usable until you get Fire 2, so to avoid having a super great spell that will last you through the entire game, it's scaled to be less useful when you get to the point where Fire 2 is your main spell.

Of course, that's just if you keep the default spells and progression in the game. The hard part is figuring out a formula that won't overkill bosses while still being useful. You don't want a magic user to be able to kill a boss in just two or three spells, but you also want them to be better than just spamming the Attack option every turn.
If it'll help, here's a few tutorials in regards to that!

Damage Flowchart
Damage Formulas I
Damage Formulas II
The problem with damage formulas is that it's hard to even give basic advices. Let's take a very basic formula for the default attack as an example.

a.atk * 4 - b.def * 2

Now, we want to make a physical skill that's stronger than the basic attack. There are different ways to go about it, including, but certainly not limited to, following:

1) a.atk * 4 - b.def * 2 + 50
2) a.atk * 5 - b.def * 2
3) (a.atk * 4 - b.def * 2) * 4 / 3

So, which one should you use? Unfortunately, the answer depends one several factors, like how payment for using the skill is handled, how long the skill is supposed to be useful and overall how the game is planned. The first option is good if the player is meant to eventually get stronger skills the replaces earlier skills while the other options are better if the skill is supposed to remain useful trough the whole game. 2) and 3) are similar, but has (usually) subtle differences in how they interact with enemy defense.

Even this basic step can be complicated. However, I have one advice if you're not good at this; keep it simple.
unity
You're magical to me.
12540
author=Crystalgate
author=unity
So, if I simply substitute a formula like the attack skills but use it for the magic skills instead, like maybe a.mat *5 - b.mdf *2, would that put magical skills on the same playing-field as physical skills?
Yes, it would do exactly that.

Personally, I always ask myself what I want the formula to accomplish and then design one accordingly. For example, sometimes I want defense to be able to reduce the damage to zero and sometimes I don't.


Ah, I see. Is there an easy way to make each attack do at least one damage?

author=Backwards_Cowboy
When it comes to magic, a lot of the skills seem more poorly scaled than physical ones because by default, there are multiple levels of each elemental magic. Physical skills don't usually get additional tiers, so they need to be usable for the entire game. Fire only has to be usable until you get Fire 2, so to avoid having a super great spell that will last you through the entire game, it's scaled to be less useful when you get to the point where Fire 2 is your main spell.

Of course, that's just if you keep the default spells and progression in the game. The hard part is figuring out a formula that won't overkill bosses while still being useful. You don't want a magic user to be able to kill a boss in just two or three spells, but you also want them to be better than just spamming the Attack option every turn.


Ah, so putting magic and physical skills on the same playing field isn't necessarily the best way to do things. Maybe just the spells of the final tier should have a formula that scales that much.

author=Archeia_Nessiah
If it'll help, here's a few tutorials in regards to that!

Damage Flowchart
Damage Formulas I
Damage Formulas II


These are an amazing help! Thank you very much! :D I had no idea you could do so much with them! ...Though most of the stuff on the last link went over my head a bit ^^;;

author=Crystalgate
The problem with damage formulas is that it's hard to even give basic advices. Let's take a very basic formula for the default attack as an example.

a.atk * 4 - b.def * 2

Now, we want to make a physical skill that's stronger than the basic attack. There are different ways to go about it, including, but certainly not limited to, following:

1) a.atk * 4 - b.def * 2 + 50
2) a.atk * 5 - b.def * 2
3) (a.atk * 4 - b.def * 2) * 4 / 3

So, which one should you use? Unfortunately, the answer depends one several factors, like how payment for using the skill is handled, how long the skill is supposed to be useful and overall how the game is planned. The first option is good if the player is meant to eventually get stronger skills the replaces earlier skills while the other options are better if the skill is supposed to remain useful trough the whole game. 2) and 3) are similar, but has (usually) subtle differences in how they interact with enemy defense.

Even this basic step can be complicated. However, I have one advice if you're not good at this; keep it simple.


Yeah, that's a good point. Given my inexperience, I shouldn't go overboard with them. I'll try a few different things and see if I can figure out what works best.
author=unity
Ah, I see. Is there an easy way to make each attack do at least one damage?

Sure. Locate following in Game_Battler:
  def make_damage_value(user, item)

value = item.damage.eval(user, self, $game_variables)
value *= item_element_rate(user, item)
value *= pdr if item.physical?
value *= mdr if item.magical?
value *= rec if item.damage.recover?
value = apply_critical(value) if @result.critical
value = apply_variance(value, item.damage.variance)
value = apply_guard(value)
@result.make_damage(value.to_i, item)
end


After the line value = apply_guard(value) add following:
value = [value, 1].max


I think that's rather pointless though, once characters have a three digit HP value, dealing 1 point of damage is meaningless. Rather, I change the formula entirely so defense no longer reduces damage to zero. For example, I change following:
a.atk * 4 - b.def * 2
to
4 * a.atk ** 2 / (a.atk + b.def)

This formula is more complicated, but it's however more balanced. You can have a greater variance in character and enemy attack and defense values without breaking things. The problem is that if you don't understand what the formula does, it's hard to figure out how other skills and spells should look like.

author=unity
Ah, so putting magic and physical skills on the same playing field isn't necessarily the best way to do things. Maybe just the spells of the final tier should have a formula that scales that much.

That's actually a good idea. Note that this will likely result in formulas where the final tier spell can theoretically deal less damage than the semi final tier if the caster has a very low mat.

Anyway, I think that first should you decide following:
1) How will spells progress? Will you get replacement spells like Fire, Fira and Firaga or will spells remain useful trough the whole game?
2) The same question, but with physical skills.
3) How are costs handled? As a rule of thumb, use MP cost for offensive skills that become outdated and TP cost for skills that remain useful.
4) How does stats progress? What values does characters start and end with?
unity
You're magical to me.
12540
author=Crystalgate
I think that's rather pointless though, once characters have a three digit HP value, dealing 1 point of damage is meaningless.


That's true. I like your idea of a good formula better than the "at least one damage" idea, now that you talk about it more.

author=Crystalgate
Rather, I change the formula entirely so defense no longer reduces damage to zero. For example, I change following:
a.atk * 4 - b.def * 2
to
4 * a.atk ** 2 / (a.atk + b.def)

This formula is more complicated, but it's however more balanced. You can have a greater variance in character and enemy attack and defense values without breaking things. The problem is that if you don't understand what the formula does, it's hard to figure out how other skills and spells should look like.


I must admit that the formula goes over my head and I'm not sure what it does, aside from relying on something besides defense to reduce damage, which is a very good idea from what I'm wanting. Other than that, I'm a bit clueless ^^;;

author=Crystalgate
Anyway, I think that first should you decide following:
1) How will spells progress? Will you get replacement spells like Fire, Fira and Firaga or will spells remain useful trough the whole game?
2) The same question, but with physical skills.
3) How are costs handled? As a rule of thumb, use MP cost for offensive skills that become outdated and TP cost for skills that remain useful.
4) How does stats progress? What values does characters start and end with?


This is really helpful, because these are all questions that I need to answer for myself. Here's what I think off the top of my head:

1)The game's going to only be around 4-6 hours, so I was thinking of a 2-tier system for healing and offensive magic. Basically: Low-level element spell, version of the spell that hits all enemies, then later in the game they get the High-level version that scales better, and then a high-level version that hits all targets.

2)Physical skills are based on TP, which I've renamed "Rage" and made the only way to accumulate it by taking damage. Each character will learn a 30 point cost, 60 point cost, and eventually a 100 point cost skill. I want even the lower cost skills to scale well, but to not be nearly as effective as saving up Rage for the higher cost ones they get later.

3)Yeah, I'm going with the standard "MP is used for magic and TP (Rage) is used for Physical" for the most part.

4)This is, unfortunately, probably the category that I've thought about the least, as so far, I have characters excel at some stats and not so much at others, and just have them grow steadily in the stats they're supposed to excel in and not so much for the stats they are weak in.
author=unity
I must admit that the formula goes over my head and I'm not sure what it does, aside from relying on something besides defense to reduce damage, which is a very good idea from what I'm wanting. Other than that, I'm a bit clueless ^^;;

If the target has the same defense as the attacker has attack, damage is reduced by half, meaning the target lives twice as long as it would with no defense at all. If the defender has twice as much defense as the attacker has attack, damage is cut to a third meaning the target lives thrice as long. With three times the defense, the target lives four times as long and so on. This holds true for values in-between as well. With 1,3 times the defense, the target lives 2,3 times as long.

Basically, you never become invincible. This formula tolerates more variance in attack and defense stats than a straight subtractive system does.

Making physical skills is easy with this system, replace the 4 in 4 * a.atk ** 2 / (a.atk + b.def) with a higher number for higher damage. Spells is more complicated, if you use this formula, I will probably have to walk you trough it.

author=unity
1)The game's going to only be around 4-6 hours, so I was thinking of a 2-tier system for healing and offensive magic. Basically: Low-level element spell, version of the spell that hits all enemies, then later in the game they get the High-level version that scales better, and then a high-level version that hits all targets.

With only two tiers, it's far easier. We only need to know starting stats.
unity
You're magical to me.
12540
author=Crystalgate
If the target has the same defense as the attacker has attack, damage is reduced by half, meaning the target lives twice as long as it would with no defense at all. If the defender has twice as much defense as the attacker has attack, damage is cut to a third meaning the target lives thrice as long. With three times the defense, the target lives four times as long and so on. This holds true for values in-between as well. With 1,3 times the defense, the target lives 2,3 times as long.

That is amazing! May I use this formula or something similar?

author=Crystalgate
With only two tiers, it's far easier. We only need to know starting stats.

I can provide the stats I have so far, though I haven't tested them as much as I'd like. The three characters are the Hero, a speedy character who can add buffs, the Warrior, who has high physical defense but low magic defense, is slower, hits hard, and can heal, and the Mage, who fits the standard magic-user archetype.

Their stats are:

Hero

MHP Lv1 - 418
Lv99 - 7319
MMP Lv1 - 41
Lv99 - 844
ATK Lv1 - 20
Lv99 - 208
DEF Lv1 - 15
Lv99 - 169
MAT Lv1 - 14
Lv99 - 150
MDF Lv1 - 16
Lv99 - 165
AGI Lv1 - 36
Lv99 - 501
LUK Lv1 - 25
Lv99 - 360

Warrior

MHP Lv1 - 500
Lv99 - 7700
MMP Lv1 - 46
Lv99 - 861
ATK Lv1 - 22
Lv99 - 217
DEF Lv1 - 19
Lv99 - 172
MAT Lv1 - 15
Lv99 - 153
MDF Lv1 - 12
Lv99 - 122
AGI Lv1 - 18
Lv99 - 244
LUK Lv1 - 15
Lv99 - 230

Mage

MHP Lv1 - 385
Lv99 - 6100
MMP Lv1 - 80
Lv99 - 1421
ATK Lv1 - 12
Lv99 - 140
DEF Lv1 - 10
Lv99 - 130
MAT Lv1 - 22
Lv99 - 230
MDF Lv1 - 20
Lv99 - 203
AGI Lv1 - 28
Lv99 - 337
LUK Lv1 - 33
Lv99 - 370

Thanks very much for all of this help!

EDIT: I should probably mention that the Mage is the only character with access to the 2nd Tier spells, and the Warrior is the only one with healing spells.
author=unity
That is amazing! May I use this formula or something similar?

Of course. I think I can provide you with all necessary offensive formulas now.

Basic attack: 4 * a.atk ** 2 / (a.atk + b.def)
For physical skills, use the same formula, but change the 4 to something else.

Second tier magic: 4 * a.mat **2 / (a.mat + b.mdf)
If the spells are to weak, change the 4 to a higher number.

The first tier magic is the most complicated.
Try this: (40 + 2 * a.mat) * (20 + a.mat) / (20 + a.mat + 2 * b.mdf)
If the damage is to low or high, change the numbers in bold. The first number should always be twice as high as the other two.

Healing spells aren't resisted, so they don't need a fancy formula. They should be similar to the default, only you change the numbers a bit.
unity
You're magical to me.
12540
Thanks again! This is all fantastic! :D
i'm reviving this from the dead just because I was there with my notepad making some calculations based on one of Crystalgate's formulae and I got it nicely done in a chart so you can see how it progresses and build another formula from there.

4 * a.atk ** 2 / (a.atk + b.def)

16 atk < 32 def = 21
32 atk < 64 def = 42
64 atk < 128 def = 102

16 atk < 24 def = 25
32 atk < 48 def = 51
64 atk < 96 def = 102

16 atk < 16 def = 32
32 atk < 32 def = 64
64 atk < 64 def = 128

16 atk < 08 def = 42
32 atk < 16 def = 85
64 atk < 32 def = 170

16 atk < 04 def = 51
32 atk < 08 def = 102
64 atk < 16 def = 204

16 atk < 01 def = 60
32 atk < 02 def = 120
64 atk < 04 def = 240

16 atk < 00 def = 64 ( straight 16 * 4 )
32 atk < 00 def = 128 ( straight 32 * 4 )
64 atk < 00 def = 256 ( straight 64 * 4 )


s-sorry for necroposting, but this formula was absolutely useful for me and it totally englightened me on how I should build my formulae from now on :D
It's elegant and simple, yet effective. We should post our formulaw here, or maybe create a topic for that? Hm, I shall post one from Charlotte:

a.atk + ( a.atk ** 2 / 4) - ( b.def ** 2 / 9) (the basic attack)

a.mat * 5 + ( a.mat ** 2 /1.2) - ( b.mdf ** 2 / 3) (a powerful spell)

It's kind of similar to the original rmvxa formula though, and I really didn't like it. I don't like using the PDR and MDR Exparams as defense from equipment either. Crystalgate's formula is awesome!
This topic is amazing and thank you for reviving it. Properly applying damage formulas is a boon to game designers and I think it something that warrants more discussion and observation.
I didn't realize the double asterisk was the operand for an exponent in Ruby. THIS IS USEFUL INFORMATION INDEED.
Craze
why would i heal when i could equip a morningstar
15150
Housekeeping: I felt the same way when I realized it, haha.

I really like Crystalgate's method, especially compared to other exponential damage formulas like Persona 4's. They take SO MUCH MORE balancing.

For me personally, I want stats to make some sort of sense. I want the player to know what the heck 30 Armor vs 25 Armor will do for them. They might not know the exact amount of mitigation it will provide, but they will feel the effects.

For my current project I'm using

AtkStat * 4/3 - DefStat / 3

It's really simple. Basically, if Attack and Defense are equal, you deal damage equal to your Attack. You'd need Defense equal to quadruple the enemy's Attack to fully ignore the damage, which is something that's not really gonna happen in this game (planned stat growth is like, from around 25-30 at start to 55-75 by the end).

even if it's simple it's better than ff6's mess

http://www.rpglegion.com/ff6/algs/algs.htm#damage

unity
You're magical to me.
12540
I want to again give a huge thank-you to Crystalgate, as his formula has indeed been working perfectly for my game. ^_^

author=Craze
Housekeeping: I felt the same way when I realized it, haha.

I really like Crystalgate's method, especially compared to other exponential damage formulas like Persona 4's. They take SO MUCH MORE balancing.

For me personally, I want stats to make some sort of sense. I want the player to know what the heck 30 Armor vs 25 Armor will do for them. They might not know the exact amount of mitigation it will provide, but they will feel the effects.

For my current project I'm using

AtkStat * 4/3 - DefStat / 3

It's really simple. Basically, if Attack and Defense are equal, you deal damage equal to your Attack. You'd need Defense equal to quadruple the enemy's Attack to fully ignore the damage, which is something that's not really gonna happen in this game (planned stat growth is like, from around 25-30 at start to 55-75 by the end).


Ooooh, that's a cool formula, too! I've gotten where I understand formulas a bit better, but I still suck at coming up with them myself ^^;;


author=Craze
even if it's simple it's better than ff6's mess

http://www.rpglegion.com/ff6/algs/algs.htm#damage


Holy cow, I never knew it was such a mess XD
author=Craze
Housekeeping: I felt the same way when I realized it, haha.
...

http://www.rpglegion.com/ff6/algs/algs.htm#damage



Yeah, I probably would have tried to use a caret, and, failing that, just multiplied the variable by itself a bunch. When I saw the double asterisk, at first I read it as a typo and was trying to figure out how that formula worked, haha.

And the thing I resent most from that ff6 page is that the game didn't tell me how earrings/atlas armlets/hero rings worked.
My damage formula is pretty basic:

Simplified, it is this:
damage = a.atk * (a.atk/a.atk + b.def)

...which is the same as a.atk ** 2 / (a.atk + b.def), which is what CrystalGate/Joseph posted, except without the x4 (smaller numbers rule!)
slash
APATHY IS FOR COWARDS
4158
I'm a big fan of smaller numbers!


I usually use:

Base Power + (10 + a.atk - b.def)/10

It works out to "Attack deals X damage, plus or minus 10% for each point of difference between ATK and DEF". It simplifies things, I think, because it means each point of ATK = 10% more damage. However, you gotta work your game around it because it also means that enemies with 10+ DEF over your ATK won't take any damage at all.

For the game I'm working on now though, it's even simpler:

Base Power + (a.atk - b.def)

Attacks only deal 5-20 damage, so each individual point of ATK or DEF has a noticeable difference. I also cut the effect of ATK and DEF by half for multi-hit or AOE attacks.
Pages: first 12 next last