Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Jeez, this subforum has been pretty silent as of late. Might as well find something to discuss lol. Anyways, I'm currently using Armor Scaling in my project, which is to say damage is reduced by a percentage amount with diminishing returns, scaled w/ DEF or MDF of course. Now, Yanfly's plugin gives the following formula by default:
value *= 100 / (100 + armor)

After I first started using this formula, I noticed the mitigation ramped down way too fast (at least for my project). By end game, my Heroes would have anywhere between 100-200 DEF, for example. The latter would mean only ~33% dmg is received. Even 100 DEF is already a 50% reduction! It's just too much too fast. My (simple) solution was to edit the formula to this:
value *= (100 + target.level) / (100 + armor)

So now, our Hero has to gain at least 1 DEF (or MDF) per level just to stay at the same % mitigation. But notice how I used "target" instead of "user". This is intentional since this way higher lv enemies take less damage while lower lv enemies take more. Levels range between 1-50 in my game btw.

I'm curious, what Armor system/mechanic do you guys use and why. If you also use Armor Scaling, do you use the default formula, or something else? What other disadvantages have you experienced using this mechanic, if any? Lastly, feel free to argue in favor of other armor/mitigation mechanics.

:rtea:
 
Last edited:

Redeye

Chronicles Creator
Veteran
Joined
Jun 21, 2013
Messages
458
Reaction score
307
First Language
English
Primarily Uses
Preventing Armor from scaling too quickly with your DEF is pretty easy. Either you make your game a small-numbers game where levels/equipment only give you 1-2 DEF apiece (maybe even have some levels give you nothing), or you can just divide the target.armor by a specific amount in the damage formula.

value *= 100 / (100 + (armor / 3)) would divide the value of DEF by 3, meaning that you'd now need 300 DEF in order to reduce incoming damage by half, which would be a pretty reasonable amount of DEF for endgame characters. I'm not too fond of having defense scale with your Level. If you want higher level enemies to take less damage than lower level ones, just increase their HP / DEF.

As for me, I like to throw in a second stat into the mix that deals with Armor Penetration. I typically name it "Focus" or "Dexterity" or something like that. The stat simply subtracts from the target's armor value. If the Armor Penetration is significantly higher than the target's Defense, then the attack may potentially INCREASE the amount of damage the target receives. It makes way for interesting "Tankbuster" skills that punish foes for building Defense. So the formula for a Tankbuster skill would be something like this:

value *= 100 / (100 + (target.DEF / 3) - (user.FOC / 5))
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,934
Reaction score
14,764
First Language
English
Primarily Uses
RMVXA
What I did was I put the calculation in my damage formula directly. That way I didn't have to worry about it. My overall damage formula was:

(a.atk + a.level) * (a.atk + strength of skill) / (b.def + 20) all times * 2 then + a.level.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
What I did was I put the calculation in my damage formula directly. That way I didn't have to worry about it. My overall damage formula was:
Ah, I did that before too, until I realized I could sub different things in for "armor" in Yanfly's plugin. In my case, I added conditionals to check for various elements present in the attack to decide if the defending stat used should be DEF, MDF, or (DEF+MDF)/2.
E.g.
For "Physical Base Armor": if (this.getItemElements().contains(4) || this.getItemElements().contains(5) || this.getItemElements().contains(6) || this.getItemElements().contains(7) || this.getItemElements().contains(8)) {(target.def + target.mdf) / 2;} else {target.def;}

For "Magical Base Armor": if ((this.getItemElements().contains(1) || this.getItemElements().contains(2) || this.getItemElements().contains(3)) && (this.getItemElements().contains(4) || this.getItemElements().contains(5) || this.getItemElements().contains(6) || this.getItemElements().contains(7) || this.getItemElements().contains(8))) {(target.def + target.mdf) / 2;} else if (!this.getItemElements().contains(4) && !this.getItemElements().contains(5) && !this.getItemElements().contains(6) && !this.getItemElements().contains(7) && !this.getItemElements().contains(8)) {target.def;} else {target.mdf;}

Lol, sorry for that wall of text/code. Basically, this lets me better utilize hybrid skills, such as "Frost Strike" (melee skill that also deals Weapon/Frost dmg).

(a.atk + a.level) * (a.atk + strength of skill) / (b.def + 20) all times * 2 then + a.level.
Btw, would you say that ATK & DEF are valued equally in your game? Or is one weighted more than another? Also @Redeye, the same question regarding your formulas as well. (i.e. Is 1 point of ATK worth as much as 1 point of DEF?)
 
Last edited:

Dr. Delibird

Also known as HRforges
Veteran
Joined
May 16, 2014
Messages
284
Reaction score
178
First Language
English
Primarily Uses
RMMZ
I decided to scrap DEF as a stat entirely in favor of having HP being the only defensive stat for both players and enemies. I like the idea of the player being able to see that their new sword does X amount of damage all the time (outside of elemental resistances) and it's easier for players to see that if a lot of the more complex math is taken out. I balance the HP totals as I'm going through the game as any formula I've tried to use ends up just not being balanced the whole way through so yeah manual scaling is the way I am able to do it.
 

duty

Keepin' it simple
Veteran
Joined
Mar 13, 2012
Messages
151
Reaction score
152
First Language
English (US)
Primarily Uses
RMMZ
This is sound advice.

I decided to scrap DEF as a stat entirely in favor of having HP being the only defensive stat for both players and enemies. I like the idea of the player being able to see that their new sword does X amount of damage all the time (outside of elemental resistances) and it's easier for players to see that if a lot of the more complex math is taken out...

First, decide how long you want each battle to last. This will then give you both the enemy's total HP and damage output.

If you want your boss battle to last for 10 player actions, then the boss monster's max HP is 10 multiplied by the average party member damage output per action.

The boss's damage output per turn is then the party's total HP divided by however many actions the boss should get during 11 player actions. This ensures that the party will likely fail if they have not defeated the boss within the 10 action timeframe.

Encounter and overall game design starts to feel a lot more streamlined when you're balancing your battles based on the time to finish. How much damage an attack should do, how much HP should something have, how much MP, etc. all falls neatly into place.

And as the dungeons/quests get progressively more difficult, you will also be able to derive how many levels the party should gain before the next area. That then translates into the number of mob battles and the XP rewards for those battles.

Other small recommendation, scale stats in your game by increments of 60. It's a marvelous number, as it's easily divisible by 2, 3, 4, 5, and 6. That makes adjusting anything by 66%, 50%, 33%, 25%, 20%, or 10% relatively simple math.

Let's take a Zelda like clone as a really simple example. The starting hero has 3 "hearts" that each represent a full unit of health. Each heart is the equivalent of 60 HP.

One of the weakest enemies in the game, a bat, deals a quarter heart of damage per action. That means its base attack deals 15 damage. If you want to make the numbers seem a bit more random, give the attack a 20% variance, so the bat will be doing somewhere between 12 and 18 damage per attack.

Now let's say, that at the end of each dungeon or quest, the hero should have the equivalent of a new heart.
You could do something really simple like increasing the hero's HP to 120 at level 2.

Or you could make it a combination of armor that provides a health bonus and leveling, so the new piece of armor the hero finds grants a +30HP bonus and the hero gains +30HP at level 2.

Or you could make it a combination of armor that provides damage resistance, so the hero is taking an average of 30 damage or less per attack, and the hero gains +30HP at level 2.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Other small recommendation, scale stats in your game by increments of 60. It's a marvelous number, as it's easily divisible by 2, 3, 4, 5, and 6. That makes adjusting anything by 66%, 50%, 33%, 25%, 20%, or 10% relatively simple math.
I'm definitely gonna make more use of "60" in general now lol.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
So lately I've changed my armor formula to be something similar to what WoW uses, which was an improvement from my 1st iteration, but I'm still not satisfied. This is what I'm using now:
value *= 1 - (armor / (armor + 50 + 5 * user.level))

I've tried tweaking the constants, but I haven't been able to get the results I want. Basically, I'm trying to widen the range. A level 1 character starts w/ stats in the single digits and by lv50 (max lv.) their DEF will range from 50 to 250. I'm aiming for the top end (250DEF) to grant ~50-60% dmg reduction. I've tried a few variations such as value *= 1 - (armor / (10 * user.level)) but that sweet spot still eludes me. Any suggestions?

P.S. "Armor" simply refers to DEF or MDF.

Edit: I decided to add a "flat" mitigation component to increase the value of DEF/MDF and Armor Penetration. It also lessens the emphasis on diminishing returns, tho the formula is getting long...
value = value * (1 - (armor / (armor + 50 + 5 * user.level))) - (armor / 2)
 
Last edited:

G-G-Games

Villager
Member
Joined
Jul 26, 2021
Messages
20
Reaction score
11
First Language
English
Primarily Uses
RMMV
For my most recent (and first online) project The Key of Rednow, I used:

a.atk / Math.pow( 2 , (b.def/a.atk)-1)

-equivalently-

atk * 2 ^ (1 - def/atk)

which has the nice properties:
  • when def = 0, dmg = 2*atk (hard limit on dmg)
  • when atk = def, dmg = atk (dmg scales with atk, so long as def scales at same rate)
  • when atk = def/2, dmg = atk/2 (high-def characters/enemies aren't immune to damage*)
*Each time defense increases by attack, damage is halved.

A potential downside is that changes in defense have a less significant effect on damage than changes in attack. If I continue to use this formula, I will probably have armor also increase HP (by a multiple of the defense) in future projects.
 
Last edited:

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
239
Reaction score
348
First Language
English
Primarily Uses
RMVXA
I'm using a formula for my current project that I use for a text-based RP.
ATK / ((DEF / 100) + 1)

To read this a lot easier:
ATK / X
X = 1 + (DEF / 100)

So DEF will be calculated like this:
0 DEF (unarmored) means 1 + 0/100 which will equal 1, thus making it ATK / 1.
280 DEF means 1+ 280 / 100 which means 1+ 2.8 which equals 3.8 making the damage formula ATK / 3.8

If I were to make a DEF table:
0 DEF = 1
40 DEF = 1.4
90 DEF = 1.9
120 DEF = 2.2
So on and so forth.

I find this to be pretty easy to balance. I try to still have DEF instead of just HP like others mentioned because I like being able to choose between a high DEF build vs a high HP build. An add-on to this that I haven't decided on yet is for multihits to deal less damage per hit against DEF because with my formula, 5 hits of 20dmg or 1 hit of 100dmg does the same amount of damage. If a multihit, for example, added a hidden 10 bonus to DEF per extra hit, then it would make multihits good against HP units and single target burst good against armored units.

Because, by design, multihits are innately stronger due to usually inflicting same amount of damage, having numerous chances to inflict debuffs, isn't a "hit or nothing" attack, etc.
 
Last edited:

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
I also contemplated using the following formula but decided not to because then I wouldn't be able to calculate dmg output in the skill descriptions due to not having a "target" or "b" while in the menus.
STR * WpnDmg / CON + DEX / 2
a.atk * a._WpnDmg / b.def + a.agi / 2
I also wouldn't be able to implement Armor Penetration using such a formula... :(

@G-G-Games I like your formula, I'm gonna try out a variation of it, if you don't mind. :p

Edit: So this is my new dmg formula for normal/basic attack:
a.atk ** (1 + a.agi / 1000) + a._WpnDmg
And here's the defensive/armor scaling side of it:
value /= 2 ** (b.def/ a.atk)
Combined, it would be this:
(a.atk ** (1 + a.agi / 1000) + a._WpnDmg) / 2 ** (b.def / a.atk)
aka: (STR ^ (1 + DEX / 1000) + WpnDmg) / 2 ^ (CON / ATK)

Though I'm not fully satisfied, it's given me a few ideas... The "divide by 2 to the power of..." method really helps increase the value of DEF/MDF. I also like how I can still utilize Armor Pen w/ such a formula.
 
Last edited:

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Hmm, I'm a bit stuck on what to put when it comes to negative armor values... Damn, if only I still had my teenage brain, I'd be able to solve this in no time. :kaoangry:
1627242901361.png
 
Last edited:

Lord Vectra

Master Eventer
Veteran
Joined
Dec 6, 2015
Messages
239
Reaction score
348
First Language
English
Primarily Uses
RMVXA
Edit: So this is my new dmg formula for normal/basic attack:
a.atk ** (1 + a.agi / 1000) + a._WpnDmg
And here's the defensive/armor scaling side of it:
value /= 2 ** (b.def/ a.atk)
Combined, it would be this:
(a.atk ** (1 + a.agi / 1000) + a._WpnDmg) / 2 ** (b.def / a.atk)
aka: (STR ^ (1 + DEX / 1000) + WpnDmg) / 2 ^ (CON / ATK)

Though I'm not fully satisfied, it's given me a few ideas... The "divide by 2 to the power of..." method really helps increase the value of DEF/MDF. I also like how I can still utilize Armor Pen w/ such a formula.
Armor Penetration, the one weakness to the armor types. That and DEF debuff.

Just some extra advice, if you do plan to kinda have a HP build v Armor build decision in your game that the player can make, make sure to have heals that scales on % of max HP and some that heals either a set amount or scales on something else. I played games where everything was a set amount or scaled on something that wasn't max hp and HP tanks kinda fell behind after some time because you're using all your resources to heal them up while your Armor tanks take a sip of healing juice and suddenly they are at 100% HP.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Just some extra advice, if you do plan to kinda have a HP build v Armor build decision in your game that the player can make, make sure to have heals that scales on % of max HP and some that heals either a set amount or scales on something else. I played games where everything was a set amount or scaled on something that wasn't max hp and HP tanks kinda fell behind after some time because you're using all your resources to heal them up while your Armor tanks take a sip of healing juice and suddenly they are at 100% HP.
Good point. Luckily for me, I've simplified my stats system so that DEF not only reduces physical damage but also provides bonus HP as well. So when the player does their stat allocation, they don't have to decide between HP or mitigation, they simply stack DEF to increase overall survivability. It makes more sense since I've renamed DEF -> Constitution. As far as spells go, including healing spells, they mostly use utility scaling, usually via MAT.

But yeah, the HP tank vs Armor tank pitfall is definitely something to watch out for. That's pretty much the reason I bundled the 2 together. Though, there are a few things that increase just HP. I have all Shields provide a base +10-15% MaxHP.

Edit: @G-G-Games How do you handle negative armor values w/ your formula?
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!
Just found out that mint tea made from chocolate mint tastes a bit like hot cocoa with candy cane stirred in. As I'm allergic to chocolate this makes me very happy.
It's special day for me tomorrow so time to vanish for 24 hours lol.
So Deltarune Chapter 2 is supposed to release today... if it's out already, has anyone played it? And I can't because I have a stinking Mac and not a Windows PC.

Forum statistics

Threads
115,139
Messages
1,087,543
Members
149,646
Latest member
Kamikayson
Top