[MV] - Game's damage formula - Thoughts?

I think I have finally decided on the damage formula I am going to use for my game. It is a low-powered game, so stats and HP are scale low. I am also using SRD_TimeAttacks to add in more variations and give combat something more inspired than click, wait, click, wait.

*This is all based on level 1 stats*​

Code:
Math.max(((a.level + 5) * (a.atk / a.mat) * (5 / (b.def / b.mdf))) * $gameTemp.tas_power, Math.floor(Math.random() * 3) + 1)
Explanation:

  • Math.max(..., Math.floor(Math.random() * 3) + 1): Ensures the damage is at least a random number between 1 and 3.
  • Math.floor(Math.random() * 3) + 1 generates a random number between 1 and 3.

Attacker Stats​

  • Level (a.level): 1
  • Attack (a.atk): 2
  • Magic Attack (a.mat): 3

Enemy Stats​

  • Defense (b.def): 100
  • Magic Defense (b.mdf): 120

Step-by-Step Calculation​

  1. Level and Constant Addition:
    • a.level+5=1+5=6a.level + 5 = 1 + 5 = 6a.level+5=1+5=6
  2. Attack to Magic Attack Ratio:
    • a.atka.mat=23≈0.67\frac{a.atk}{a.mat} = \frac{2}{3} \approx 0.67a.mata.atk=32≈0.67
  3. Defense to Magic Defense Ratio:
    • b.defb.mdf=100120≈0.833\frac{b.def}{b.mdf} = \frac{100}{120} \approx 0.833b.mdfb.def=120100≈0.833
  4. Inverse of Defense to Magic Defense Ratio:
    • 50.833≈6\frac{5}{0.833} \approx 60.8335≈6
  5. Combine Level, Attack Ratio, and Defense Ratio:
    1. 6×0.67×6≈24.126 \times 0.67 \times 6 \approx 24.126×0.67×6≈24.12

Worst Damage (worst timing, tas_power = 0)​

  • Worst Damage: Random value between 1 and 3 (1, 2, or 3)

Average Damage (average timing, tas_power = 0.5)​

  • Average Damage: 12.06

Best Damage (perfect timing, tas_power = 1)​

  • Best Damage: 24.12

Attacker Example Stats (Hero Lv.1)​

  • Level (a.level): 1
  • Attack (a.atk): 2
  • Magic Attack (a.mat): 3
  • Defense (a.def): 4
  • Magic Defense (a.mdf): 4
  • HP (a.hp): 30
  • Speed (a.spd): 50

Enemy Example Stats (Lv.1)​

  • Attack (b.atk): 2
  • Defense (b.def): 100
  • Magic Attack (b.mat): 3
  • Magic Defense (b.mdf): 120
  • HP (b.hp): 60
  • Speed (b.spd): 50
Since enemies will not have access to timed attacks their damage formula is going to be a little different to help keep them in line with Actor's damage.
Code:
Math.max(((b.level + 5) * (b.atk / b.mat) * (5 / (a.def / a.mdf))) * 0.5, Math.floor(Math.random() * 3) + 1)

Flipping the stats above results in the following damage for enemies to actors.

Worst Damage ​

  • Worst Damage: Random value between 1 and 3 (1, 2, or 3)

Average Damage ​

  • Average Damage: 6.03

Best Damage​

  • Best Damage: 12.06
Just a few observations:
Math.floor(Math.random() * 3) + 1
You could make life a little easier/shorter on yourself by using RPG Maker's Math.randomInt() function.
Code:
Math.randomInt(3) + 1
will produce a random number between 1 and 3, inclusive.

Attack to Magic Attack Ratio:
a.atka.mat=23≈0.67\frac{a.atk}{a.mat} = \frac{2}{3} \approx 0.67a.mata.atk=32≈0.67
I don't know the setting of your game or what the attacks represent, but just looking at it it seems odd that both attack and magic attack would factor into every hit. Logically, one would expect them to apply under discrete circumstances. Same for defense.

Unless you've changed the parameters to be, like, dexterity and power, or something like that.
I also find it odd that you are doing attacker's ATK divided by attackers MAT. That will penalize the player for getting more MAT in the end then, and actually encourage them to keep MAT low as possible.
Magic is rare in my game and while player get access to you early on, it isn't meant to be used every round. MP levels are low, which will help insensitive players to not just spam magic over and over - trying to make them be more tactical about how they use magic. So, I didn't want that stat to feel useless overall. However, I can see the flaw in the design with using division in this sense. I've made some adjustments that should help and keep the damage values around the same area I want them to be at.


Actor
Code:
Math.max(((a.level + 5) * ((a.atk + a.mat) / 8) * (5 / ((b.def + b.mdf) / 8))) * $gameTemp.tas_power, Math.randomInt(3) + 1)

Enemy
Code:
Math.max(((b.atk + b.mat) / 8) * (5 / ((a.def + a.mdf) / 4)) * 0.5, Math.randomInt(3) + 1)

*FIXED* - Enemies don't have levels. I am silly. This is why I posted here for review. Ope!
Actually if you add a plugin (or script if in ACE) that gives them levels it still can work. That's what I did. But it depends on how much that matters to your system if you want to go that route.
OMG! Something I love talking about. I'm so horny for damage formulas you have no idea. I've got a spreadsheet of the different damage formulas used in all sorts of different games. I like to just try them out and mix and match parts of the formulas to get varying results. I've been using a modified combination of RuneScape's and League of Legend's damage formulas for my project.

Lil snippet of mumbo jumbo from my spreadsheet:

SumatraPDF_0hkGh287OK.png
this is kind of a personal pet peeve, but why make the character's level itself a factor?
doesn't that take away from the stats that you can actually interact with and add importance to pure grinding?
so many RPGs do it and I don't get the appeal.
Magic is rare in my game and while player get access to you early on, it isn't meant to be used every round. MP levels are low, which will help insensitive players to not just spam magic over and over - trying to make them be more tactical about how they use magic. So, I didn't want that stat to feel useless overall. However, I can see the flaw in the design with using division in this sense. I've made some adjustments that should help and keep the damage values around the same area I want them to be at.


Actor
Code:
Math.max(((a.level + 5) * ((a.atk + a.mat) / 8) * (5 / ((b.def + b.mdf) / 8))) * $gameTemp.tas_power, Math.randomInt(3) + 1)

Enemy
Code:
Math.max(((b.atk + b.mat) / 8) * (5 / ((a.def + a.mdf) / 4)) * 0.5, Math.randomInt(3) + 1)

*FIXED* - Enemies don't have levels. I am silly. This is why I posted here for review. Ope!
I can't make sense of this at all.

Levels act as a MULTIPLIER for damage? Is there even a point quibbling over gear when level trumps all?

I don't understand why PCs have single digit def and enemies have 100 def. Even accounting for level, enemies are taking what, 6 times less damage? Do players have that much more max health and healing? How much def do you get from each piece of gear, because straight division is a lot of reduction.

The atk and matk relationship. I understand wanting matk to have a small influence on regular damage, but 1:1 equal contribution is not a "small" influence. A mage is literally as good at punching as a monk.

My understanding with making complex damage formulas is to balance out the different build specializations and advantages/disadvantages. But atk and def here are straight multipliers/divisors in all their unbalanced glory, and all of this is multiplied by a timed hits variable that is more important than everything else. What is the purpose of this formula?
I also find it odd that you are doing attacker's ATK divided by attackers MAT. That will penalize the player for getting more MAT in the end then, and actually encourage them to keep MAT low as possible.
Praise to the formulas!

Hmmmmmmmmmmmmmm... I usually don't critique people's game design, but I'm in full agreement with bg on this. Unless the game has a lore specific thing about magic reducing one's physical strength, especially if it's tied to the storyline itself, then has little to no reason to be in a game.

Besides that, it's functional. Praise be to the game make!



If the op or someone reading this is looking for inspiration on formulas, feel free to read some of mine. A fan created a few guides:

Physical: https://steamcommunity.com/sharedfiles/filedetails/?id=3236468283

Magical: https://steamcommunity.com/sharedfiles/filedetails/?id=3235742016
Levels act as a MULTIPLIER for damage? Is there even a point quibbling over gear when level trumps all?
This isn't too rare a concept. Pokemon and Final Fantasy 6 both do this, but they also use mostly multipliers and divisors in their formulae. I do agree it's weird and I usually go without it since level ALSO decided your base stats and thus it feels like double-dipping.

However, I'm just completely stumped looking at OP's formula. Maybe I'm reading the formula wrong but it looks like for enemy skills they get stronger as the target (b) gets stronger. I also am wary of games that punish you for failing Timed Attacks by making you do near 0 damage instead of something like half damage (like Super Mario RPG).
Just to put it out there, there is already a many-page damage formula thread that has a lot of sample formulae as well as the explanation of what the math accomplishes.


The formula I use came from here.
I also am wary of games that punish you for failing Timed Attacks by making you do near 0 damage instead of something like half damage (like Super Mario RPG).
@kirbwarrior - Timed attacks cannot be zero damage, anytime you perform any type of attack in the game you will always do some sort of damage, miss/evade, etc...

Just to put it out there, there is already a many-page damage formula thread that has a lot of sample formulae as well as the explanation of what the math accomplishes.
@ATT_Turan - Always with the swift and great answers as always!

this is kind of a personal pet peeve, but why make the character's level itself a factor?
doesn't that take away from the stats that you can actually interact with and add importance to pure grinding?
so many RPGs do it and I don't get the appeal.
@LordOfPotatos - I've removed levels are a factor.

**UPDATE**

Thanks for the feedback. I was trying something new and looks like it wasn't well received and after some more extensive testing I decided to change the formula altogether. It is much simpler and both Actors and Enemies stats are close aligned as well as removing levels from the process. I think the newer formula works much better. I will post it after work and seek more feedback.

Thanks everyone
Code:
Math.max(((a.level + 5) * (a.atk / a.mat) * (5 / (b.def / b.mdf))) * $gameTemp.tas_power, Math.floor(Math.random() * 3) + 1)
Wow, this formula is just overwhelming. I would've opted for something simpler, like a.atk - b.def.
Okay, I'm going to admit up front here:

I got partway through looking at the damage formula and my eyes glazed over. This is just a "Tai is stupid" thing. I skipped the rest of the formula and started looking at what you were trying to accomplish with it. I'm... not seeing what you're attempting to accomplish.

You state:
give combat something more inspired than click, wait, click, wait.

But, I don't see how this is doing that.

I'm also a little confused as to why you have massive stat inflations for enemies.

Further, we have some missing data:

Do you have "elements" in your game? These, by default, will also multiply damage or divide damage. So, now you're doing double multiplications/divisions for damage if you also have this feature.

Do you have "states" in your game? How useful are they? If you have a DoT, or a HoT, you'll now have to balance them around your damage (and how wildly that damage could vary from enemy to enemy based on what I'm looking at in this formula) output for your characters and your enemies.

I'm slightly concerned that this sort of formula will be too "complicated" for a player to understand. If they can't at least figure out to some small degree how/why damage is calculated, they might not know what stats are actually valuable in a piece of equipment (or even if that piece of equipment is even useful to begin with).

I can't say whether the formula itself is good or not. After all, you can design balance around basically any damage formula and find a way to make any formula/combat system fun. But, I wonder how easy it would be to maintain balance in your game. Like, how much of a stat shift would it take for a monster to one-shot someone in your party using this formula? Or, for your characters to one shot enemies/bosses? Or, worse, do such minimal damage that the fight is a waste of time?

You might be best served by created a list of 20 monsters of various stats and then using a spreadsheet to track at what points it takes fewer hits to kill a monster based on stat increases. After all, if a level up only gives me 3 Attack, and a weapon gives me 8 attack... a weapon/level up tends to be relatively useless if it doesn't reduce amounts of hits required to beat the enemy. If there's a 20-30 stat point increase requirement to get one fewer hit on an enemy, you might have a pretty big balancing problem on your hands with small stat gives.

I think what I'm looking for is "context" for your formula. It's hard to judge it or give you improvement ideas when we don't know what your goals with it are. What's the intended experience? Normal amount of damage you want to be done each round? Amount of damage taken? Amount of rounds per combat you want to normally be taken? On and on. Without context, then the best we can do is go, "If we threw it into a normal RPG like Final Fantasy or Dragon Quest, it would break that game", which isn't often useful to an individual game dev unless you're designing a FF or DQ game.

We need the full picture and what you are hoping to accomplish with the formula other than "the calculation for damage is complex".

Original thread: https://forums.rpgmakerweb.com/threads/mv-games-damage-formula-thoughts.169997/