Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animation Timing and Events

Moose Pegler
Registered User
Join date: 22 Apr 2006
Posts: 33
11-26-2006 14:43
For animations that aren't loops, is there anyway to determine in the script that activates the animation when the animation ends?

For example, if I have a 20 second animation and set a timer event for 20 seconds just before I launch the animation, how close will the timer event and the visual end of the animation be? Milliseconds apart? Tenths of seconds apart? Seconds apart?

If this works in any practical sense, then here's where I'm really headed.

We launch the 20 second animation and 5 seconds in the av decides it wants to do B rather than where the launched animation is heading, A. The av provides input the running script saying "Do B".

The script knows that the starting pose of B is equal to the pose at frame 12 seconds in animation A. Script sets timer for 7 seconds, the timer goes off, we stop the A animation and launch the B animation. There is no "hopping up" behavior because the pose doesn't change.

The fervent hope is that in this way (or some way like it) we can build animations with choice points or branches that flow gracefully and seamlessly from one animation to another and stop all this hopping around.

Thanks in advance for any insights and advice.

Cheers, Moose
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
11-26-2006 15:03
From: Moose Pegler

We launch the 20 second animation and 5 seconds in the av decides it wants to do B rather than where the launched animation is heading, A. The av provides input the running script saying "Do B".

The script knows that the starting pose of B is equal to the pose at frame 12 seconds in animation A. Script sets timer for 7 seconds, the timer goes off, we stop the A animation and launch the B animation.

This wouldn't be practical because of lag. Even though the script might trigger both at the same time, the timer could start much earlier than the animation because lag delays the start of the animation.

Morover, your thinking is flawed. In particular, it is fighting interactivity. Taking the quoted example, I would much rather a hop from one animation to the next than a 7 second wait after hitting the button. Interactivity basically requires immediate reaction, and to get that with a branching list of pre-scripted animations would require an infinite number of animations.

Flowing seamlessly from one animation to the next is a huge challenge, and the best systems for this are coded specifically for the application, with a complex AI controlling the character. Like, the character has to know that "if I'm currently doing A, I have to do B to get to C." Plus, the movements are partially or entirely created procedurally (ie. the computer generates the movement at run-time, rather than playing a preset animation.)

In the meantime, the best global solution is the one SL already uses, using a blend over time to smooth the change from where the bones were in the last animation to where they are in the new one. If it looks like the av is hopping around, the animator probably just didn't set the ease in/out when uploading the animation. This doesn't work for extreme changes in pose, but for most animations the transition is smoothed quite nicely.
_____________________
(Aelin 184,194,22)

The Motion Merchant - an animation store specializing in two-person interactions
Maker Mu
Registered User
Join date: 18 Oct 2006
Posts: 14
11-27-2006 12:38
From: Johan Durant
Morover, your thinking is flawed. In particular, it is fighting interactivity. Taking the quoted example, I would much rather a hop from one animation to the next than a 7 second wait after hitting the button. Interactivity basically requires immediate reaction, and to get that with a branching list of pre-scripted animations would require an infinite number of animations.


Is the thinking really flawed or is the timing of the example distracting? If it was 7 frames rather than 7 seconds does it make more sense?

Interactivity doesn't mean instant reaction, interactivty is as much about the simulation as about the responses; the ideal is to find a balance twixt the two. Moose's idea isn't off the wall.

Quite a few years ago, I had a business making Microsoft Agents. MS Agent uses branch states with pre and post animations and exit handling that allows you to route to a specific alternate animation or branch to a later frame if the current one ends mid animation. I think the animation editor for that is still downloadable, looking at what it offers may be a useful reference for you, Moose.

But without even AnimationStarted or AnimationStopped events, getting SL to do smooth transitions seems like a steep hill to climb.