+ Reply to Thread
Results 1 to 13 of 13

Thread: Buff Sequencing

  1. #1
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default Buff Sequencing

    In my buff icons gadget, I've been trying (with very limited success) to match the order that buffs are displayed in the default UI.

    As it seems to be a bit random, and the order in the default UI changes when you /reloadui, I've come to the conclusion it might not be possible to get a perfect match.

    Assuming this is the case, is there any data on a buff that I could use to determine which buff would be purged next? I was thinking I could use the begin time, but I think that is always zero for buffs that were in existence before the UI loaded, so can't be relied on.

    Gadgets: Unit Frames and Other Stuff for RIFT

  2. #2
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Note - just adding buffs to the list in the order they are added (Event.Buff.Add) results in a negative sequence on login, and complete randomness on reloadui.

    And when one buff triggers another, we seem to get them in reverse order compared to the UI.

    *confused*
    Last edited by DoomSprout; 08-21-2012 at 10:56 PM.

    Gadgets: Unit Frames and Other Stuff for RIFT

  3. #3
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    You're on the right track with buff.begin field, except you want to work this out yourself. You can do this via Inspect.Time.Real() space or Inspect.Time.Frame() space.

    ActualBegin = Inspect.Time.Real() - (buff.duration - buff.remaining)

    You'll probably need some extra checking before that calculation to account for any strange values that would cause errors. Look at buff.expired field to filter certain buffs from display/calculation. Also note buff.duration and buff.remaining can also be nil.
    Rank 76 Guardian Mage

  4. #4
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Semele View Post
    You're on the right track with buff.begin field, except you want to work this out yourself. You can do this via Inspect.Time.Real() space or Inspect.Time.Frame() space.

    ActualBegin = Inspect.Time.Real() - (buff.duration - buff.remaining)

    You'll probably need some extra checking before that calculation to account for any strange values that would cause errors. Look at buff.expired field to filter certain buffs from display/calculation. Also note buff.duration and buff.remaining can also be nil.
    D'oh, why didn't I think of that? Thanks Semele, I'll give that a go

    Gadgets: Unit Frames and Other Stuff for RIFT

  5. #5
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Sadly, it doesn't make any difference with the sequencing. It works for calculating the actual creation time of the buff, but this still doesn't actually match the order of buffs in the default UI.

    I've come to the conclusion it can't be done. If a login and a reloadui result in different ordering in the native buff list, and the sequence of events doesn't match the sequence of buffs, what chance do we have?

    I just tried adding a new buff (adds onto the left side of the native buffs). Then /reloadui, and the new buff is on the right. I'm not sure which buff would be purged first, but it it's LIFO, this buff should be the first to go, despite being over on the right.

    Not going to worry about it for now, though if I can confirm the rules for which buff gets purged first, that might help with coming up with an alternative PvP-friendly sort order.

    Gadgets: Unit Frames and Other Stuff for RIFT

  6. #6
    Ascendant
    Join Date
    Dec 2010
    Posts
    1,868

    Default

    Quote Originally Posted by DoomSprout View Post
    I'm not sure which buff would be purged first, but it it's LIFO, this buff should be the first to go, despite being over on the right.

    Not going to worry about it for now, though if I can confirm the rules for which buff gets purged first, that might help with coming up with an alternative PvP-friendly sort order.
    It's FIFO, dev confirmed it a while back. Tested it myself to be sure.

  7. #7
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by AlienFromBeyond View Post
    It's FIFO, dev confirmed it a while back. Tested it myself to be sure.
    Oh, so it's actually the buff on the right you'd expect to lose first when purged? That's the opposite of what I expected (can you tell I'm not a PvP-er? ).

    The same logic applies though - if I consistently sort by the time the buff was added, it might not perfectly match the order of the native buffs, but it should be just as effective. Given that the native buffs re-sequence themselves on a reload, buffs that were applied before the reload can't consistently be purged right-to-left every time.

    Gadgets: Unit Frames and Other Stuff for RIFT

  8. #8
    RIFT Guide Writer usman's Avatar
    Join Date
    Dec 2010
    Posts
    1,319

    Default

    Buffs are purged in a first on is first off format, its a simple as that.

    If what you want to acheive is to keep a certain buff protected from being purged, then the information you need is , how many buffs are left of the ones I received prior to the one that I care about, and also how many more buffs have I received since then - ie is it a good time to recast my important buff so that it remains protected.

    Hope thats makes sense
    Ambi - Cleric - Apotheosys.


  9. #9
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Yep, it makes sense, thanks

    From what everyone's saying, I think the way I've got it working in my dev environment is actually more consistent than the native client. I have no way to test purging unfortunately, but here's what I'm seeing (native top, Gadgets bottom):

    I login:

    Buff Sequencing-screen1_first-login.png

    This appears to be fairly random so far...

    I cast Pyromancers Armor, Flaring Intellect, Glyphs of Power, and the end result looks like this:

    Buff Sequencing-screen2_apply3buffs.png

    The buffs just cast are correctly sequenced so that the rightmost of the new buffs will be the first to go on both the native and Gadgets panel, as expected

    I /reloadui:

    Buff Sequencing-screen3_reloadui.png

    Now the Gadgets panel has retained the same sequence as before, while the native UI has flipped the sequence. I believe at this point Gadgets is actually more accurately reflecting the purge sequence (sadly I can't test this).

    I logout and log back in:

    Buff Sequencing-screen4_logoutlogin.png

    It looks like certain of the environmental buffs got reapplied, so the sequence is different, but I still think the Gadgets sequence is closer to retaining the correct order, as the oldest of the buffs I applied is still to the right of the others.

    Given this, I'll leave my current logic in place ready for the next release.

    Gadgets: Unit Frames and Other Stuff for RIFT

  10. #10
    Ascendant
    Join Date
    Dec 2010
    Posts
    1,868

    Default

    Looks more than close enough to me, nice work! With that and the fix on the outlining issue I think you've got pretty much everything a player would want in the addon now.

  11. #11
    Ascendant
    Join Date
    Oct 2010
    Posts
    2,229

    Default

    Quote Originally Posted by usman View Post
    Buffs are purged in a first on is first off format, its a simple as that.

    If what you want to acheive is to keep a certain buff protected from being purged, then the information you need is , how many buffs are left of the ones I received prior to the one that I care about, and also how many more buffs have I received since then - ie is it a good time to recast my important buff so that it remains protected.

    Hope thats makes sense
    It is not always as simple as that.. Test that in conquest and you will see it does not always follow that 100%... I know how it works and most of the time it does just not always...
    Last edited by Undrsiege; 08-22-2012 at 05:12 PM.
    Quote Originally Posted by Foxcalibur View Post
    "bros to come at me!"

  12. #12
    Ascendant
    Join Date
    Oct 2010
    Posts
    2,229

    Default

    Quote Originally Posted by DoomSprout View Post
    It looks like certain of the environmental buffs got reapplied, so the sequence is different, but I still think the Gadgets sequence is closer to retaining the correct order, as the oldest of the buffs I applied is still to the right of the others.

    Given this, I'll leave my current logic in place ready for the next release.
    I think when you log off and then log back on the buffs are reapplied as they do not expire while you are offline.. When you log back on and they are reapplied is it doing them alphabetically or some kind of pattern.

    It looks like Soul tree power...

    Glyphs of Power - 6
    Flaring Int - 20
    Pyromancers Armor - 21
    Last edited by Undrsiege; 08-22-2012 at 05:22 PM.
    Quote Originally Posted by Foxcalibur View Post
    "bros to come at me!"

  13. #13
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Undrsiege View Post
    I think when you log off and then log back on the buffs are reapplied as they do not expire while you are offline.. When you log back on and they are reapplied is it doing them alphabetically or some kind of pattern.
    Nope, what it's doing is using part of the buff's unique ID to sort by. Every time a buff is created in the game, it is given a unique ID, which happens to be incremental. This means I can use it as a very simple and consistent indication of which buff was created first.

    The order only changes on logoff/logon for buffs like Prismatic Glory, Wardstone Attunement, etc - buffs created by things in the environment around you. I assume these get reapplied by the game on login so they get a new ID generated, while the player cast buffs retain their original ID.

    Those 3 buffs are retaining the order in which I cast them, which is the order they happen to be on my action bar. I'm pretty sure it's all working how I want it to work. It's consistent, it remains the same through reloads and logins, and the order should reflect the purge sequence as accurately as it is possible to do so.
    Last edited by DoomSprout; 08-22-2012 at 11:28 PM.

    Gadgets: Unit Frames and Other Stuff for RIFT

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts