The problems you have with calculating DPS from that formula are because what you call BaseDamage
doesn't actually seem to be that.
Assuming that all numbers are positive, BaseDamage / ( BaseDamage + Defense )
will always resolve to a floating point number somewhere between 1 and 0. It doesn't matter if you have 10 BaseDamage
, 1,000 BaseDamage
or 1,000,000 BaseDamage
, you will always be in that range. Where in that range depends on how the BaseDamage
of the weapon compares to the Defense
of the target. That means what actually affects the order of magnitude of the realDamage of an attack is mostly the SkillDmg
multiplier.
Looking at these mathematical properties, I would not really call this weapon property BaseDamage
but rather DefensePenetration
, because it describes the ability of the weapon to overcome the enemy defense and still do most of its damage. This might actually be an interesting mechanic to have (or not... it's something you need to testplay), but it does not say much about the power level of a weapon.
So how do we solve this problem?
Well, there is no right solution to this problem. But a change which might do what you want to do (twice as powerful weapon = about twice as much damage) is to add the BaseDamage
as another multiplicative factor:
float realDamage = SkillDmg * BaseDamage * BaseDamage / (BaseDamage + Defense)
If you like the defense penetration mechanic you accidentally discovered, this is how it would look with Penetration
as a separate weapon stat:
float realDamage = SkillDmg * BaseDamage * Penetration / (Penetration + Defense)
The nice thing about this formula is that it scales quite well:
- Even when the defense is pathetic compared to the attack value, there is never more damage than attack. This gives you an upper limit on how much damage a character can inflict, which makes balancing far easier.
- On the other extreme, no matter how high the defense gets, it can never completely mitigate damage (except through rounding errors), so there is always room for improvement for the defender and there is never a completely pointless attack.
- When Defense and BaseDamage (and Penetration when you want it) are roughly the same, there is roughly half as much realDamage as BaseDamage. This is true no matter how large the values are. This is also what you can base your DPS estimation on. Simply assume that the enemy has as much defense as the weapon has attack/penetration, which means your DPS formula becomes
AttackFrequency * BaseDamage / 2
Edit: Here are some tables with example values:
Damage by Defense for single attack
Defense
| 0 | 35 | 50 | 100
---+-------+------+-------+-------
35 | 35 | 17.5 | 14.4 | 9.1
Attack 50 | 50 | 29.4 | 25.0 | 16.6
100 | 100 | 74.0 | 66.7 | 50.0
Dps assuming HitFrequency = 100 / Attack
Defense
| 0 | 35 | 50 | 100
---+-------+-------+------+-------
35 | 100 | 50.0 | 41.1 | 25.9
Attack 50 | 100 | 58.8 | 50.0 | 33.3
100 | 100 | 74.0 | 66.7 | 50.0
As you can see from these numbers, high-damage-low-speed weapons are still nominally more powerful against the same enemy than low-damage-high-speed weapons if they have the same DPS according to AttackFrequency * BaseDamage / 2
. But the effect is more visible on high-def enemies than on low-def enemies. Both are equally good on 0-def enemies. That means fast-attack weapons are less bad on low-def enemies than on high-def enemies.
This might be balanced by the fact that high-speed weapons give the player more flexibility regarding damage distribution and thus allows them to avoid wasting DPS on overkills. When the player faces a very large number of very weak enemies which all die with one hit, then a 5 attacks per second weapon can kill 5 enemies per second while a 1 attacks per second weapon can only kill 1 enemy per second. Another possible advantage appears when you add randomness to attacks. Due to the law of large numbers, many weak attacks will do a smoother and more reliable damage output than few strong ones. Players usually benefit from reliability. But when such considerations are irrelevant due to your game mechanics and/or encounter design, you will have to make your faster weapons a bit more powerful than they should be to compensate.
One way to give high-speed weapons a boost could be the introduction of effects which trigger with an x%chance per hit and do not depend on damage. These would be much more powerful with a fast-attack weapon because they would trigger far more frequently.
damage * damage / ( damage + defense)
), just without taking skill damage into account. The reason for the difference in DPS is because you are using the same defense. The reason why you get different results is because with that formula, slow but strong weapons are better against high-def enemies while fast but weak weapons are better against low-def enemies (which seems plausible). You assumed a high-def enemy and balanced both weapons against it, which means you made the dagger overpowered. The DPS calculation shows that overpower. \$\endgroup\$