Do not trust DPS calculation

Do not trust DPS calculation

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Do not trust DPS calculation

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Do not trust DPS calculation

Post 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.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Do not trust DPS calculation

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Do not trust DPS calculation

Post 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)
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Do not trust DPS calculation

Post 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?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Do not trust DPS calculation

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Do not trust DPS calculation

Post 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).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Do not trust DPS calculation

Post 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?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Do not trust DPS calculation

Post by Google_Frog »

What do you mean? Modrules can remove xp multiplier.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Do not trust DPS calculation

Post by Forboding Angel »

That would remove all experience. What if I want to keep experience but ditch anything modifying reload rates/times.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Do not trust DPS calculation

Post by Google_Frog »

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Do not trust DPS calculation

Post by Forboding Angel »

Oh wow, thanks!
Completely forgot about those settings.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Do not trust DPS calculation

Post by FLOZi »

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Do not trust DPS calculation

Post 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
Post Reply

Return to “Game Development”