Thursday, June 14, 2018

Alternative RPG Maker Damage Formula

Small Stats Formula
With these formulas, if Atk and Def are equal, the damage is half the attackers attack value. They suit games with small number stats because damage scales and remain low and predictable. The highest damage an attacker can do will be equal to its Attack stat and the lowest damage will be 1.

Formula:
DAMAGE = a.ATK^2/(a.ATK+b.DEF)

Attackers Atk = 10
Defenders Def = 10
10^2/(10+10)
100/20
5

Formula rewritten for RPG Maker (because RPG maker can't do exponents?)
DAMAGE = a.ATK * (a.ATK / (a.ATK+b.DEF) ) or Damage = X * (X/(X+Y))

Attackers Atk = 10
Defenders Def = 10
10 * (10 /(10+10))
10 * (10/20)
10 * ( .5)
5

Examples 
Attackers attack = a
defenders defense = b
damage = d

d = a * (a/(a+b))

1. Attack and Defense are equal
a = 10     b = 10
d=10(10/(10+10))
d=5

2. Attack is twice defense
a = 20    b = 10
d=20(20/(20+10))
d=13

3. Attack is thrice defense
a = 30    b = 10
d=30(30/(30+10))
d=22.5

4. Attack is definitely higher than defense
a = 43    b = 8
d=43(43/(43+8))
d=36

5. Attack is half of defense
a = 5    b = 10
d=5(5/(5+10))
d=1.25

If you haven't noticed, the above formula is based on the idea that if you are equally matched with your enemy, you will dish out damage that is equal to 50% of your attack stat and no matter how much you outclass your enemy, you will do no greater damage than an amount equal to 100% of your attack stat without a critical. You may also notice that your damage asymptotes. By adding a x2, you can change that 50% when you're equally matched to 100%. This brings us to...

SPELLS WITH BASE POWER THAT STILL SCALES

If you add a variable as a multiplier to the beginning of the formula, you can increase the damage you do. This variable could represent the strength of the attack or spell or power or etc. Think of spell levels in Final Fantasy for instance.

d=x*a*(a/(a+b))
X can represent the level of the attack or spell. Example:
Weak = 0.5
Basic = 1
Medium = 1.2
Strong = 1.5
Very Strong = 2

If X = 2, your damage would be equal to your attack stat (if a.atk = b.def). I prefer to make 2 the basic value of an attack or spell. This way, every point of ATK and every point of DEF has more value, making upgrades from equipment and levels more valuable. If 2 is your normal damage, 3 would net 1.5x damage and 4 would net you 2x damage.


FORMULA 2
Found this one here:
https://www.rpgmakercentral.com/topic/27581-how-to-make-damage-calculation-and-leveling-more-like-final-fantasy/
it's: (a.atk / 2)(a.atk / 2) - (b.def / 3)(b.def / 3)
As the OP puts it, damage scales greatly, see below. I think he's very pleased with it, however it makes Defense a less valuable stat compared to attack.
a.atk=10, 25 damage dealt
a.atk=16, 64 damage dealt
a.atk=20, 100 damage dealt
a.atk=30, 225 damage dealt
a.atk=50, 625 damage dealt
a.atk=70, 1225 damage dealt
a.atk=100, 2500 damage dealt
a.atk=150, 5625 damage dealt
a.atk=200, 9999 damage dealt 

if defense is /3 then ^2, this is how much less the base damage will be.
(b.Def / 3)(b.Def / 3)
def    damage
10    11
11    13
12    16
13    18.5
14    21
15    25
16    28
17    32
18    36
19    40
20    44
25    69
30    100
35    136
40    177
45    225
50    277
55    336
60    400
70    544
80    711
90    900
99    1089

125  1736
150  2500 
175  3402
199  4400
255 7225
300 10,000!

In my opinion, this method of having scaling damage is cool, but it means that 1 point to attack is more valuable than 1 point of defense, which is weird to me. Maybe I'm thinking about it too much? If you back track to an earlier point in the game, you'll be one-shoting everything with obscene numbers and the players might start to think too much too.

Let's say you're going for a damage cap of 9,999. Dividing attack by 3 instead of 2 will net you a base damage of 4400 if your attack power is at 200. If your damage doubles when you crit, you'll be approaching 9900 base damage. Factoring in things like elemental weaknesses and resistances and you're pretty much set.

Just for curiosity, let's look at numbers if you divide stat x by 4.
(b.def/ 4)(b.def / 4)
atk   damage    
10    6.25
11    7.5
12    9
13    10.5
14    12
15    14
16    16
17    18
18    20
19    22.5
20    25
25    39
30    56
35    76.5

40    100
45    126.5
50    156
55    189
60    225
70    306
80    400
90    506
99   612

125  976
150 1406
175  1914
199  2475
255  4064
300 5625

I might give a try, but my characters stats will be pretty low so that I can keep make damage around 999. In several Final Fantasy games, 5, 6, and 9 for example, your stats were low. The highest Strength state in FF5 was in the 40s. The formulas scaled because the game had a modifier that was the characters level. You can't assign a level to enemies in RPG maker with scripting, however, which is unfortunate.

Let's see what it would look like to compare high attack to low defense.
70 attack vs 20 def is 519 base damage. 80 attack vs 30 defense is 655 base damage.
Atk VS Def = base damage
70        20         519
70        40         444
70        50         388
70        60         319
80        30         655
100      50         922
100      80         711
100      90         605
100     100        486
80         99         99
70         99        0 or 1
80         110      45
90         110      0 or 1
120       150     194
125       150     330
130       150     471
150       150     1094
Based on this information, if the attack and defense are equal, there will be a damage and you will probably be giving enemies a fuck ton of HP. If your attack is too low, you will probably be no match for the enemy. If your attack is much greater than enemy defense, you'll be doing a lot of damage and it makes the numbers look kind of same-y I guess.

If I was developing a game using this number system, I would have to make a spreadsheet and keep I think I would have to micromanage the distribution of points and fine tune to game a little to much.


How to change critical damage.
Here are the steps:

1 - Open up your game folder

2 - Go to "js"

3 - Open up "rpg_objects" (I personally just used word pad)

4 - Find this line:

Game_Action.prototype.applyCritical = function(damage) {

    return damage * 3;



Change the "3" to whatever critical damage multiplier you want.

No comments:

Post a Comment