Ovale Spell Priority

192 - Support for explicit energy pooling (and other pooling)

What is the enhancement in mind? How should it look and feel? In our experimental Feral script for SimulationCraft we have determined that it is a significant dps improvement to pool energy at specific times. While this script is not currently checked into SimulationCraft, it will be soon so this capability will be needed for Ovale's automatic default script code. Right now, there is a workaround that requires an if/else structure.

Here is an example conditional from the Feral script we have been working on:


Here is how I can code this right now:

if ComboPoints()>5 and TargetDebuffPresent(RIP) and BITWRange() and TalentPoints(dream_of_cenarius_talent) {
    if {BuffRemains(BERSERK)>1.0 and Energy()>25} or {BuffPresent(BERSERK) and BuffRemains(BERSERK) <=1} 
        or {BuffExpires(BERSERK) and Energy()>50} Spell(FEROCIOUSBITE)
unless ComboPoints()>5 and TargetDebuffPresent(RIP) and BITWRange() and TalentPoints(dream_of_cenarius_talent) {
    # the rest of the rotation follows

There is one nuance associated with this - which is while it is energy pooling I want to show the spell that is being pooled for with a countdown. I think I can accomplish this with the if/else structure, but if there is a way to do something in a simpler way it would be very helpful (so I don't have to restructure my code).

I was thinking that a simple way to address this is to have a command that halts execution at the current point and restarts at the top of the script, perhaps with a time for how long to hold off ("RestartExecution" for lack of a better name). I think this would satisfy my icon needs also, since the last viable Spell would be the one right before the "RestartExecution" command. I would envision it looking like this in the code:

if ComboPoints()>5 and TargetDebuffPresent(RIP) and BITWRange() and TalentPoints(dream_of_cenarius_talent) {
    if {BuffRemains(BERSERK)>1.0 and Energy()>25} or {BuffPresent(BERSERK) and BuffRemains(BERSERK) <=1} or {BuffExpires(BERSERK) and Energy()>50} Spell(FEROCIOUSBITE)

    # sleep .1 seconds and restart execution at the top of the script. FEROCIOUSBITE should be displayed with a countdown
# the rest of the rotation follows

Notice that this does not require major code restructuring to use and could be used for pooling any resource type, or even waiting for something to come off of cooldown. There are cases where people try to sync up cooldowns and this might help code those.

User When Change
jlam Dec 13, 2012 at 04:07 UTC Changed status from Accepted to Fixed
jlam Nov 30, 2012 at 03:16 UTC Changed status from New to Accepted
jlam Nov 30, 2012 at 03:16 UTC Changed assigned to from Sidoine to jlam
Leafkillr Nov 28, 2012 at 00:05 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of jlam jlam Dec 13, 2012 at 04:06 UTC - 0 likes

    This concept has been implemented in Ovale 5.1.5 with the "wait" statement.

  • Avatar of jlam jlam Nov 30, 2012 at 13:36 UTC - 0 likes

    I'm looking at the documentation pool_resource. It seems like using the for_next version pool_resource is what you really want instead of duplicating the conditions between actions.

    That version of pooling, where you pool explicitly for the next listed action, can probably be implemented with a new Ovale condition that can be inserted into an if clause.

  • Avatar of Leafkillr Leafkillr Nov 30, 2012 at 08:09 UTC - 0 likes

    @jlam: Go

    Here is one of four snippets from simc that show what I am looking for. Here the script is trying to pool energy to 50 (25 if Berserk is up) before casting Ferocious Bite with 5 combo points during the BitW phase. It only applies this if the feral is using Dream of Cenarius as it is dps neutral for ferals using other talents.


    Note that it will stop pooling for a variety of reasons based on the if clause, so what is needed is not pool to n, but rather pool while the if clause is true. Since this pooling will only happen if the FB action that follows has an if clause that evaluates to true, then your idea of looking at what follows for what to display will work for my use case.

  • Avatar of jlam jlam Nov 30, 2012 at 06:11 UTC - 0 likes

    No, that's not it. Energy pooling is easy to implement. I make a new action "PoolEnergyTo(N)" that is ready "now" unless energy>N. Then if you have:

    if ConditionOne() PoolEnergyTo(50)

    If there is stuff in ActionsBeforePoolCondition() that are also ready "now", then they'll have higher priority than PoolEnergyTo() because they appear earlier. After ConditionOne() is true and energy>50, PoolEnergyTo(50) returns "not ready" so the script falls through to ActionsAfterPoolCondition().

    That's a very simple way to implement energy pooling. What I'm asking is how do figure out what display while energy is pooling. It could be really be anything in ActionsAfterPoolCondition() depending on the conditions for the actions. For example:

    if target.DebuffExpires(rip) Spell(rip)

    In this example, suppose you 25 energy. If Rip has 10 seconds left, then you'd want the script to show the upcoming FB while pooling energy to 50. However, if Rip has only 2 seconds left, then you'd want to show the Rip that you have to put up after you've pooled 50 energy.

    Do you see what I'm trying to point out?

  • Avatar of Leafkillr Leafkillr Nov 30, 2012 at 05:02 UTC - 0 likes

    @jlam: Go

    Actually, the way pooling should work is that the script needs to be reevaluated from the top of the script when it hits the pooling statement and the condition is not met. With the added desire that a specific spell be displayed that is counted down while pooling is in effect, perhaps the easiest way for that would be to include the desired spell as a parameter. Something like the following:

    1. pool_resource(feroicous_bite),if=conditionOne&energy<50

    So ferocious_bite would show counting down with whatever time is calculated for when the pooling completes.

  • Avatar of jlam jlam Nov 29, 2012 at 22:46 UTC - 0 likes

    What would hypothetically be showing while we're pooling energy below?

    # pool_resource,if=conditionOne&energy<50
    # ferocious_bite,if=conditionTwo
    # rip,if=conditionThree

    It seems to me that while you're pooling to 50 energy, you also need to evaluate conditionTwo and conditionThree to see which will be higher priority when you hit 50 energy.

  • Avatar of jlam jlam Nov 28, 2012 at 01:47 UTC - 0 likes

    Ovale is designed around the concept of time intervals, and I'm trying to see how to add the concept of energy/resource pooling in those terms.

    There's a bit of a mismatch between SimC and Ovale because SimC is designed from the ground up to be a simulation with a constant tick, so the action lists are a recipe of actions to perform at each tick. For Ovale, for each OnUpdate (frame refresh), each group of actions (things between curly braces) evaluates to the action with the least amount of time remaining, or if multiple actions meet that criterion, then the action listed first. What is means is that Ovale looks at the current game state during each frame and evaluates all of the time intervals stated in the script to see what action to suggest.

    Your suggested ResetExecution() action doesn't really fit into the way Ovale works because it's too imperative. However, the concept of energy pooling is very friendly to being interpreted as a time interval, so I'm sure we can figure out a nice way to implement it explicitly.



Last updated
Dec 13, 2012
Nov 28, 2012
Fixed - Developer made requested changes. QA should verify.
Enhancement - A change which is intended to better the project in some way
Medium - Normal priority.

Reported by

Possible assignees