View Single Post
09-06-08, 07:03 PM   #5
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by Tristanian View Post
Why would you need to set the alpha on a frame 30 times in a second and not just once (let's say OnShow or whenever a condition is met, not necessarily an event). I'm not that much familiar with Blizzard's nameplates, do they use the same frame for every unit (or maybe the same template) ? But to answer your question, it does sound excessive yes.
i will brain dump on this in case someone else runs into the problem someday.

this issue of "why" was indeed one of my questions. this is "legacy" Aloft functionality that i am trying to understand (along with the general frame lifecycles for these underlying Blizzard nameplates, which among other things apparently fire OnShow and OnHide events at times that don't seem to correspond to when they actually become visible as healthbars, if the events fire at all). with Aloft you can set your target's nameplate at one alpha, non-target nameplates at another alpha, etc. i find the feature useful as an end-user, but it is has been problematic as an addon implementor.

as for "the same frame": Blizzard supplies (by default) a dedicated nameplate frame per unit (actually, a healthbar and a castbar, both, associatied with a parent nameplate frame). Aloft re-uses these nameplate frames (mines them out of the Worldframe "children", among other things), and then tweaks them (in terms of texture/color/etc), and adds things (text/event-driven mana bar/etc; myself, i have been working on threat bars). however, Blizzard retains control over their fundamental visibility.

i did some experimenting, with a throttle on this alpha functionality. looks like Blizzard also wants to control the alpha of these underlying nameplate frames. it sets alpha on them effectively as a precondition on every OnUpdate event (as an impending event on the underlying nameplate frame). if you don't override alpha using Aloft, the OnUpdate events are just never hooked, and nothing happens, you get Blizzard's default alpha. if you do override alpha with Aloft, and then you try to throttle Aloft's alpha processing, you get an annoying flicker in the nameplate frames (as Blizzard sets the alpha 30 times a second, and Aloft resets it 15 times a second, or whatever). this becomes increasingly (and very rapidly) apparent the greater the throttle interval you apply (i implemented a slider and fiddled it in realtime).

(these nameplates as Blizzard implements them almost seem like an afterthought... definitely not a full-fledged subsystem designed to permit direct customization. Aloft jumps through all sorts of hoops.)

so basically, yes, i guess you have to (re)set alpha 30 times a second .

Aloft's alpha feature can be disabled, though, which i expect would save a fair bit of overhead. i should benchmark with and without, in a busy environment, and try to quantify that.

anyway, thanks for at least thinking about the problem. i appreciate it.
  Reply With Quote