I don't understand Damage Formulas

I was looking at this topic


But I still don't understand. I would like to know which part I can input and change numbers with. Like, if I want a strong attack, what if I just put 300 there and no formula? Does having a formula generate random damage?
It *can* generate random damage if you want to.

If you just put 300 into the box, the skill will always deal 300 damage.

The point of the damage formula primarily is to deal damage based on the parameters of the attacker and defender. You can also do more advanced stuff with crazy formulas (like in the thread you linked in your post), but it seems like you should get acquainted with the basics first.

For example:

a.atk - b.def

a = user (the character who uses the ability)
b = target (all characters affected by the ability)

This would deal damage equal to the attack of the attacker minus the defense of the defender.
So if your character has 20 attack and your target has 15 defense, the skill would deal 5 damage.

You can hover your mouse over the formula box to see more infos on that.

formulabox.png


The problem with just putting 300 damage into the formula box is that this skill will ALWAYS deal 300 damage. Whether your character is level 1 or 100, whether the enemy has high defense or no defense at all. Always 300 damage.

As such, it is very difficult to balance since 300 damage could be extremely powerful at the beginning of a game but almost useless at the end of the game.
Damn! Got beaten to it. 😀 @ScorchedGround pretty much nails it. What helped me was realizing that it is just a basic match equation.
Essentially what you are saying is a.atk(The attack stat of the "Attacker", the user of the attack/skill) *(times) 2 minus b.def (the defense stat of the "Defender", the enemy target) times 1.

so if your character has 10 attack and the enemy has 10 defense, you skill will deal 10 dmg because
10*2=20 - 10*1= 10 (you can remove *1 from the defense aswell since it's not doing anything)
If you see the screenshot provided you can then also do skill scaling with other stats than attack. Maybe your rogue has a skill that deals dmg based on his agility stat so the formula would look something like this:
a.agi *2 - b.def*1 so if your rogue has 50 agility and your enemy still has 10 def the math looks like this:
50*2 =100 - 10*1 =10. Effectively dealing 90 dmg. Basic math rules apply here aswell like multiply before addition and stuff in () comes first.
The formula never does random damage, it follows exactly what you put there. If you just put 300 as the damage formula, it'll always deal 300 damage. If you want a more randomised outcome, you assign a percentage value to the variance. Setting 5% variance on the 300 formula means the damage will randomly be between 285 and 315.
So if I want damage done around 300 for example, how would I set up ranged damage?

so if your character has 10 attack and the enemy has 10 defense, you skill will deal 10 dmg because
10*2=20 - 10*1= 10 (you can remove *1 from the defense aswell since it's not doing anything)

So the *1 in that formula is the enemy's defense stat. So whether it is 50, 22, 86 or 99, it will still be *1. (and not changing because multiplied by 1)

When you say your enemy still has 10 def is this a constant scenario example? Just clarying.

You guys have all done a great job explaining!

Edit: So for this Fire skill, 100 + a.mat * 2 - b.mdf * 2, they are adding 100 attack to the magical stat, correct?
Edit: So for this Fire skill, 100 + a.mat * 2 - b.mdf * 2, they are adding 100 attack to the magical stat, correct?

The 100 just gets added to the final damage value. It does not affect any stats of the characters.

Example:

You have 20 mat and your target has 10 mdf
The formula would look like this (Step-by-Step):

100 + a.mat * 2 - b.mdf * 2
> (The basic formula you proposed)

100 + 20 * 2 - 10 * 2
> (Here we fill in the characters stats -> 20 mat and 10 mdf)

100 + 40 - 20
> (Mathematics dictate that you resolve the multiplication " * " before the addition " + ")

100 + 20
> (The rest is a simple subtraction)

120
> Ayy, we got it

So the skill would deal 120 damage. But it would change if your characters had different stats than
20 mat and 10 mdf. That's the great thing about these formulas.


#1 You don't generally need the " * 1 " in your damage formulas (like a.atk * 1) but I like to do it for visibility sake, or rather for continuity sake, but you're right, it mathematically does not do anything.

#2 These kinds of formulas are great because your heroes grow stronger during your game and so their skills become stronger aswell. And in contrast, your foes become stronger just like the heroes.
Your abilites become much more dynamic and nice when they don't deal just 300 damage all the time but instead depend on the strenght of your character aswell as the defense of your enemies.
Yeah, they have eluded me as well so I am glad you took the time to explain it!

Original thread: https://forums.rpgmakerweb.com/threads/i-dont-understand-damage-formulas.130986/