MoriceD3 / D3ROS-ArreatCore

8 stars 10 forks source link

Pet Count #83

Open Lentice opened 10 years ago

Lentice commented 10 years ago

If we have enought pets exist, do not call new pets again. Because I am only familiar two characters, currently support skills: DemonHunter_Sentry, Witchdoctor_Gargantuan, Witchdoctor_SummonZombieDog, Witchdoctor_FetishArmy.

If two skills are using at the same time, one may be missed but its timer was re-initailled. Big delay will cause the missed skill to be used again long time later. To solve that, I change the delay to small value. Using skill is determind by IsPowerReady() in launch_spell(), so we are not afraid that Skill Key is pressed too offent.

Ano69 commented 10 years ago

Hi,

For the moment this is not really possible to do this correctly as since patch 2.0.4 IsBuffActive does no more work.

Until someone find a correct way to check this, this would lead to way too many memory reads that will causes problems on low end computers

Lentice commented 10 years ago

Yes, IsBuffActive is not work anymore, but IsPowerReady still work and its operation is brief. I though even the IsBuffActive can not detect whether the number of Sentry reach the maximum value in current screen. That's why I write CheckActorNumber. But you are right CheckActorNumber is not fast, it may take about 35 ~ 65 ms. :(

Ano69 commented 10 years ago

The main concern is about too much memory access crashing too :( There was problems with the zone detection done too often too.

I suppose for now a correct way would be to add a caching layer to CheckActorNumber or a minimal time before it does the scans, but if the users have 2 spells with this if will generate way too much scans for a small benefits. One scan every 2 or 3 seconds is way enough for this needs.

Lentice commented 10 years ago

Maybe I can count the pets during IterateFilterAttackV4(). That will reduce more time. :)

Ano69 commented 10 years ago

Not that simple to handle all different range and pets without slow loops ;)