Avastar Animation Priorities

Which animation will play out of several is determined by two rules – the animation with the highest priority wins, and amongst the ones of equal priority which one was started last wins.

But which animation priority to choose?

   

The Situation

Which animation will play out of several is determined by two rules – the animation with the highest priority wins, and amongst the ones of equal priority which one was started last wins.

But which animation priority to choose? It seems the ideal is something like this:

  • p0,p1 –  ‘body noise’ (small twitches and movements to add some realism) and background animations.
  • p2 – AO and long running animations. Apart from a few special cases, what you want to override in an AO is just the background.
  • p3 – Any temporary animation that should make the character do something – gestures, poseballs etc. Again all you really want to do is play the animation over the characters defaults.
  • p4 – Things that should override everything else including situational animations such as poseballs. Ideally this would only affect a few bones and only for a short time.

Some of the default animations and their base priorities

For example: an animation of drinking from a cup of coffee. You could imagine someone drinking a coffee while sitting at a table, or a similar animation while standing around, or even drinking and walking. Really, all you need to animate is the arms and head and you want to do this regardless what else the character is doing. Think about it – if you have a hot cup of coffee in your hand I bet that will be foremost in your mind! So it makes sense to set those few bones to p4. If the sitting animation is at p3 from a poseball it would override the AO as expected, and the coffee animation would override the arms and head and everything would mesh nicely. It would also work with standing and walking and everyone is happy.

So much for good intentions. There are two problems that have left animation priorities in a complete mess.  One is that there has been very little guide as to what priority to choose and there is a tendency to think higher is better.

The other problem is that SL runs a bunch of internal default animations (“viewer generated motion”) and the priorities of these can be as high as p3 (see here),  and you have no option but to run these (see the image on the right, note that the reported priority is the base priority only).  There is also a whole lot of built in animations that can be triggered via scripts too and these have various priorities.  Take a look here for more details. To complicate matters further, animations can have priorities on individual bones that are higher than the base priority that is reported and the animation priority is immutable – once uploaded it can’t be changed.

Through ignorance or in attempts to override the base and other animations, many animations are now set way too high. The situation today is that even large reputable animators sell AO standing animation at p4. In the coffee example this would be an idiot that is so obsessed with how they are standing that they would prefer to scald themselves than break ‘the look’ :). The result is that to interact with the rest of SL you have to constantly switch off your AO, to the point that the AO on/off switch is usually the most prominent UI element in any AO.

It gets worse. The other rule is that the last run animation will beat other animations of the same priority. So what are you to do if everything is already at p4? Simple! Create a script that continually refreshes your animation. So what do you do if you want to override that? Again easy – create a script that refreshes your animation faster than the other one. So now you can have a situation where your character gets jerked around crazily while animations battle for supremacy, and the most lag-inducing scripts get rewarded.

What can you do? Create animations at a sensible level! Use the guide above and think carefully about what you are doing – play a few scenarios through you mind and see how various animations would mesh together. Sometimes there are tricks you can play like killing a default animation via a script in a pose ball. Consider creating sets of animations at different priorities for your customers, this way the choice is up to your customers. Put the priority as part of the name so people are more aware of the priority and how different animations will play together. If you are designing an AO, why not build in a ‘mutable’ priority by using multiple animation at different priorities and a UI element that can switch between them? Finally you can requesting that LL make animation priority changeable, or to lower the priority of the default animations. There’s no reason a non-user controlled animation has to run at priority lager than 1 (this gives two layers to the defaults, ta take care of unusual cases). Or at the very least to improve the default animations which are awful.

Always think about what a character will be doing when running your animation (both your intentions and how your animation could get used out of context). Construct likely scenarios, then choose the lowest priority you can get away with so your animation will play nicely with others.

Priorities in Avastar

Priorities in SL can go higher than p4. This limitation is imposed by the default BVH import routine not by what SL can support. So what does Avastar bring to the table? If you are exporting via BVH then it’s the usual story – you get base priorities 0-4 and no bone priorities.  However, if you are exporting animations via the anim format then we support SL’s animation format to a much greater degree. You can use per-bone priorities, and the priorities can be from p0 to p6.

In order to upload animations in the anim format you will need to use a patched viewer.

Per-bone priorities

Each SL and rig bone has an attribute called ‘priority’ that is set to -1 by default. The exported bone priority will be the SL bone’s priority if that is higher than -1 otherwise it will be the rig bones priority. This means you can ignore the SL bones and just set the bone priority on the rig bones, but if you need to remove the rig for some reason you will still have access to bone priorities.

A value of -1 is interpreted by the viewers as ‘take the base priority’. Any other value (including 0) will override the base priority for that bone.

Priorities higher than 4

Thinking of uploading a priority higher than p4? Think carefully about this and if you can get away with a lower priority. You are more likely to annoy your customers that help them with a high priority animation. In general, p5 animations should only be temporary and for a few specific bones, and p6 should be considered only for very extreme situations. Read the rant above again, on the mess we’ve gotten into. Now read it once more. Still happy? Go for it.

Note that the avatar posture when editing your shape is a p5 animation. If you are running a p6 you will not see a change of posture.