[REQ] Add "Aggro Gain" threat indicator in the table and modify Threat Percentage
seppurt opened this issue ยท 7 comments
It would be very nice if an extra row in the threat table was created, called something like "Aggro Gain". The threat value for "Aggro Gain" would be equal to threat of current targetOfTarget (unless temporary forced attack by e.g. Mocking Blow or AoE Taunt) and have a threat% of 100% for the active active tank, or modified to take aggroMod (1.3 or 1.1 for ranged resp. melee) into account for anyone not currently targetOfTarget.
In the attached screenshot, which is from the known addon KLH Threatmeter, an example of the requested behavior can be seen from the own player's perspective in a scenario where "WarriorNameX" is tanking the mob and "MyName" attacking said target:
- The blue bar "Aggro Gain" is the one already described.
- The brown bar is from the current targetOfTarget (=active tank), and is class color coded, which I understand is not possible in WoW Classic.
- The red bar is the own player one. Another request to this github project has already covered "highlight myself", so I will leave it out of this one.
An extra suggestion, that may be a step in the right direction to fulfill this request, is to modify the current threatPercent
that is being returned by the function ThreatLib:UnitDetailedThreatSituation
in LibThreatClassic2.lua in the following way:
Replace threatPercent = rawThreatPercent / aggroMod
on line 1662
with threatPercent = rawThreatPercent
The point of this change is to have a more intuitive representation of threat% in relation to "Aggro Gain". Currently, I am experiencing overaggroing at 76% threat which I believe is a lot more confusing than overaggroing when reaching 100% threat.
I have locally modified my version of ThreatClassic2 to do the part mentioned in the section above. It looks like this, in the same scenario described earlier:
The missing features from this picture is the requested "Aggro Gain" row, described earlier, and to relate the threat percentages to current targetOfTarget, as explained earlier.
The threat value for "Aggro Gain" would be equal to threat of current targetOfTarget (unless temporary forced attack by e.g. Mocking Blow or AoE Taunt) and have a threat% of 100% for the active active tank, or modified to take aggroMod (1.3 or 1.1 for ranged resp. melee) into account for anyone not currently targetOfTarget.
This is exactly the current implementation, it just shows the tank at 100% instead of an "aggro gain" bar. If the tank is at 100% and the aggro gain bar is at 100%, you would just have 2 bars on top all the time. I don't like having the tank at 90% all the time. That doesn't make a lot of sense to me.
If you check the code, that's actually what what threatPercent = rawThreatPercent / aggroMod
does. It calculats everyones threat as a percentage of when they would overaggro the current tank, but keeps the current tank at 100%. If you are at 95% percent in the current implementation, you actually have more threat than the current tank, because you are at 95% to pull aggro and you pull aggro at 110% or 130% threat of the current active tank. 95% of 110% is 104,5% threat of the current tank. This implementation makes sense as it takes into consideration that ranges will pull aggro much later than meeles and correctly orders them in regards to pulling aggro.
What I do like is adding a bar on top that will show you how much remaining threat you can do until you pull aggro. Detail TinyThreat has exactly this feature, but with the bug that the active tank sees the same bar, which doesn't make sense. If the current tank has 1000 threat and you have 800 threat, it will show that you can do another +300 threat before getting aggro, which is 37,5% more threat than you currently have.
If you are currently overaggroing at 76% threat it's most likely due to another bug (e.g. it is incorrectly using 1.3 instead of 1.1 or the threat calculation is incorrect or chat throttle delays updates or threat updates are dropped alltogether, which unfortunately seems to happen occasionally). However, if a range overaggros you and the mob runs outside of your meele range, you will see yourself at 76% and the range at 100%, and this is absolutely correct. Because the range is now actively tanking, you are not in meele range and he overaggrod you at 130% threat. As he is the new 100% now, you are at 100% / 1.3 = 76.9% threat. What also happens, but is unavoidable, if a range has more than 100% of your threat and is the target of the boss, e.g. due to a spell but not due to tanking, the threatmeter will get confused and show new percentages.
Instead of overwriting threatPercent
, one could just use rawThreatPercent
which is also returned by the same function. But from what I see in the code using threatPercent
as it is right now is correct. Using rawThreatPercent
has the downside that the difference in ranges and meeles is not considered when ordering the players in regards to pulling aggro.
One more thing: Changing the library (anything inside of libs), even locally, is not a good idea. I highly recommend against doing this. The library is most likely included in multiple addons you have installed (e.g. Details, DBM) and which library with the same version will be loaded is basically random (which isn't a problem, because they are the same version, i.e. equal code). If you increase your version number locally, you're telling other players, they have an outdated version. Do not do this.
Thanks for the detailed description and the video. Really helpful. This looks like a bug in the library https://github.com/dfherr/LibThreatClassic2 which is a separate project.
I see two causes for the issues in the video, without having tested it myself.
It looks like this line incorrectly evaluates to 0. Then he always uses the highest value for 100%.
Furthermore, this is not working correctly for the warrior. It looks like UnitInMeeleRange()
isn't working correctly here.
However, this only works for yourself and that you see the shaman with a 1.3 aggro mod even tho he is in meele range, is fine and not avoidable. There is no way for you to check if another player is in meele range of a mob or not. So we just assume rogues and warriors to be meele and others to be range. This should be improved however, by checking for druid forms and considering bear and cat to be in meele range.
Thanks for the detailed description and the video. Really helpful.
You're welcome!
It looks like this line incorrectly evaluates to 0. Then he always uses the highest value for 100%.
I think you are right. This also aligns with the behavior I experienced when modifying line 1657 with first rawThreatPercent = threatValue / maxVal * 100
and then rawThreatPercent = threatValue / targetTargetVal * 100
, just for testing purposes. In the latter case, I received rawThreatPercent = inf
(division by zero, since targetTargetVal = 0).
Furthermore, this is not working correctly for the warrior. It looks like UnitInMeeleRange() isn't working correctly here.
Agreed. Seems reasonable to assume.
However, this only works for yourself and that you see the shaman with a 1.3 aggro mod even tho he is in meele range, is fine and not avoidable. There is no way for you to check if another player is in meele range of a mob or not. So we just assume rogues and warriors to be meele and others to be range. This should be improved however, by checking for druid forms and considering bear and cat to be in meele range.
I see. Thanks for the explanation. Indeed it seems like druids in feral form should be included to aggroMod = 1.1
This looks like a bug in the library https://github.com/dfherr/LibThreatClassic2 which is a separate project.
Ah okay. So the discussion should continue under that project instead then?
Ah okay. So the discussion should continue under that project instead then?
the discussion regarding the bug, yes. I already moved your post over there dfherr/LibThreatClassic2#6
discussion regarding a pull aggro indicator should remain here. As far as I'm converned, they are different things.
Thanks for taking time to answer.
If you check the code, that's actually what what threatPercent = rawThreatPercent / aggroMod does.
I agree with you and this was also my understanding of the code. I tried to test this with a friend, who also had ThreatClassic2 installed and active. But in reality, this is what I experience with your code:
The following things can be seen, which I think are all bugs or unintended behaviors (all of the following was checked from both player's PoV, and the same behavior was seen for both):
-
The incorrect
aggroMod
is being used. It seems to always use 1.3, although it can clearly be seen that both players are in melee range and never step out of melee range from the mob. -
Regardless of who is targetOfTarget (=active tank), the person with the highest
threatValue
is presented as 100%threatPercent
. You can clearly see this when Seppurt (538) is currently targetOfTarget, but Benist overtakes inthreatValue
(541). -
Just before Benist overtakes aggro on the mob, the player's
threatValue
are Seppurt 538 and Benist 593. The correspondingthreatPercentage
are Seppurt 69% and Benist 100%. This is due to the addon thinking that Benist is currently targetOfTarget (=active tank) and that Seppurt'saggroMod
is 1.3. Math:538 / (593*1.3) = 0.697...
. This is reasonable due to the truncation ofthreatValue
on line 1665:threatValue = floor(threatValue)
As a final note to the .gif above; Benist overtakes actual aggro on the mob when his threatValue
increases from 593 to 596. This is as expected, since it is at this point where Benist overtakes threatValue
sufficiently to overaggro within melee range. Math: 596 / 538 = 1.107...
(same regarding truncation of threatValue
as explained above).
It calculats everyones threat as a percentage of when they would overaggro the current tank, but keeps the current tank at 100%. If you are at 95% percent in the current implementation, you actually have more threat than the current tank, because you are at 95% to pull aggro and you pull aggro at 110% or 130% threat of the current active tank. 95% of 110% is 104,5% threat of the current tank. This implementation makes sense as it takes into consideration that ranges will pull aggro much later than meeles and correctly orders them in regards to pulling aggro.
I think this sounds very good. If you manage to solve the bug reported in the first section of this comment, and get it to work like you describe here, I think that would be a big step in the right direction!
One more thing: Changing the library (anything inside of libs), even locally, is not a good idea. I highly recommend against doing this. The library is most likely included in multiple addons you have installed (e.g. Details, DBM) and which library with the same version will be loaded is basically random (which isn't a problem, because they are the same version, i.e. equal code). If you increase your version number locally, you're telling other players, they have an outdated version. Do not do this.
I understand the recommendation fully. I searched for all other addons/directories that used this new threat library, and updated them accordingly to all include ThreatClassic2. And modified all instances of LibThreatClassic2.lua. This was done purely for testing purposes on my part. And as I described earlier, modifying threatPercent
to virtually be the same as rawThreatPercent
was my wonky idea of how to bypass the "76% aggro bug", in order to get this working:
Clearly this should be done it a better way, as we are discussing here. Partly due to
Using rawThreatPercent has the downside that the difference in ranges and meeles is not considered when ordering the players in regards to pulling aggro.
To conclude, I think that fixing (what seems to be) either the aggroMod
bug and/or how isTanking
is affecting who is placed as targetOfTarget, meaning set to 100% threatPercent
would be a big step in the right direction!
Please let me know if I have misunderstood something, posted anything wrong in regards to how the code works/should work, or can help out in any way to fix this.
Since the aggro gain estimate isn't always right I think it would be much more reasonable to display the tanks threat unmodified so that the value can always be trusted. Currently melee dps have to stay below 85% on the meter just in case the tank threat is currently incorrectly shown with the range aggro gain modifier.
Since the aggro gain estimate isn't always right I think it would be much more reasonable to display the tanks threat unmodified so that the value can always be trusted. Currently melee dps have to stay below 85% on the meter just in case the tank threat is currently incorrectly shown with the range aggro gain modifier.
- i'm going to address this issue with the next release, so it doesn't make sense to change anything else
- if the tank is a warrior, this issue is exclusively on the tanks meter. Every other player will see a warrior tank always as in meele range, because it's simply class based.
edit: And the addon is displaying the absolute unmodified threat numbers of the tank anyway. Displaying the unmodified percentage would mean tank 100% and pull aggro at 110% and 130%. I actually thought about providing that as an option.