BagSync

BagSync

3M Downloads

Scan tooltips issues (mail) with pet tooltips

tflo opened this issue · 16 comments

commented

Latest version of BagSync.

I guess you are not trading in pets, so you are not aware of the enormous delays that BagSync (and other tooltip-related addons) produce while retrieving stuff from the mail box, where the 'stuff' is 30+ pet boxes, right?

The delaying scan tooltips aren't there (or aren't noticeable) if the mail content is only non-pet stuff (or only a small percentage of it is pet boxes).

commented

Disabling any tootltip (BagSync, TSM, Armory, ...) immediately accelerates the mailbox retrieval by a factor of 2 or more. My intention is not to fix or make you fix the issues with TSM or Armory and what not, but just BS. Once fixed the issues with BS, I guess it will/could serve as a template for the others.

commented

Sorry for throwing this at you. Could also have posted this at the TSM folks (but I explained you why I think this is useless in another thread), and I know you are a person interested in optimizing your addon. So, you are my best bet ;)

commented

OK, now let's get to work…

commented

Yeah, sorry that I'm back. But I guess you knew that I will be back some day ... 😇

commented

Great googly moogly this was a lot of responses all at once. 😄 I wasn't aware of the issues with the Mailbox, but I'm not surprised as they treat the same way they do the Guild Bank. Items sent in the mail are treated as "[Pet Cage]" just like in the guild bank. Explanation if you recall was in the previous thread as to why this causes issues. I'll see what I can do to try to lessen this but it may be out of my hands. Especially given how Blizzard handles Battle pets overall in WOW. It's one giant mess really and I think they could have done better. Either way I'll see if I can at least lessen it a bit, but I can't promise you anything though.

commented

Also before I forget, do you have Accurate Battlepets on or off?

commented

I did some review on this issue and there really isn't much I can do. My hands are tied based on what tools are available to me. If anything you can blame how Blizzard/WOW treats Battlepets in code. You can send them an email with your concerns and perhaps they will address that for addon authors in the future.

Explanation:
Right now there are only two major functions available for us to handle items in the Mailbox.

  1. GetInboxItem - https://wowpedia.fandom.com/wiki/API_GetInboxItem
  2. GetInboxItemLink - https://wowpedia.fandom.com/wiki/API_GetInboxItemLink

For GetInboxItem we loop through all the available mail and attachments, for each it returns the following. (name, itemID, iconTexture, count, quality, canUse). Using that information addon authors can have a pretty general idea of what items are in the mailbox, with the exception of Battlepets (just like Guild Banks).

If GetInboxItem is returned for a Battlepet this is pretty much what we get.
image

  1. name
  2. ItemID
  3. iconTexture
  4. count
  5. quality
  6. canUse

You'll notice that the itemID that is returned for that BattlePet is 82800. That is the generic [Pet Cage] itemID and isn't the itemID or SpeciesID for the Harbringer of Flame (which is actually 1147, https://wowpedia.fandom.com/wiki/BattlePetSpeciesID). Blizzard treats Battle Pets in the Guild Bank and Mailbox as a generic itemID of 82800 (https://www.wowhead.com/item=82800/pet-cage). There is no speciesID until the user hovers over the item to grab the tooltip or removes the item from either the Mailbox or Guild Bank. Which makes handling battlepets a pain to work with as we can't do anything with a generic name of [Pet Cage] or itemid of 82800.

The other function we can use is GetInboxItemLink. If I were to use that function on a mail slot, it should return item link for it. In this case when it's used on a Battle Pet, all you get back is the [Pet Cage] itemlink. So that is completely useless in determining the SpeciesID.

Now that you understand that. The only options available for us is the following.

  1. Use the "name" value returned from GetInboxItem and loop through ALL the BattlePets in the Pet Journal for a pet matching that name to get the SpeciesID.
  2. Use the "iconTexture" from *GetInboxItem and do a loop through all BattlePets in the Pet Journal for one having a matching iconTexture. Note: This is very inaccurate as some BattlePets share the same iconTexture.
  3. The final option is the most accurate, which is to assign the InboxItem to the Game Tooltip. Using C_TooltipInfo.GetInboxItem. This forces the server to respond with the actual BattlePet tooltip for the item in the Mailbox Slot. Using the returned data we can then accurately grab the SpeciesID from the BattletPet link associated with the tooltip. The problem with using this method is that is can cause lag as there is a delay between WOW client and Server response. The more battlepets, the longer the pause or delay between the server. Which obviously increases the lag.

Given the restrictions above, there really isn't anything I can do to improve this. We just don't have many tools to accurately work with BattlePets in the Mailbox and Guild Banks. The tools we do have require client/server interactions and that increases response time and thus causes lag depending on how many BattlePets are being processed. No real way around this problem at the moment.

I wish I had better news but it's completely out of my hands. Regardless of what method is used some form of complete loop would be required to grab the needed information, or at worse a client/server response to get the appropriate date. If Blizzard transmitted the BattlePets links just like every other ItemID links or Itemlinks in the game, there wouldn't be this problem. However, I don't understand why they treat all BattlePets as [Pet Cage] when there is a server interaction, it's completely baffling.

BTW if you did have Accurate Battlepets enabled, there was a warning next to that option and the explanation was provided under the BagSync FAQ section in the config window.

commented

As I stumbled upon "slight lag" in your previous post: Not that it changes anything, but just to make it clear, I am not speaking of slight lags. These are delays up to several seconds per pet mail (!)

Two things though have improved since the issues first came up:

  • I get no longer the OS cursor that indicates that the WoW client is not responding (as mentioned here).
  • At the beginning, the delays were often accompanied by complete UI knockouts (all UI elements disappear after a min framerate has been reached, until reload), this is no longer the case too. Framerate is still completely down, but UI remains.

This might be a sign that they are somehow working on it.

commented

Sorry for my late reply.

there really isn't much I can do

Considering that virtually every pet-related tooltip (not only by BS) produces these delaying scan tooltips, I had expected an answer like this. Also arkayenro from ArkInventory has already made efforts in regards to this or similar issues. (I stopped using AI somewhere back then, so I don't know if he was successful after that.)

Many thanks for your detailed explanation.

Yes, I had Accurate Battlepets enabled. I disabled it now, but for today I have already retrieved my AH pet mails. I will report back tomorrow or at latest in 48 hours, after AH expiry.

A thing I forgot to mention is that this issues started only with 10.0.0 or 10.0.2 (or shortly before or in-between that). But I think this was clear anyway.

Well, actually for me the issue isn't as dramatic as I presented it, because when the issue came up I have created a series of small buttons that allow me to toggle the tooltips of BS, TSM, Armory, Stash, Altoholic, ArkInventory and BattlePetBreedID with one click, selectively or all. But anyone who hasn't such a workaround really has a problem with retrieving pet mails. (And even with all tooltips disabled, there is still a noticeable delay, compared to pre-10.0.)

Thanks again for your informative answer.

– Tom

commented

Please note that disabling "Accurate Battlepets" will not provide 100% accurate BattletPet tracking. It will default to alternative methods and comparing iconTextures is not very accurate. This was explained in the FAQ explanation and from my message above. So keep that in mind when your counts don't match exactly for certain pets.

commented

Please note that disabling "Accurate Battlepets" will not provide 100% accurate BattletPet tracking.

Sure, I have enabled it again already. Will disable it next time when I have the mail box full of pets, to see if it makes a difference.

commented

Oh also the reason for the 10.0.0 or 10.0.2 difference is because they increased the server delay when gathering tooltip information. Also they revamped the tooltip system between those patches as well.

commented

I wish I had a better answer for you in regards to this issue. I hope I explained it in a way that demonstrates the restrictions imposed on us at times as addon authors. Perhaps they will change this in the future and give us more information in regards to BattlePets. For the moment though, you may have to deal with some slight lag when working with large quantities of them at least when the Mailbox and Guild Bank are concerned.

commented

Oh also the reason for the 10.0.0 or 10.0.2 difference is because they increased the server delay when gathering tooltip information. Also they revamped the tooltip system between those patches as well.

Well, then I guess the first point is responsible for the generally increased delay when retrieving mails with item attachments, and the second one for the fatally increased delay when the attachments are pet boxes and we have item/pet-related tooltips active…

commented

Sorry for the delay. I suspect a lot of the delays you are experiencing in TSM is two fold. First they use a looping system to detect the highest frame in the tooltip with priority, so it has to loop through that. Secondly, while it does that it has to wait for a response before it totally displays. Now I can't recall if they are using the old hook method to scan tooltips (which is extremely slow and CPU intensive) or they are using the new functions that Blizzard provided to scan tooltips. The newer format automatically passes the tooltip lines in code so you don't have to scan it. That still requires you to ask for it though using an item call, but considering TSM has to wait, it's probably delaying it. BagSync waits for the tooltip function to be executed before populating the tooltip. This lowers the strain on the tooltip call and then populates from either the DB or a cache. It only does this once for each tooltip no matter how many times it's redrawn on the screen.

Still thanks for taking the time to look into this. It does help get a better idea of how the other addons are performing. Perhaps one day Blizzard will make it easier to add stuff to the tooltip in a more structured way for addons in the future.

commented

Just a (final) follow-up, with maybe some useful info for other pet traders plagued by these delays:

It turned out that by far the worst offender (= main contributor to the scan tooltip delays) is in fact the TSM tooltip (followed by BattlePetBreedID). With a really pet-filled mailbox (i.e. about 100 pets) the UI becomes almost unresponsive. Delays range from 4 seconds or more to a near freeze. Even closing the mailbox becomes a problem. Fortunately, this can be solved relatively easily by setting a modifier key for the TSM tooltip.

But even without the TSM tooltip, delays in the range of approx. 1 to 2 seconds will still occur, depending on the number of tooltip-contributing addons, number of pet-cage mails, and probably also server conditions.

So I finally had the glorious idea to make a tiny addon that rigorously disables all tooltip additions as soon as the 'PLAYER_INTERACTION_MANAGER_FRAME_SHOW:17' event fires, and restores the settings on the corresponding HIDE event.

Currently this includes the tooltips of: TSM, BattlePetBreedID, Armory, BagSync, Stash, ArkInventory, Oribos Exchange, ATT, ItemVersion, Auctionator, Journalator.

With that, I'm down to about a 0.5 second delay per pet mail, and non-pet mails are super fast. So it seems that disabling the tooltip of any single addon (except TSM) doesn't give any noticeable improvement, but disabling them all does.

(I've also experimented with hooking into GameTooltip and BattlePetTooltip and hide them, but this doesn't seem to speed up things much, if at all.)

– Tom