Calculating DPS

FarAwaY

TH.net Regular
Reaction score
9
Well what I want is to make a little system calculating the DPS of a unit.
But I cant find the necessary values - atk cooldown, minimum damage, maximum damage in trigger editor.

How do I do it then?
 

FarAwaY

TH.net Regular
Reaction score
9
Well, the Attack Cooldown can be found in the OE, under Combat - Attack1/2 - Cooldown.
But, here is some reading for you:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=44516

DPS calculations can be found in the point 2.2, and attack speed is 2.3 ;)

No, I know that.

But what I said is that I cannot find the values in the Trigger Editor.
Im making a system remember? I cant create it without the values because apparently the trigger actions dont exist.
 

Flare

Stops copies me!
Reaction score
662
You cannot modify (or retrieve a value for) properties like attack damage (base, min or max), attack speed and most (if not all) other properties pertaining to physical attacks via the Trigger Editor. The only way you can is to add/remove abilities that modify the stats (e.g. Gloves of Haste bonus, Claws of Attack bonus).

Upgrades may be suitable, if (1) there is only 1 unit per player that can be affected, (2) the bonuses will not need to be reversed and (3) there is some limit as to how far the increases will go (since making upgrades with a large number of levels, or a large number of separate upgrades, is a bit inconvenient)
 

reyghost

New Member
Reaction score
14
I dont think that u can find that that in GUI.Maybe u can try using adamage detection system,calculate the damage dealt and time between 2 damage sources to act(though this sounds very difficult).
If u know JASS better try use it instead of GUI.
 

FarAwaY

TH.net Regular
Reaction score
9
No no....Im not trying to modify them, because yeah I know you cant modify them through triggers.

Because what I want is to GET them through triggers, if possible. To add them up, then divide them by cooldown to make a personal DPS system. Is there no way to find out how much damage the unit is dealing every second?
 

FarAwaY

TH.net Regular
Reaction score
9
Thanks reyghost...your idea helped me think of a way. But first I'll need a few values.
 

Flare

Stops copies me!
Reaction score
662
You cannot modify (or retrieve a value for) properties

The only near-perfect solution is to store every unit's properties, and everytime you need to get their current attack speed/damage, you would have to retrieve that stored value, then factor in buffs, items, spells, etc (all of which would have to be done by hand). It'd be capable of handling in-combat and out-of-combat situations, if done correctly, but it'd be a pain to do

It should work, but it's certainly not the most convenient or practical thing to do :p

You could also force the unit to attack a target dummy - would give you an accurate reading of attack speed and damage dealt (if the dummy had no resistances or vulnerabilities to any damage type), but that would result in moving the unit to the dummy, which would look odd (units 'disappearing' for no apparent reason) and impact on gameplay, due to potential abuse. To my knowledge, there isn't any effective way to make a perfect clone of a unit (i.e. abilities and items are fine - buffs would be a problem) so the target dummy method, while useful for an out-of-combat situation (i.e. nothing empowering or weakening the unit), it wouldn't work properly for a combat situation if buffs were applied.
 

FarAwaY

TH.net Regular
Reaction score
9
Yeah of course, flare. That SHOULD work, but like you said its not very practical.

However, I believe I have found the solution to the problem. By using reyghost's method of "finding the time" between the 2 attacks, I have been successful.

All I did was start a timer, and it would calculate the damage dealt and time elapsed, then I would put them into variables. When the unit attacked for a second time, I combined the the second damage dealt + the damage dealt variable, and I did the current elapsed time - the elapsed time variable, once again putting them into a single value which read:

Set DPS = DamageDealt_Var + Damage Taken / 2 / Elapsed Time for Gamer Timer - Time_Var.

And it worked perfectly. ^^ Did a test with 2.5 second attack cooldown and 30 damage. I got 12.
 

FarAwaY

TH.net Regular
Reaction score
9
Add another Trigger at Map Init that says:

-Pick Every Unit in playable map area and do:
-Add to DPS System the event [Picked Unit] Takes Damage

From there, you work it out on your own...Set them all into variables, and calculate them.

Thanks reyghost btw, for your insight. It was perfect.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top