LEARNING TO USE DAMAGE FORMULAS IN VX ACE
Posts
What a.atk ** 2 / (a.atk + b.def) does compared to 4 * a.atk ** 2 / (a.atk + b.def) is to change the ratio between hit-points and the attack/defense stats. Assuming everything else is equal, with the later formula, you have to give characters and enemies four times the hp compared to the former formula. However, you could do the opposite consider hp set and in this case the former formula would require you to give characters four times the attack and defense compared to the later formula.
If you use Base Power + (10 + a.atk - b.def)/10, it's very likely you end up having to give characters less hp than attack and defense, which is rather rare in RPGs. That doesn't mean it's a bad thing of course. Another consequence is that defense has to be kept lower than attack.
This is one of the benefits of creating your own formulas, you can control what you want the numbers to be. I prefer changing the stats so that I can use stats I'm comfortable with rather than having to adapt my stats to fit the formula. There are of course a myriad of other desires that affects what kind of formula is desirable. I usually create a new formula for every project I start.
If you want to try coming up with your own formulas, try starting with asking yourself what you want the formula to accomplish.
If you use Base Power + (10 + a.atk - b.def)/10, it's very likely you end up having to give characters less hp than attack and defense, which is rather rare in RPGs. That doesn't mean it's a bad thing of course. Another consequence is that defense has to be kept lower than attack.
This is one of the benefits of creating your own formulas, you can control what you want the numbers to be. I prefer changing the stats so that I can use stats I'm comfortable with rather than having to adapt my stats to fit the formula. There are of course a myriad of other desires that affects what kind of formula is desirable. I usually create a new formula for every project I start.
If you want to try coming up with your own formulas, try starting with asking yourself what you want the formula to accomplish.
I really, really like the damage formula Crystalgate posted. It seems like it makes normal attacks scale a lot better than my basic one, which was:
a.atk * 3 - b.def * 2
What do you folks do for healing magic? I tend to do something like:
a.mat * 2 + 100 + b.mhp * 0.03
So it's guaranteed to recover at least 3% of the target's max HP. This isn't quite so useful for the heroes (although it does give a small boost), but it's better for larger enemies, or even bosses, that can heal themselves or have helper enemies that can heal without having to mess with their REC stat.
a.atk * 3 - b.def * 2
What do you folks do for healing magic? I tend to do something like:
a.mat * 2 + 100 + b.mhp * 0.03
So it's guaranteed to recover at least 3% of the target's max HP. This isn't quite so useful for the heroes (although it does give a small boost), but it's better for larger enemies, or even bosses, that can heal themselves or have helper enemies that can heal without having to mess with their REC stat.
I tend to use MDF for healing magic! So it's normally something like
b.mhp * 0.1 + a.mdf * 4, with stronger levels of the spell increasing the hp multiplier a lot and the mdf multiplier a little
Cure
b.mhp * 0.1 + a.mdf * 4
Cura
b.mhp * 0.3 + a.mdf * 4.5
Curaga
b.mhp * 0.6 + a.mdf * 5
Though for Lacrimosa I have used this:
Cure Light
a.mat + a.mdf + (a.mhp - a.hp) / 4
which always recovers a fourth of the ~missing~ hp, making its use a little more situational.
EDIT: If you wanna take stuff to the next level you could even make the multiplier itself scale with how much HP you have left, making it restore 25% of your missing Hp if you have 25% missing HP or 75% of your missing HP if you have 75% Hp for example :D
b.mhp * 0.1 + a.mdf * 4, with stronger levels of the spell increasing the hp multiplier a lot and the mdf multiplier a little
Cure
b.mhp * 0.1 + a.mdf * 4
Cura
b.mhp * 0.3 + a.mdf * 4.5
Curaga
b.mhp * 0.6 + a.mdf * 5
Though for Lacrimosa I have used this:
Cure Light
a.mat + a.mdf + (a.mhp - a.hp) / 4
which always recovers a fourth of the ~missing~ hp, making its use a little more situational.
EDIT: If you wanna take stuff to the next level you could even make the multiplier itself scale with how much HP you have left, making it restore 25% of your missing Hp if you have 25% missing HP or 75% of your missing HP if you have 75% Hp for example :D
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Getting a good formula for healing is about figuring out how your player HP growth compares to your player's magic stat growth (or whatever stat affects the power of healing spells). If your player gets most of their stats from levels, then you should hopefully already know what the stat growth curves are. But it's very likely that the two stats don't grow at the same curve. For example, it's very common for HP to grow quadratically while magic might grow linearly (or at least at a slower rate). If so then your formula needs to account for that by basically converting the magic growth rate formula into the HP growth rate formula.
For example:
-An average party member's HP is roughly equal to 300 + 20 * level^0.3.
-Your healer's magic stat is roughly equal to 10 + level/2.
-You want a healing spell that heals approximately 1/3 of an average party member's HP, assuming the healer and the target are the same level.
To get the right healing formula you will need to do some algebra.
healing formula = hp / 3
Subtitute in the actual formula for hp:
healing formula = (300 + 20 * level^0.3) / 3
Of course we don't want it to be based on the caster's level but on their magic.
We know that magic = 10 + level/2. If we use algebra to solve for level in that equation, we get level = 2*(magic-10).
We can then subtitute that into the healing formula in place of level.
healing formula = (300 + 20 * (2*(magic-10))^0.3) / 3
And there would be a great healing formula for this example game. This formula will heal about 30% of the target's HP if a level 1 healer uses it on a level 1 target, and will also heal about 30% of the target's HP if a level 99 healer uses it on a level 99 target.
If you want multiple tiers of healing spells that unlock over the course of the game, I strongly recommend simply adding a flat amount to each tier rather than increasing the effect of the healing stat.
For example:
-An average party member's HP is roughly equal to 300 + 20 * level^0.3.
-Your healer's magic stat is roughly equal to 10 + level/2.
-You want a healing spell that heals approximately 1/3 of an average party member's HP, assuming the healer and the target are the same level.
To get the right healing formula you will need to do some algebra.
healing formula = hp / 3
Subtitute in the actual formula for hp:
healing formula = (300 + 20 * level^0.3) / 3
Of course we don't want it to be based on the caster's level but on their magic.
We know that magic = 10 + level/2. If we use algebra to solve for level in that equation, we get level = 2*(magic-10).
We can then subtitute that into the healing formula in place of level.
healing formula = (300 + 20 * (2*(magic-10))^0.3) / 3
And there would be a great healing formula for this example game. This formula will heal about 30% of the target's HP if a level 1 healer uses it on a level 1 target, and will also heal about 30% of the target's HP if a level 99 healer uses it on a level 99 target.
If you want multiple tiers of healing spells that unlock over the course of the game, I strongly recommend simply adding a flat amount to each tier rather than increasing the effect of the healing stat.
is there a way of just making a spell flat-out heal a percentage of the target's hp? Like the tales' games healing items always heal 30%.
The biggest problem with that however is that it's best for a consumable item rather than a spell, as the spell or skill would make the relevant stats useless. It scales, but at the cost of never being able to grow.
The biggest problem with that however is that it's best for a consumable item rather than a spell, as the spell or skill would make the relevant stats useless. It scales, but at the cost of never being able to grow.
"b.mhp * 3 / 10" will do it.
But why do you request something and then say it's as a problem? If you want a healing spell to be dependent on a caster's attribute, then you can't also want the spell to always heal X% HP.
But why do you request something and then say it's as a problem? If you want a healing spell to be dependent on a caster's attribute, then you can't also want the spell to always heal X% HP.
All this talk of % based healing makes me think back to Final Fantasy Legend 3 (actually a SaGa game but whatevs) where Cure 1 / A healed 29.59% of your max HP, Cure 2 / B healed 59.59% of your HP, and Cure 3 was a full heal. Why it wasn't just a flat 30/60% was beyond me (and yes I was bored enough as a youngster to go calc it out).
Anyways, to stay on topic, what if you had a combination of healing based off max HP% as well as a boost from the stat, spejoku? That way you're guaranteed to heal at least X% amount of their health, but better stats still = more healing.
Anyways, to stay on topic, what if you had a combination of healing based off max HP% as well as a boost from the stat, spejoku? That way you're guaranteed to heal at least X% amount of their health, but better stats still = more healing.
I also didn't know that ** was for exponents :o
Though, I'm hesitant to use that formula as it is very attack focused. The points in defense have diminishing returns as illustrated by JosephSeraph's post.
Meanwhile, points in attack have the opposite relationship which is not surprising because exponents tend to do that.
Given this mismatch, any defensive strategy that relies on a defense stat is going to be a fool's game. Any offensive gap in attack/defense stats is going to result in heavy punishment while on the defensive end, one will have to strive to hit that sweet spot where their efforts are still worth it.
That's not to say that it can't be used in a game; with care, it may work out well. I think it would take some skill to do, though, and the relationship will ultimately be rather limiting.
Though, I'm hesitant to use that formula as it is very attack focused. The points in defense have diminishing returns as illustrated by JosephSeraph's post.
author=JosephSeraph
64 atk < 00 def = 256 ( straight 64 * 4 )
64 atk < 64 def = 128
64 atk < 128 def = 102
Meanwhile, points in attack have the opposite relationship which is not surprising because exponents tend to do that.
author=JosephSeraph
16 atk < 16 def = 32
32 atk < 16 def = 85
64 atk < 16 def = 204
Given this mismatch, any defensive strategy that relies on a defense stat is going to be a fool's game. Any offensive gap in attack/defense stats is going to result in heavy punishment while on the defensive end, one will have to strive to hit that sweet spot where their efforts are still worth it.
That's not to say that it can't be used in a game; with care, it may work out well. I think it would take some skill to do, though, and the relationship will ultimately be rather limiting.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Diminishing returns in Defense but not Attack actually makes a lot of sense, especially in games with enemy-player parity (which means that enemies and players act in similar ways, which is the case for example in Pokemon, Shin Megami Tensei, Fire Emblem, or Final Fantasy Tactics). The rate at which attack increases has to compete with the growth of both HP and Defense - two stats that both increase as the game goes on. HP and Defense are effectively multiplied together to calculate how long a character can survive, while attack stands on its own, so it has to increase at close to the same rate as the other two stats multiplied together.
Now, if your enemies and heroes grow in totally different ways, then that might not be true. For example, in several games, I've kept enemy defense the same across the entire game, and only increased their HP, as it simplifies the rate of increasing the player's attack stat. But at the very least, the player's HP and defense are almost certainly both increasing, so enemy damage has increase at a much more rapid rate than player defense to keep up. You can either handle this faster curve in the damage formula, or in the amount of attack power you give to enemies.
All this stuff about the attack stat obviously also applies to the magic stat, for the same reason. If your magic stat is also used for healing, and you want enemies and players to use the same stats and the same formulas, this gets messy.
Now, if your enemies and heroes grow in totally different ways, then that might not be true. For example, in several games, I've kept enemy defense the same across the entire game, and only increased their HP, as it simplifies the rate of increasing the player's attack stat. But at the very least, the player's HP and defense are almost certainly both increasing, so enemy damage has increase at a much more rapid rate than player defense to keep up. You can either handle this faster curve in the damage formula, or in the amount of attack power you give to enemies.
All this stuff about the attack stat obviously also applies to the magic stat, for the same reason. If your magic stat is also used for healing, and you want enemies and players to use the same stats and the same formulas, this gets messy.
What worries me is that there are two opposite curves. If it was one or the other, there would be a larger 'reasonable' area. With both, the numbers can get very silly very quickly.
It will work well as long as enemy defense is approximately equal to allied attack. There can even be enemies with relatively high or low stats. However, if the player is not very near the strength level the enemies are intended for, they outclass or are outclassed very quickly. It makes balancing the environment level much harder than it needs to be. Meanwhile, the problem that it solves seems better handled in ways that don't create new problems, such as the methods you suggested. Thus, while I can see it working, it seems limited to games where the developer has a tight reign on what the player will be seeing at any given moment.
I've always seen the HP/Def distinction as a way to mix up how players interact with enemies. Some are best approached with slow, powerful attacks while others are better taken down with a flurry of quick strikes. Perhaps that's flavoring how I see this as such a system would be much more complex to implement.
It will work well as long as enemy defense is approximately equal to allied attack. There can even be enemies with relatively high or low stats. However, if the player is not very near the strength level the enemies are intended for, they outclass or are outclassed very quickly. It makes balancing the environment level much harder than it needs to be. Meanwhile, the problem that it solves seems better handled in ways that don't create new problems, such as the methods you suggested. Thus, while I can see it working, it seems limited to games where the developer has a tight reign on what the player will be seeing at any given moment.
I've always seen the HP/Def distinction as a way to mix up how players interact with enemies. Some are best approached with slow, powerful attacks while others are better taken down with a flurry of quick strikes. Perhaps that's flavoring how I see this as such a system would be much more complex to implement.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
In games with a subtractive defense formula (damage = attacker.atk - target.def), the interaction between HP and defense is as you describe. If an enemy has high defense, you need more powerful blows to take it down; weak characters/skills will deal vastly less damage, while strong characters/skills will only be slightly hindered. This can lead to situations where certain characters/skills deal no damage. Often this is exactly what designers what, but just as often they want to avoid this.
When designers don't want that, they use a divisive defense formula instead (damage = attacker.atk / target.def). With this type of formula, if you do twice as much damage to one enemy, you'll do twice as much damage to any other enemy also. The interaction between HP and defense becomes much simpler: HP helps you survive both physical and magical skills, while defense only helps you survive physical skills. This would seem to make HP better than defense, but having HP instead of defense also makes a character harder to heal. Most novice players find this to be an easier system to understand; if an enemy has high physical defense, they switch to magic, instead of micromanaging their stats.
Many games apply a multiplier or exponent to one stat or the other, add a base amount of damage to all attacks, or multiply the final result, but they are still essentially using one of those two basic types of defense formulas.
It's also possible to use a hybrid of the two formulas, basically by taking the two formulas and adding them together. This accomplishes the bit about strong blows working better on highly defensive enemies, but prevents anyone from ever getting enough defense to take zero damage.
When designers don't want that, they use a divisive defense formula instead (damage = attacker.atk / target.def). With this type of formula, if you do twice as much damage to one enemy, you'll do twice as much damage to any other enemy also. The interaction between HP and defense becomes much simpler: HP helps you survive both physical and magical skills, while defense only helps you survive physical skills. This would seem to make HP better than defense, but having HP instead of defense also makes a character harder to heal. Most novice players find this to be an easier system to understand; if an enemy has high physical defense, they switch to magic, instead of micromanaging their stats.
Many games apply a multiplier or exponent to one stat or the other, add a base amount of damage to all attacks, or multiply the final result, but they are still essentially using one of those two basic types of defense formulas.
It's also possible to use a hybrid of the two formulas, basically by taking the two formulas and adding them together. This accomplishes the bit about strong blows working better on highly defensive enemies, but prevents anyone from ever getting enough defense to take zero damage.
The formula I posted is not as exponential as some here seem to think. It's true that attack is squared in the formula, but attack is also placed in the divisor.
If enemy defense is zero, 4 * a.atk ** 2 / (a.atk + b.def) is equal to 4 * a.atk * a.atk / (a.atk) which is equal to 4 * a.atk. So, if an enemy has zero defense, each point of attack gives you four points of damage, exactly the same as the default Ace formula. Actually, the default formula will almost always give you four points of damage per attack, the only exception is if the enemy's defense is more than twice your attack at which point you deal no damage in either case. With my formula, you get four points of damage or less per attack, never more.
16 atk < 16 def = 32
32 atk < 16 def = 85
64 atk < 16 def = 204
16 atk to 32 atk yielded 85/32 = 2,66 times the damage and 32 atk to 64 atk yielded 204 / 85 = 2,4 times the damage.
Let's see what happens if we use the default formula instead.
16 atk < 16 def = 32
32 atk < 16 def = 96
64 atk < 16 def = 224
Here 16 atk to 32 atk yields 96 / 32 = 3 times the damage and 32 atk to 64 atk yields 224 / 96 = 2,33 times the damage.
Those results are rather similar.
If attack and defense are equal, both formulas yield the same result. However, if you then change either one of those, with my formula the damage will be closer to what you get with equal attack and defense than it will with the default Ace formula.
Contrary to what the attack squared part may indicate, my formula does not yield more extreme results than the default one. In fact, I designed it for the opposite purpose, to yield less extreme results. It's just that the attack squared part may look scary if you don't realize what having attack also placed in the divisor does.
If enemy defense is zero, 4 * a.atk ** 2 / (a.atk + b.def) is equal to 4 * a.atk * a.atk / (a.atk) which is equal to 4 * a.atk. So, if an enemy has zero defense, each point of attack gives you four points of damage, exactly the same as the default Ace formula. Actually, the default formula will almost always give you four points of damage per attack, the only exception is if the enemy's defense is more than twice your attack at which point you deal no damage in either case. With my formula, you get four points of damage or less per attack, never more.
16 atk < 16 def = 32
32 atk < 16 def = 85
64 atk < 16 def = 204
16 atk to 32 atk yielded 85/32 = 2,66 times the damage and 32 atk to 64 atk yielded 204 / 85 = 2,4 times the damage.
Let's see what happens if we use the default formula instead.
16 atk < 16 def = 32
32 atk < 16 def = 96
64 atk < 16 def = 224
Here 16 atk to 32 atk yields 96 / 32 = 3 times the damage and 32 atk to 64 atk yields 224 / 96 = 2,33 times the damage.
Those results are rather similar.
If attack and defense are equal, both formulas yield the same result. However, if you then change either one of those, with my formula the damage will be closer to what you get with equal attack and defense than it will with the default Ace formula.
Contrary to what the attack squared part may indicate, my formula does not yield more extreme results than the default one. In fact, I designed it for the opposite purpose, to yield less extreme results. It's just that the attack squared part may look scary if you don't realize what having attack also placed in the divisor does.
also also, have you guys considered not having a defense stat at all? HP is your defense.
Make a game now with only 3 stats: Level, HP, and Agility.
Make a game now with only 3 stats: Level, HP, and Agility.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
That could easily be functional, but the point of stats is to make different characters good at different things, and you would lose a great deal of that in such a game. You could still give different abilities to different classes/characters, but any skill that two people had, they would be equally good at. You could get around this with passive effects like "Fire Damage +20%" and "Provoke Accuracy +50%" but at that point why would you not have stats instead? Stats can be any number instead of just being on or off. It'd be cheating anyway. And it would be extremely ill-advised to make a game with only level/HP/agility where the player has free customization of which characters learn which skills. You would have no way to emphasise that certain skills should go together, or to encourage the player to make different builds, or to make certain skills be better for tanks or better for healers.
Also, you don't actually need agility if your party and the enemy party take turns attacking as groups. Your whole party attacks in whatever order you want, then the enemies all get their turns, like in Disgaea or Fire Emblem. You can get away with just level and HP.
Actually level is optional too; damage/healing can just be set per skill. You won't really have an RPG when you're done though. You'll have a turn-based, menu-driven fighting game.
Also, you don't actually need agility if your party and the enemy party take turns attacking as groups. Your whole party attacks in whatever order you want, then the enemies all get their turns, like in Disgaea or Fire Emblem. You can get away with just level and HP.
Actually level is optional too; damage/healing can just be set per skill. You won't really have an RPG when you're done though. You'll have a turn-based, menu-driven fighting game.
author=Lockez
When designers don't want that, they use a divisive defense formula instead (damage = attacker.atk / target.def). With this type of formula, if you do twice as much damage to one enemy, you'll do twice as much damage to any other enemy also. The interaction between HP and defense becomes much simpler: HP helps you survive both physical and magical skills, while defense only helps you survive physical skills. This would seem to make HP better than defense, but having HP instead of defense also makes a character harder to heal. Most novice players find this to be an easier system to understand; if an enemy has high physical defense, they switch to magic, instead of micromanaging their stats.
I mostly understand, but I think there are some common assumptions about magic here that I'm not catching onto (unless MDF does not correlate with DEF, which is essentially an elemental system with physical and magical as elements). I fully support divisive systems, but it turns out I misread the formula and have been railing against a non-existent monster q_q
author=Crystalgate
If attack and defense are equal, both formulas yield the same result. However, if you then change either one of those, with my formula the damage will be closer to what you get with equal attack and defense than it will with the default Ace formula.
Contrary to what the attack squared part may indicate, my formula does not yield more extreme results than the default one. In fact, I designed it for the opposite purpose, to yield less extreme results. It's just that the attack squared part may look scary if you don't realize what having attack also placed in the divisor does.
The behavior of attack is pretty normal, as you demonstrated. I was mistakenly reading it as (4atk)^2 rather than 4atk^2, which made it very, very different.
The rest of this is relatively unimportant, just things I did to make sure I wasn't crazy.
Adding points to defense has a negative curve. Note that (4atk^2/(atk*def)) yields:
author=JosephSeraph
64 atk < 00 def = 256 ( straight 64 * 4 )
64 atk < 64 def = 128
64 atk < 128 def = 102
whereas the default formula (4atk-def) yields:
author=me
64 atk < 00 def = 256
64 atk < 64 def = 192
64 atk < 128 def = 128
The value of each point of defense drops off drastically compared to the subtractive formula, but when compared to a divisive formula, it is pretty normal:
An exponential curve on defense...
author=me
64 atk < 1 def = 256
64 atk < 64 def = 4
64 atk < 128 def = 0.5
...and a pretty stable line on offense for a total of 1 exponential curve.
author=meThat curve being a feature in that it ensures an offensive game rather than armor stacking.
1 atk < 64 def = ~0
64 atk < 64 def = 4
128 atk < 64 def = 8
When properly read, CG's formula is less punishing at low def values and everything everyone has been saying makes more sense.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
4atk^2/(atk*def) is just 4atk/def. You can simplify that shit.

















