WeakAuras

WeakAuras

206M Downloads

Automatic Condition/Custom Text Throttling

Peter-Day opened this issue ยท 5 comments

commented

Is your feature request related to a problem? Please describe.
I was looking into creating an aura to track the root healths on Tindral. I wanted to make it track health without needing to update off the nameplate units, so I would need to track a lot of combat events. I wanted to make sure the Aura wasn't more costly on resources than it needed to be, so I wanted to see if I could calculate a % health using a custom condition rather than each time a damage event updated the state for that root.

In digging into this issue, I discovered that when you update a state multiple times in a frame, things like custom text or conditions (custom or otherwise) would be calculated each time I updated the state.

Describe the solution you'd like
I would like text and conditions to be evaluated only once per frame, even if updated multiple times. It would make many auras more efficient, particularly in the times where lag is most a problem due to things like encounter design. I recognize there could be reasons I'm overlooking that could make this change a nonstarter, but I wanted to throw it out there so you all could consider it.

Describe alternatives you've considered
If you want to calculate things only once max per frame with your own event-based TSU, I can't think of any great solutions. If you don't know how many events are coming in, the best you can do is update necessary information on the events themselves, then also have an every frame function that will do the extra calculations for things like conditions. Or just let the condition functions run every time.

Additional context
Some auras will be broken by this change if they do extra calculations in these functions that require being run on every state update. I am not sure if those are use cases that need preserving.

commented

%c with a every frame update, updates every frame.

commented

I'm not looking to update every frame, I'm looking to not update more than once every frame. But I understand if you think it's not a good change.

commented

#790 contains some more discussion of a similar ask if you're curious.

commented

I would like text and conditions to be evaluated only once per frame,

That's exactly what every frame update does. You can do whatever you want in that code, even checking whether anything has changed.

commented

You can do whatever you want in that code, even checking whether anything has changed.

Yeah that's fair.