unitscan

unitscan

527k Downloads

Delayed notification of unit found

Hmmintriguing opened this issue ยท 8 comments

commented

Not sure when this started occurring as I only began re-using unitscan this last week, but whenever I add a new unit, and I am directly looking at said unit, unitscan takes 5 - 10 seconds to react and show me the message that it found the unit.

I have tried turning off every other addon I have and only have unitscan enabled, and the problem is still occurring.

I am not getting any LUA errors in regards to unitscan, so is this delayed notification an intended mechanic now?

This is happening on Season of Discovery, patch 1.15.1, as well as Classic Era, while using the newest unitscan v1.2.3.

commented

If that's the case, then I'll definitely revert back to using an older version.

Should I use 1.1.7, or 1.1.6 (according to the change log, you introduced async scanning on version 1.2.0)?

commented

1.1.7 is like 1.1.6 but with the latest wow client version. (Actually published it by accident without async scanning but that works out well now.)

commented

The change was a few months ago, perhaps you just hadn't updated. Someone complained that after adding a lot of scan targets there are lag spikes from the scanning, so I changed the implementation to make the scanning spread out over time, which is the only alternative. When you have only a handful of targets the delay is actually smaller than before, but when you add dozens it will inevitably grow noticeable and you must have like a hundred.

commented

Yes, I have at least 200, if not more, scans, which I do need because I PvP a lot and being able to see people as soon as they phase into my LoS is extremely helpful.

When I was using unitscan on a day to day basis 4 - 5 months ago, I also did notice that my FPS would drop dramatically in cities, when it is populated with players, but that was not an issue for me since I would never stay very long in cities.

So I suppose I have to delete all my scans and just start fresh? I will say that when I was using unitscan previously, whenever I would add a scan and unitscan found said unit, it would display the notification immediately, within milliseconds, and this was with the 200+ scans I have.

commented

Previously it was checking all targets every 0.1 seconds, now it checks around 15 targets per second. You can try reducing this constant near the top of the unitscan.lua file to 0:
local SKIP_UPDATES = 3
This will increase the speed of processing the targets but it might also reintroduce some lag. If this doesn't introduce back noticeable lag for you I might make it the default. I would expect that setting it to 0 will result in an average scan delay of around 2 seconds with 200 targets.

commented

I'll give that a shot and see how the performance is and the speed it is able to find a scan.

Thank you

commented

So, with the 200+ units I had in my database, I tried putting the update request to 0, and it still took roughly 2 - 4 seconds for unitscan to search the name and display the notification.

I have since deleted every single unit I had and will now keep my list extremely limited to prevent unitscan from taking additional time to scan a name.

It would be nice if unitscan would be able to function like it did back in October - November of 2023, but I understand if multiple people are complaining about FPS / lag issues, then I suppose there isn't any other solution than what you have done for the current version.

Thank you for the advice & for unitscan itself.

commented

I've updated it, making no skipping the default. Of course we could also try to introduce more synchronous scans on each update and see how that affects the performance, but I think it will probably be fast enough for most users. To get the old scanning you could use version 1.1.7 from curse (there is no other reason to upgrade).