pepopo978 / nampower

Dramatically increase cast efficiency on the 1.12.1 client!
Other
5 stars 1 forks source link

It breaks QuickHeal somehow #18

Open greendam opened 1 week ago

greendam commented 1 week ago

Tested with this and original nampower can confirm this is the cause. No idea how but it causes issue on QuickHeal to cast rank 1 lesser heal even when no one needs heal and cast renew on the same target repetitively.

pepopo978 commented 1 week ago

Can you plz upload the relevant nampower_debug.log

It relies on SpellTargetUnit to work with mouseover addons need to see how that is getting called by quickheal

greendam commented 1 week ago

nampower_debug.log

pepopo978 commented 1 week ago
[DEBUG]146088: Attempt cast Lesser Heal item 00000000 on guid 17379391981106969133, time since last cast 1800
[DEBUG]146090: Attempt cast Flash Heal item 00000000 on guid 17379391981106969133, time since last cast 1802
[DEBUG]146091: Spell target unit raid5 guid 4215797
[DEBUG]146094: BeginCast Flash Heal cast time: 1471 buffer: 55 Gcd: 1500 time since last cast 1806

[DEBUG]147744: Attempt cast Lesser Heal item 00000000 on guid 17379391981106969133, time since last cast 1650
[DEBUG]147746: Attempt cast Flash Heal item 00000000 on guid 17379391981106969133, time since last cast 1652
[DEBUG]147747: Spell target unit raid13 guid 1903247
[DEBUG]147749: BeginCast Flash Heal cast time: 1471 buffer: 55 Gcd: 1500 time since last cast 1655

[DEBUG]149611: Attempt cast Lesser Heal item 00000000 on guid 17379391981106969133, time since last cast 1862
[DEBUG]149613: Attempt cast Flash Heal item 00000000 on guid 17379391981106969133, time since last cast 1864
[DEBUG]149614: Spell target unit raid11 guid 3729399

it seems like you are casting 2 different spells at basically the exact same time is that how quickheal normally works? I'm not familiar with it

pepopo978 commented 1 week ago

Pretty sure this is why

elseif (event == "SPELLCAST_STOP") or (event == "SPELLCAST_FAILED") or (event == "SPELLCAST_INTERRUPTED") then
        -- Spellcasting has stopped
        StopMonitor(event);    <--------- this sets QuickHealBusy  to false

       .........

-- Only one instance of QuickHeal allowed at a time
    if QuickHealBusy then
        // don't try to cast again
    end
My nampower relies on cancelling your current cast early.  I think quickheal needs to be rewritten to work with it
geojak commented 5 days ago

The lesser heals seen in the log are the check spells used by quickheal to determine if a target is in Los and range. If it gives an error (error message is supresed in ui) then quickheal tries healing another target instead.

These checkspells need to be ignored by nampower, no quening, no retry if failed.

If the checks spell was successfull (no error from the client) then it gets canceled in the same frame, quickheal is set to busy and the actual wanted spell like flash heal is cast. This second spell we do want to queue and retry if failed...

Basically we need some casts to be ignored by nampower and some others be queued and retry if failed. Similar to the libram issue we discussed, a wrapper and exlcuion wrapper could be extremely useful to fine tune here what to queue and retry and what not

pepopo978 commented 4 days ago

ah i see that makes a lot more sense. I don't see how ignoring the lesser heal can work with queuing because you will need to not be casting anything to try the lesser heal? So then flash heal is just gonna get cast without queuing.

You can already turn off the appropriate cvars just when you are casting lesser heal if you wanna try (target out of range / LOS won't trigger a retry ever):

/run SetCVar("NP_QueueCastTimeSpells", "0")
/cast Lesser Heal
/run SetCVar("NP_QueueCastTimeSpells", "1")

I can add a DontQueueSpellByName also.

I am currently working on IsSpellInRange / IsSpellInLOS functions that would be a much better solution.

BTW I already added the QueueScript wrapper.

geojak commented 4 days ago

ah i see that makes a lot more sense. I don't see how ignoring the lesser heal can work with queuing because you will need to not be casting anything to try the lesser heal? So then flash heal is just gonna get cast without queuing.

You can already turn off the appropriate cvars just when you are casting lesser heal if you wanna try (target out of range / LOS won't trigger a retry ever):

/run SetCVar("NP_QueueCastTimeSpells", "0")
/cast Lesser Heal
/run SetCVar("NP_QueueCastTimeSpells", "1")

I can add a DontQueueSpellByName also.

I am currently working on IsSpellInRange / IsSpellInLOS functions that would be a much better solution.

BTW I already added the QueueScript wrapper.

I didn't think of changing the cvsrs inside the quickheal code. Thank you for the idea! I give it a try.

With quening and retry turned of, the newest nampower pepopo works as well as the old 1.0 I think.

geojak commented 4 days ago

first tests seemed to be very promising image

pepopo978 commented 2 days ago

just added CastSpellByNameNoQueue to make things easier

geojak commented 2 days ago

testing it now image

works aswell as turning them cvars on and off but less debug_log spamm