Page 1 of 1

Do not trust DPS calculation

Posted: 30 May 2012, 09:33
by Google_Frog
Here is a common pitfall in balancing. In most cases the following equation is false:
Common Sense wrote:Damage dealt per second = damage / reloadtime
I use this gadget to measure real unit DPS. It measures the time interval between when a unit first takes damage and when it dies. To test the DPS of a unit I spawn a high health unit for my test unit to attack. The effect of a single missed reload time is averaged away with a long enough test.

I have found a few things that mess up DPS. To fight this I keep a DPS page for ZK which is a good idea for all games which want stable balance.

Modifying reloadtime
In short the reload time tag is crazy. Burst related tags probably have a strange effect on DPS as well. Here is an example.

These two damage and reloadtime configurations for the ZK Tremor have the same DPS.
  • Reload time = 0.4, Damage = 200
  • Reload time = 0.36, Damage = 135
My gadget can also measure the time between shots. With 0.4 reloadtime a projectile is created every 15 frames and with 0.36 reloadtime the projectile is created every 10 frames. The DPS of this unit is neither 500 or 375, it is 406.This case caused quite an issue as a theoretical DPS buff of 11% turned out to be a 50% buff.

The lesson here is do not modify reloadtime as a DPS nerf without testing it.

Experienced based reloadmult
At some point experience based reloadmult was removed from ZK. At this point I discovered that there can be a large DPS change between a unit with 0 xp and one with 0.001 xp, the latter had up to 40% more DPS.

reloadmult probably compounds the previous issue.

Engine releases
Engine changes can mess with anything.

I should note that I'm fine with them modifying unit balance as long as I can change things gameside to counteract the changes.

Re: Do not trust DPS calculation

Posted: 30 May 2012, 09:54
by Beherith
A dps of 400 makes perfect sense with 135*10/30 and 200*15/30.
An xpreloadmodifies threshold of 0.001 means no significant different except for the very first shot dealt by the unit, since almost all units can do 1/20th of their cost in damage with 1 shot.

This is interesting, keep us posted and ill look at your gadget too.

Re: Do not trust DPS calculation

Posted: 30 May 2012, 12:09
by Google_Frog
A dps of 400 makes perfect sense with 135*10/30 and 200*15/30.
This makes sense. The point there was that this does not make sense:
  • reloadtime 0.4 = 2 shots a second
  • reloadtime 0.36 = 3 shots a second
I don't know if this holds for all unit or if shots/second is also dependant on unit script.

Re: Do not trust DPS calculation

Posted: 30 May 2012, 12:34
by Kloot
in theory:

reloadtime=0.4 --> weapon fires every int(0.4*30)=12 frames --> 2 times per second, 6 leftover frames
reloadtime=0.36 --> weapon fires every int(0.36*30)=10 frames --> 3 times per second, 0 leftover frames

(both figures assume a unit with 0 experience)

in practice, the actual reload-rates are more complicated due to the interaction between the engine and the AimWeapon script callin (which is called every 15 frames, and whose return value is not always instantly available if it spawns a thread)

Re: Do not trust DPS calculation

Posted: 01 Jun 2012, 16:36
by KDR_11k
Does your first damage to death model account for overkill and the fact that there's one fewer reload time than shots fired?

Re: Do not trust DPS calculation

Posted: 01 Jun 2012, 17:09
by Google_Frog
KDR_11k wrote:Does your first damage to death model account for overkill and the fact that there's one fewer reload time than shots fired?
No.
The effect of a single missed reload time is averaged away with a long enough test.
I just give the target unit massive HP, set spring to 20x speed and ignore the effect.

Re: Do not trust DPS calculation

Posted: 03 Jun 2012, 10:50
by KDR_11k
I thought about it but I can't really find a case where I balanced for DPS. I usually go for matchups, unit X should beat unit Y in an engagement of size Z, sometimes with engagement sizes dictating different outcomes (e.g. bug vs bit should be even in a 1v1 situation but in 50v50 the bits should win unless a part of the bugs is transformed into exploits).

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 01:49
by Forboding Angel
While it points out a real issue, I think it is overstated somewhat. Also, without the gadget that removes the experience multipliers, how is this useful?

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 08:13
by Google_Frog
What do you mean? Modrules can remove xp multiplier.

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 09:02
by Forboding Angel
That would remove all experience. What if I want to keep experience but ditch anything modifying reload rates/times.

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 09:18
by Google_Frog

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 10:48
by Forboding Angel
Oh wow, thanks!
Completely forgot about those settings.

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 13:26
by FLOZi

Re: Do not trust DPS calculation

Posted: 05 Jun 2012, 15:12
by smoth
Forboding Angel wrote:That would remove all experience. What if I want to keep experience but ditch anything modifying reload rates/times.
Untrue