What damage formulas do you use?

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
674
First Language
English
Primarily Uses
N/A
What you're describing is really only applicable when you're choosing between equivalent but different things, which is atypical.
For a simple example in genre, let's say I have Attack, Smash, Fire, and Absorb as my only attacks and there are four different enemies in this boss encounter. How do I figure out how much damage I'll deal? It's already hard enough to figure out when damage is simple (atk - def or some variant thereof) because that requires hitting all four, likely with Attack, to find their defenses. Is Smash a simple double damage or does it throw in a a.mp + 2 ^ (a.agi/b.agi) in there somewhere? Have I seen that absorb is elemental, or is it a complicated use of a.def * b.luk - (b.level - a.atk)? As I pointed out in Pokemon and has shown up in Final Fantasy, I largely don't know how much damage I'll do, I just don't usually have to care due to how easy those games are (by the end of many FFs, I'm not keeping much track of damage numbers as much as the digits of numbers).
That doesn't diminish my ability to understand how much damage I'll do
That's where I get confused. I absolutely don't understand how much damage I'll do in the well known series of the genre, let alone lesser known ones. It's actually something I really like about games made in rpg maker is I can figure out how much damage I'll do and understand how much of a difference this atk+3 accessory is worth over the def+2 one.
I get away from this within my skills by making damage formulae that scale with my stats, so a given spell is viable at all levels. That means the strategy is in choosing between different damage-per-mana efficiency (which is easily described without showing the formula), or in whether you need a particular element or effect.
And this in turn makes it more important to understand what your skill does and be able to have a good guess when making your choice. Now, if the damage shown is based on who you are targeting, then that solves some of the problem because midbattle you can have more the info required to make your choices.
 

overlordmikey

BroCo. Gaming
Veteran
Joined
Sep 2, 2015
Messages
277
Reaction score
518
First Language
English
Primarily Uses
N/A
At the risk of being the boring pleb I am, where is the best place to learn about Damage Formula's because I doubt you all popped out of the womb understanding all this and I kinda get SOME of it, but I still feel out of my element.
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
674
First Language
English
Primarily Uses
N/A
where is the best place to learn about Damage Formula

This helped me a lot.


This is the one on the site.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
2,076
Reaction score
1,739
First Language
English
Primarily Uses
RMMV
Now, if the damage shown is based on who you are targeting, then that solves some of the problem because midbattle you can have more the info required to make your choices.
This should be standard practice imo. I know it's not, but it would be really nice if most games showed the exact amount of damage each skill does. All the dev has to do is include the formula in the skill's description. I mean, not necessarily write out the formula for the player to see, but have the tooltip do an eval that accounts for the player's stats so the player can see how their gear is affecting their dmg output.

For the record, per the OP, my default formula is:
atk * Math.log10(atk) * Math.log(1 + Math.pow((atk / def), 2)) / Math.log(2)
That formula looks eerily familiar...I don't remember where I've seen it before, but I'm sure I've seen something similar somewhere. What's the logic behind your formula, if I may ask.

Edit: I actually just plugged in stats using your formula and the results I got were surprisingly close to the formula I use! One difference is that your's does a bit more dmg early game but a bit less dmg late game compared to mine. Another is that mine seems to be far more sensitive to the target's DEF than yours. I dare say DEF may be undervalued in your game, while DEF is overvalued in mine. This makes me want to look into a formula for a happy in-between.
 
Last edited:

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
674
First Language
English
Primarily Uses
N/A
This should be standard practice imo. I know it's not, but it would be really nice if most games showed the exact amount of damage each skill does.
It's odd to me how many things are commonplace in TRPGs are almost unheard of in other rpgs. Being able to see damage, being able to see enemy stats, fully detailed explanations of what a skill does, some even telling me what the enemy plans to do, I feel like all of this would help regular rpgs a lot. Final Fantasy Mystic Quest has the enemy use different sprites at different HP thresholds, letting you have a much better guess of their HP.

Oh, because it's related to the topic, I turn off damage variance at low numbers and I don't even always have it at higher numbers. At low numbers the variance can mean a lot (even 1 more or less damage can utterly change things) and it's another way to help the player know how strong the enemy is. Some variations are also huge; A +/-20% variation means the high damage is 50% more than the low damage (120 is 50% more than 80).
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
2,076
Reaction score
1,739
First Language
English
Primarily Uses
RMMV
Regarding damage variance...the default RM values (±20%) are just way too high. I use ±10% for damage skills and ±5% for healing skills. Even then, I sometimes feel that's still too much variance, especially since I'm making a Tactical RPG. Some may even argue I ought to use 0% variance.
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
674
First Language
English
Primarily Uses
N/A
Even then, I sometimes feel that's still too much variance, especially since I'm making a Tactical RPG. Some may even argue I ought to use 0% variance.
I can't say I've seen a TRPG where the damage variance seemed even neutral, let alone good. That was one of my biggest issues with FFTA and FFTA2. Even Shining Force back in the day was odd with damage variance. I feel like there being the chance of critical attacks is already plenty variance (I can't tell you how many times I didn't want to crit in Fire Emblem). For a regular rpg, I find if you're using big numbers that 2% gives enough of a change in numbers that you always feel like you're seeing different things while small enough that damage is still reliable.

Mind, that's random variance. Non-random variance (such as zodiac signs in FFT, the weapon triangle in fire emblem, and certain actions affecting how much damage you'll take) absolutely seem good if you can see the results of them.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,841
Reaction score
1,776
First Language
English
Primarily Uses
RMMV
I've pretty much been using the same formula since day 1, and it's worked well for me (I think!):

Code:
userStat * userMod / (1 + targetStat * 0.01)

So a spell might look something like this:

Code:
a.mat * 4 / (1 + b.mdf * 0.01)

It's an overall pretty simple formula that's easy to adjust and balance around. Plus, when the player looks at an ability's description, all I really need to do is show them the modifier (4 in the example) and they'll be able to easily see how strong that skill is in relation to, say, another skill with 3. 5. 8. etc.

Also, being entirely multiplicative means you don't get dumb stuff like an armored character taking 1 damage while the mage in magical toilet paper gets splattered by that same attack for like 200 damage. The warrior's still going to take a lot less damage, but the differently won't be stupidly varied.
 

micoomer

Villager
Member
Joined
Apr 24, 2019
Messages
24
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
Simple and easy to balance formula for me:

Value = (a.atk / b.def) * Attack Value * Modifier

The problem with atk - def formula is often your damage input become zero, if you're attacking target with high defense, not to mention someone with defense buff will have high advantage and I see that alot in other game (even on AAA game) and that was really awful.
Dev should take more attention on damage formula.
 

RicardoxRyu

Villager
Member
Joined
Jun 25, 2020
Messages
7
Reaction score
0
First Language
Indonesia
Primarily Uses
RMMV
I was using a lot of things depends on the skill. For damaging skills, if damage is element, I use luk stats to act like element parameter for element damage

a.atk * modifier + a.luk * b.elementRate(x) - b.def * modifier

x is enemy resistance to element

When the target is strong to the element, defense will bring the damage to really close to 0, but also work otherwise.
 

Pots Talos

Veteran
Veteran
Joined
Jun 28, 2012
Messages
175
Reaction score
173
First Language
English
Primarily Uses
RMMV
I use the action sequence note box to run a common event which handles all the damage calculations and returns them as variables for use in the damage formula.
So my basic attack damage formula is this:

if ($gameSwitches.value(162) == true) {v[20]} else {if (v[261] >= b.ac) {v[20]} else {v[267]}}

Switch 162 is if it was a critical hit or not. Variable 20 is full damage and variable 267 is a graze. Variable 261 is attackers attack roll to see if it breaks targets armor class.

My basic magic damage formula is a little more complicated because damage can be halved or negated completely based on various factors, like reflex saves.

if (target.isStateAffected(419)) {if ((10 + a.level + a.intm + a.spelldc) > (v[106] + b.ref)) {v[120] + a.intm} else {0}} else {if ((10 + a.level + a.intm + a.spelldc) > (v[106] + b.ref)) {v[120] + a.intm} else {Math.ceil(v[120] + a.intm) / 2}}
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,842
First Language
English
Primarily Uses
RMVXA
Simplicity is good in Damage Formulas, but Consistency and Clarity are even more important. There are ways to achieve all of these at once.

In one of my games I use this damage formula for all skills:
a.atk * [[skill power]] / (10 + b.def)

This formula has several advantages:
  • Every point invested in ATK or DEF will increase the amount of damage done, or number of hits that can be survived, by the same amount - making it easy to understand for both the player and designer
  • Using only a single ATK and DEF stat, and a visible Skill Power amount, also makes it very clear to the player why a skill is or isn't doing much damage to an enemy (and also allows the player to compare Skills with different Powers - a 40 power skill will deal exactly twice as much damage as a 20 power skill)
  • The multiplicative nature of the formula handles cases of large stat imbalances much more gracefully than additive formulas; for example, a skill will never do 0 damage and it's very very rare that it would only do single-digit damage, even against a very high-DEF foe
  • The lack of a "base value" on a skill (e.g. 100 + a.atk * 2 - b.def) means that skills can keep scaling with the user's ATK throughout the game, meaning that you don't need to keep giving the player new versions of a skill in order to keep it relevant against moves like Basic Attacks
One disadvantage of the above formula is that damage dealt by a skill will be pretty similar whether it's a user with 50 ATK and a target with 50 DEF, or a user with 500 ATK and a target with 500 DEF. This makes things easy to balance, but it also means that battles will start taking longer and longer if you have HP values also increasing throughout the entire game. To compensate for this in games that last more than a couple hours, I recommend changing the formula to something like:
a.atk * (10 + a.level) * [[skill power]] / (10 + b.def)

This wrinkle will allow the damage to scale up through the game at a fairly similar rate to Max HP, which allows you to keep the pace of battles pretty similar even throughout a long game.


In one game I'm making, I've simplified the stats system even further, with only Max HP, Max MP, Power (ATK), and Speed (AGI) as battler stats. With that, I was able to use the incredibly simple damage formula of:
a.atk * [[skill power]]
and because ATK is scaling throughout the game in a similar fashion to Max HP, the pace of battle remains consistent throughout. The formula makes things far clearer and easier to understand than even my relatively good formulas above, because skills (sans a bit of random Variance) will always deal the same amount of damage to all enemies - with large Max HP being the very obvious way to create "tanky" enemies rather than high DEF values which tend to distort the damage values.
 

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,492
Reaction score
664
Primarily Uses
@Aesica I tend to use smaller numbers so I'm not sure how that would work, but for regular medium levels of numbers, I did a few quick mental calculations and I REALLY like that formula. Does a very good job of reaching that middle ground where the defensive stat in question remains significant but not game-breaking. Thanks for sharing!
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
2,076
Reaction score
1,739
First Language
English
Primarily Uses
RMMV
The negative formulas are blank because I only recently changed to the current formula I'm using so I haven't figured that part out yet, heh.
Turns out I can just use the same formula for negative armor lol. It scales just fine. I really like how this formula gives greater value to defensive stats compared to most formulas. It's helped make buff-type spells in my game much more appealing to use!
1627843171171.png
 

Thefirelion

TheFireLion Game Studio
Veteran
Joined
Mar 25, 2017
Messages
150
Reaction score
47
First Language
Spanish
Primarily Uses
RMVXA
I choose:
a.atk - b.def for the basic physical attack.

base damage + a.mat - b.mdef for magic skills.

However, this changes depending on the skill concept.

Starting low numbers works fine for me.
 

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
922
Reaction score
674
First Language
English
Primarily Uses
N/A
One disadvantage of the above formula is that damage dealt by a skill will be pretty similar whether it's a user with 50 ATK and a target with 50 DEF, or a user with 500 ATK and a target with 500 DEF. This makes things easy to balance, but it also means that battles will start taking longer and longer if you have HP values also increasing throughout the entire game.
That has a fairly simple solution in my head of just not having defense and attack scale at the same speed in leveling (and even equipment). Or basically, have HP go up at a rate based on the rate difference between attack and defense so you can see bigger numbers as you level while keeping a similar amount of hits.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,841
Reaction score
1,776
First Language
English
Primarily Uses
RMMV
@Aesica I tend to use smaller numbers so I'm not sure how that would work, but for regular medium levels of numbers, I did a few quick mental calculations and I REALLY like that formula. Does a very good job of reaching that middle ground where the defensive stat in question remains significant but not game-breaking. Thanks for sharing!
You'd have to adjust the defense multiplier (0.01 -> 0.1, or something similar) but other than that it should work just as well with bigger numbers as with smaller numbers
 

freakytapir

Veteran
Veteran
Joined
Jun 13, 2014
Messages
93
Reaction score
70
First Language
English
Primarily Uses
RMMV
So yeah, maybe late to the Party, but here's what I use:
a.Stat1*a.Stat2/b.Stat3

With each Weapon or skill type having a unique damage formula

So a longsword would be a.atk*a.agi/b.def
A fire spell is a.mat*a.atk/b.mdf
A fire sword attack would be a.mat*a.atk/b.def

The used stats are given by symbols in the weapon/skill description, so if a player find a new weapon, they immediately know what helps them. All weapons also raise their associated stats, as an extra 'Hint'.
"Oh, this poison dagger uses Agility and Pharmacology, is that better than the Agility and Crit Chance dagger I have?" (No weapon's a straight upgrade in my game.)

Everything's grouped by theme off course. All Daggers use Agility in some way, all Hammers use Max HP as an attack stat...

Wait HP? How don I make that work? Well, it's not HP%, it's 'How much more Maximum HP does this character have in comparison to a character of his Level.' This if course requires me to use carefully controlled HP formulas so I can slot the into damage formulas.
Pharmacology and such are also rescaled to "Attack stat of this level times the PHA %"
So if a character at level 10 would have, for example an average attack stat of 30, then a Pharmacology of 130% would count as an attack stat of 39

I like the formula because it keeps the relation between Damage and Stats linear. Defensive numbers are in the same range as the Offensive ones, so usually the damage formula plays out like this:

I Have 30 Attack, and 30 Agility, so My longsword deals 30 damage against an enemy with 30 Defense. (30*30/30=30)
Now, if I raise my Attack by one, my Damage goes to 31*30/30 so now it's 31.
So far so good. It performs like a.atk-b.def would if you used an attack state twice the defense stat. (Or a sum of two stats)
But now, if I double my attack, my Damage against the same enemies also doubles. (60*30/30)
If I used a.atk-b.def, I would have tripled my damage. (Assuming ATK scaled twice as fast as Defense) By going from 60-30 to 120-30. I don't want that.

It also play nice with debuffs. Halve the enemy defense? Great, you deal double damage. Double your own defense? You take half.

Stat growth is about 10 % per level, so I know just how much being up or down a level means.

An interesting side effect is that boosting two different stats works out better than just boosting one twice. 125%*125%>150% after all. Makes even obscure buffs worth considering.
"All right, If I boost Agility, I'll boost the Wind user and Rogue, but If I boost defense, The earth mage and Bashing Shield user will be happy."

It also means that the player can calculate the damage quite fast. If he has an ATK of 35 and an AGI of 30, he can pretty much assume he'll be doing Between 35 and 30 Damage with an AGI and ATK ability against an average enemy of his level. (I also precalculate this damage in the tooltip).

It means that if the player sees '15 Damage' When he expected 30, he knows he's attacking the wrong defensive stat.
"'Ice blast' didn't do that much, but he's not resistant to ice, maybe I should use 'Ice Sword' instead, that hits DEF."

Another reason to tie every attack to two stats is so that more stat debuffs become relevant.
"Oh, they lowered my attack? So now my fire magic is worse, but not my Ice magic. That's off of MDF and MAT, but he's weak to lightning, though, maybe I should use that instead ..."
But yeah, that's just my way of doing it.
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
101
Reaction score
57
First Language
German
Primarily Uses
RMMV
I used these formulas for basic attacks:
  • Game Master: a.atk/(1+0.1*b.def)
  • Game Master Plus: Math.max(a.atk-b.def,a.atk/2,1)
  • LV99: Final Fortress: a.atk+a.atk*100*(1+a.mp/100)/b.def
  • Wildsilver Demo: a.atk**2/(b.def+a.atk)
Skills usually just add a multiplier to that.
 

G-G-Games

Villager
Member
Joined
Jul 26, 2021
Messages
20
Reaction score
12
First Language
English
Primarily Uses
RMMV
Oh, because it's related to the topic, I turn off damage variance at low numbers and I don't even always have it at higher numbers. At low numbers the variance can mean a lot (even 1 more or less damage can utterly change things) and it's another way to help the player know how strong the enemy is. Some variations are also huge; A +/-20% variation means the high damage is 50% more than the low damage (120 is 50% more than 80).
Regarding damage variance...the default RM values (±20%) are just way too high. I use ±10% for damage skills and ±5% for healing skills. Even then, I sometimes feel that's still too much variance, especially since I'm making a Tactical RPG. Some may even argue I ought to use 0% variance.
It seems to me that including variance in damage allows even small improvements in damage output to sometimes reduce the number of hits needed to defeat an enemy, leading to a smoother feeling of character progression.

Suppose an enemy has 70 HP and a character at level 1 does 50 damage, at level 2 does 60 damage, and at level 3 does 70 damage.

Without 20% variance*:
  • Level 1 -> 2 hits
  • Level 2 -> 2 hits
  • Level 3 -> 1 hit
With 20% variance*:
  • Level 1 -> 2 hits
  • Level 2 -> 1 hit (12% of time), 2 hits (88% of the time)
  • Level 3 -> 1 hit (52% of the time), 2 hits (48% of the time)
*Assuming the +/- 20% is a flat distribution, with each numerical value inside the range being equally likely. This way 60 +/- 12 = 70 or higher from +10, +11, or +12 of the 25 possibilities (including +/- 0).

Finding a new weapon or learning a new skill could result in a more significant jump in damage output, but my personal feeling is that levels should result in a more gradual sense of progression (beyond seeing the numbers go up).
 

Latest Threads

Latest Posts

Latest Profile Posts

So this is... a thing.
A little something I've been working on... :kaosigh:
GoArOw1.png
This is a lot of fun
Posted some halloween freebies! Grab them while on season :kaopride:
hallow_cat.png
So my birthday was about a week ago! Just forgot to post it. I went to a Golden Corral, and it was soooooo good! :kaojoy: I also got some Animal Crossing in my life! Yay, Animal Crossing!

Forum statistics

Threads
116,148
Messages
1,096,187
Members
151,576
Latest member
KillerCotton
Top