ways to make an enemy's damage high/low depending on target's defense

jonthefox

Veteran
Veteran
Joined
Jan 3, 2015
Messages
1,436
Reaction score
596
Primarily Uses
I'd like a type of enemy who does a lot of dmg to targets with poor defense, but does poor dmg to targets with good defense. Basically, an enemy who is only a big threat to characters with poor defense.

Trying to think of different ways I can achieve this. The main thing I can think of is to give them a different attack with a special damage formula, where instead of just a.atk - b.def, I'd use higher coefficients like a.atk*2 - b.def *3.

Wondering if anyone has any other ideas on how to accomplish this.
 

SweetMeltyLove

Veteran
Veteran
Joined
May 4, 2015
Messages
113
Reaction score
155
First Language
English
Primarily Uses
RMVXA
Sounds like you got it. If you multiply b.def, that means it has a higher impact on the result

You could also define what is "low defense" and "high defense".

Say 500 defense is what you consider "high", the formula would be: a.atk * 500/b.def

With this formula, and say 200 atk, the results would be:
1 def: 10000 dmg!
100 def: 1000 dmg
200 def: 500 dmg
300 def: 333 dmg
1000 def: 100 dmg

If you don't want the damage to be so high, your can limit the b.def with [x,y].min, like a.atk * 500/[b.def,50].min, in this case defense between 1 and 50 would take the same damage
 
Last edited:

kirbwarrior

Veteran
Veteran
Joined
Nov 13, 2014
Messages
732
Reaction score
418
First Language
English
Primarily Uses
N/A
Well, the default formula already does this. A difference of 10% in defense results often in 50% difference in damage. I do like the idea of a strong attack that magnifies the difference like you have, but maybe even higher; atk*4 - def*6.

Another thing you could do is use formulas to check how high defense is. You could have an attack that ignores defenses but only if the defense is less than 100. You could do something like def * def / 100, so defense is applied by it's own percent (70 defense would become 49, 150 would become 225). Or something like (atk - def) * atk / def. RMXP's attack damage is (atk - def) * (1 + (str / 20)) and low defense significantly increases damage.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
Yes, multiplying b.def will work (generally that will mean you'll need to make the enemy's own ATK very high, or if that would look weird in e.g. a monster book then you could add a base value onto the formula like 100 + a.atk - (3 * b.def) ). If it's not only enemies but also actors that you want to do this for, then @kirbwarrior's suggestion of (a.atk - b.def) * (normal skill formula) can be a smart way to go.

I almost always suggest multiplicative formulas rather than additive ones, since they provide a far more adaptive game balance. "a.atk * 40 / b.def" will create far smaller swings in power if your player's stats are slightly higher or lower than you expect than the huge swinginess that "(a.atk * 2) - (b.def * 2)" will create. Of course, this brings about a harder version of your original question, which is how do I make skills that will demolish low-DEF foes but not high-DEF ones. I accomplish this with the use of "penetration" - the ability of a skill to ignore a fixed amount of enemy defense. This will mean a lot where foes already have low DEF, because it makes the divisor very low; it will mean less against foes with a lot of DEF. So, "a.atk * 40 / ([(b.def - 15), 1].max)" would be the adaptation of the formula above for a skill with 15 Penetration.

The Penetration would mean a difference of +100% damage against an enemy with 30 DEF, but only +33% damage against an enemy with 60 DEF. The reason for the complicated second part rather than simply (b.def - 15) is because very strange things could happen if the enemy had less DEF than you're penetrating; it might turn into a giant heal for the enemy. So we have to set the minimum denominator to 1.

(Technical note: the "max" function works differently in JavaScript than Ruby. In MV, the syntax will need to be written differently than above. I think it's "a.atk * 40 / (Math.max((b.def - 15), 1))"
 

Frozen_Phoenix

Veteran
Veteran
Joined
Nov 15, 2014
Messages
133
Reaction score
75
First Language
Portuguese
Primarily Uses
RMMV
I usually use this formula for damage: (a.atk*a.atk/(a.atk+b.def))

If you do something like this: 2*(a.atk*a.atk/(a.atk+4*b.def)) it will be stronger than the former up until a certain amount of defense.
 

Vinzentice

Villager
Member
Joined
Nov 13, 2017
Messages
5
Reaction score
5
First Language
Indonesian
Primarily Uses
RMMV
If you still need suggestions, here's my formula:

atk / (1 + Math.exp(S * (def - M) / 100)) + L

Screenshot (122).png

This formula forms a Sigmoid curve. This curve's behavior is that as your 'def' increase, your damage will not change as much initially, then suddenly decrease by a lot before settling on the lowest possible damage.

S = Steepness of curve. The higher the number, the steeper the curve is. If this is set to 0, your atk will not be affected be def.
M=Midpoint of defense. This determines how much defense the target needs so that they will receive only 50% of atk plus L.
L = Lowest possible damage. If your target's def is much higher than the attacker's atk, the damage will be very near to 0. If you want the enemy to still do damage when this happens, put a number here. Otherwise, leave this empty.

For example, I put atk = 100, S = 15, M = 50, and L = 5

X axis : defense
Y axis: Damage dealt
Screenshot (123).png

When the def is between 0 to 20, the damage dealt is still pretty high, around 104 to 105. From 20 to 70 defense, the damage dealt starts to decrease slowly, then sharply, then slowly again. At 50 defense, the damage dealt is 55 (50% of 100 plus 5). From 70 defense onwards, the damage slows its decrease and finally stays at 5 damage.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
If you still need suggestions, here's my formula:

atk / (1 + Math.exp(S * (def - M) / 100)) + L

For example, I put atk = 100, S = 15, M = 50, and L = 5

When the def is between 0 to 20, the damage dealt is still pretty high, around 104 to 105. From 20 to 70 defense, the damage dealt starts to decrease slowly, then sharply, then slowly again. At 50 defense, the damage dealt is 55 (50% of 100 plus 5). From 70 defense onwards, the damage slows its decrease and finally stays at 5 damage.
Very cool!! I really like how you used an "e to the x" function as only part of the denominator to allow damage to decrease exponentially after a certain point, while avoiding ridiculously high amounts of damage when the enemy defense is near 0. Effective and elegant.

The one criticism that could be leveled at this formula is that it is very complex, so it would probably be best for enemies that could be introduced alongside a snippet where the characters note in a general sense that these enemies can really put the hurting on low-defense teammates. I wouldn't want to see a complicated formula on a character's skill (unless ALL of the character's skills worked this way), because clarity is as important as quality of the curve on usable skills.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top