Twin Matrix
Feb 12 2011, 06:28 AM
I'm wondering how damage output is calculated in your game(s). The standard RMXP/VX formula isn't that good IMO. I know they're different, but they both basically come down to this:
Damage = Attack - Defense / 2
Now the problem with it for me is this:
Bard - 100 Attack
Warrior - 200 Attack
Enemy - 180 Defense
Bard: 100 - 90 = 10 damage
Warrior: 200 - 90 = 110 damage
Now the scale is completely gone from 1:2 and the Warrior is considerably stronger.
I'm kind of lost as to how I can fix this issue in a proper way. Either the scale should remain (1:2), or defense should have less effect on lower attack. I'm kind of fiddling around with (Attack / Defense)*Level^2, but before that I had 5 other failed algorithms, haha.
Rob_Riv
Feb 12 2011, 06:38 AM
How much stronger should the warrior be than the bard? What kind of damage output would you like from both?
Twin Matrix
Feb 12 2011, 06:46 AM
Like I said, 1:2 damage, Bard:Warrior.

The problem with the standard algorithm is that on low defense enemies, the damage output is very similar between characters, but with high defense enemies the scale becomes crazy.
Warrior 50
Bard 30
Defense 50
Warrior dmg: 25
Bard dmg: 5
Scale is messed up.
Warrior 50
Bard 30
Defense 20
Warrior dmg: 40
Bard dmg: 20
Scale is OK.
Rob_Riv
Feb 12 2011, 06:58 AM
QUOTE (Twin Matrix @ Feb 12 2011, 02:46 PM)

Like I said, 1:2 damage, Bard:Warrior.

The problem with the standard algorithm is that on low defense enemies, the damage output is very similar between characters, but with high defense enemies the scale becomes crazy.
Ohh, that's what you meant. You want the 1:2 ratio between stats to be reflected in the damage. For the statistics to reflect with exactly the same ratio in the damage, defense would have to be ignored. I'll try to work on something, I'll post again in a bit.
Twin Matrix
Feb 12 2011, 07:03 AM
Yep. And the other problem being that the damage between characters varies greatly depending on the enemy's defense. It's funny, I never realized how bad the algorithm actually is (IMO).
But, ignoring defense isn't a solution either. Because defense allows defense-piercing attacks (strategy), is an equipment stat and without it you would have to increase HP by each level up considerably. Hmm.
Rob_Riv
Feb 12 2011, 07:09 AM
QUOTE (Twin Matrix @ Feb 12 2011, 03:03 PM)

Yep. And the other problem being that the damage between characters varies greatly depending on the enemy's defense. But, ignoring defense isn't a solution either. Because defense allows defense-piercing attacks (strategy), is an equipment stat and without it you would have to increase HP by each level up considerably. Hmm.
Hmm, you want damage to be equal to the stats (which would have to ignore defense), but you want defense to be a factor also. If defense took away a percentage of damage, then that would keep the ratio equal. I have no idea if that is a conventional idea though, and so wouldn't recommend it.
Twin Matrix
Feb 12 2011, 07:11 AM
Which is why I'm wondering how other people do it.

The standard algorithm seems very unbalanced, but leaving defense out is pretty weird, too.
(Attack / Defense)*Level^2 seems to work OK so far, though. It's a bit weird, but the stats scale is maintained amongst characters of the same level, while defense does play a part.
Titanhex
Feb 12 2011, 12:22 PM
If I was you I'd try to get someone who understands the growth aspect of this formula. Obviously the growth of stats is going to also be a huge factor in this. You want to factor your stat growth so the ratio doesn't get skewed.
While the formula seems simple it grows complex with stat fluctuation. You'd want things to barely change if you could help it. That should be the first concerned address here as it will be 1:2 for one level but that'll be it.
I'd also take it a little further and say you'll want some script that helps influence damage, if you can't rewrite the damage formula directly via scripts. (I imagine if you could reroute the method that calls the formula that could help at least.)
Anyways if you can't change the way damage is calculated (And I don't see why you couldn't if it's RPG VX/XP) then you'll have to undertake the complexity of creating your own battle system. I've done it before, it's not difficult. But it's no simple task.
darkyoshi
Feb 12 2011, 04:29 PM
What about instead of doing simply (attack/defense) or (attack-defense), you adjust the defense by a modifier. For example:
CODE
basePower + (baseDefense * armorMod)
armorMod being something like -0.7.
After that, you can go into other things like resist/weakness and whatever else your system would use to calculate. Instead of hardcoding in the armorMod, maybe some characters, like super defensive characters can adjust that midgame.
Naridar
Feb 13 2011, 01:12 PM
Well, the formula I like to use is:
base DMG = (STR/8)^2 OR (STR/8) * (Level/4), if your enemies have levels as well.
Damage = base - (base * sqr. root(DEF*10) / 100)
In this way, 10 DEF reduces damage by 10%, 100 DEF reduces damage by ~32%, 250 DEF reduces damage by 50%, 500 DEF reduces damage by 71%. So a point to DEF at a lower level is worth more than at a higher level - the difference between 50 and 250 DEF (200 pts.) means much more than the one between 650 and 850.
Not to mention that 0-damage (which happens often with the RPG maker algorithms) can't really happen, and high defense enemies take twice as much damage from the warrior as the bard, as well as low-defense ones.
Rukiri
Feb 13 2011, 02:13 PM
This is just for melee, but it's what I'm using in my a-rpg engine.
str = str * 2;
attck_pow = bp + str;
damage = bp((level*level + attck)/256 * 5/2)
damage = damage + 3;
damage formulas have to be the easiest algorithms to code, they're really not complex and most games today probably use very similar codes.
LockeZ
Feb 16 2011, 12:43 AM
Damage formulas where you divide by defense are way, way easier than formulas where you subtract by defense. They are easier to balance in every way, and generally more intuitive to the player. The only downside is if you want to have a "threshold" where if you don't have at least a certain amount of attack power you can't hurt the enemy at all.
Then of couse there's the Final Fantasy formula which is the worst of both worlds. FF games multiply your damage by (256 - enemy defense). Superficially this seems similar to dividing by the defense value, but in practice it means that +15 defense at the beginning of the game is utterly worthless, but +15 defense at the end of the game will halve the damage you take. So for it to be anything resembling balanced, at the beginning of the game each upgrade would have to be 50-60 more points of defense than the previous one, and at the end of the game they'd have to only be 1-2 points better than the previous one. Which is, of course, the opposite of how the armors actually progress in FF games. (FF games do some really stupid things.)
Naridar
Feb 16 2011, 08:04 AM
Exactly. If there's anything in FF games that shouldn't be learned from (and storylines aside, there are many) is algorithms. However, if you want to use the multiply-formula instead of the subtract-formula (and why wouldn't you?), I'd suggest using square roots (like in my algorithm a few posts above).
Another good example for damage formulas seems to be the Dragon Quest saga. It always seems balanced enough.
LDanarkos
Feb 20 2011, 01:27 AM
I think I copied this from the RM2K damage formula...
Attack * Random(0.4,0.6) - Defense / 4
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.