Close, but not quite.
I wrote a handy tool for calculating how damage works a while back, which can be found
here.
The actual formula is:
floor((attack_strength - armor) * damage_multiplier)However, we also have to bear in mind the attack speed (a very fast, but weak attack can be stronger than a slow but powerful attack). Damage per world frame is calculated with:
(floor((attack_strength - armor) * damage_multiplier)) / (ceil( 1 / (attack_speed / 4000) + 1 ))There's 40 world frames per second on "regular" speed (the + and - keys modify that), so times the above formula by 40 for damage per second, which is usually the "de facto" method of determining relative strength of attacks in games.
An example of this in use:Say we have an attack strength of 400 (with a variable of zero, for consistency), the target has 20 armour, but there's no damage multiplier (eg, energy attack on leather armour). That makes the damage formula
floor((400 - 20) * 1), which becomes
380 (floor means rounding down). So our attack did 380 damage to the foe. Now assume that the attack speed is 90. That makes the second formula
380 / (ceil(1 / (90 / 4000) + 1), which equals
380 / 46 (ceil means rounding up), or
8.26 damage per frame. At 40 frames per second (regular game speed), the damage per second (DPS) is
8.26* 40, or
330 (90 is a very fast attack speed).