Saturday, October 13, 2007

A word about animations and "in synch" or "out of synch"

Every now and then I get an IM, normally from club owners to say their dance sets are no longer in synch and could it be the scripts have "gone bad" or something like that, the fact is that seeing a couple set being in synch is actually subjective, they might not be to you, they might be fine to the other 5 people watching including the pair of AV's using the set.

Animation playing in SL is client side, what you are seeing is NOT what is "going on in SL", you are essentially seeing your own personal film, exclusive to you.

When you use an animation set for the first time, the sim downloads the animation to your computers cache and then plays it, in exactly the same way all the textures you see in a place gradually all come up for you, this is why when you use a new poseball set in a laggy sim, you might see yourself sit for about 5 seconds before the anim starts, you may even see the other person start first, this is because their animation was downloaded into you cache and started before yours was, and more than this, the animation is also downloaded into the cache of all the people nearby watching you.
This is why with the best will in the world, the animation of the two partners will not start at the same time even though the script has told them to, most people when they see this, jump off the ballset and jump back on, the reason this works is because by the time they have done that, the animation has been downloaded into both peoples cache, so when the script tells them to start again, they start instantly because you have the anim in cache and no downloading is needed.
Now if this were not bad enough, anyone who TPs in and doesn't have that anim in cache, its then downloaded to that person and started, so to this person the anim looks out of sync, but to the people using the set, its still in sync and nothing has changed, new guy can say "man that dance is way out", and he will be right(for him), but he will be wrong to all the people who have been there since it started.
The best analogy i can come up with to explain this is the following:

You go to a shop and buy 6 of the same film on DVD, you then post 5 of them to your friends and tell them to play it when they get it so you can all watch it, what chance do you think there is that all 6 of you will be seeing Darth Vader kill Obiwan at the same time?
The fact is all people will receive and play the DVD at different times due to delays in the postal service, they will all see it but it will be out of sync with the others watching it.
This is EXACTLY the same thing as the animation issue in SL.

So how to fix?

The way to fix this would be to phone all your friends in a conference call, tell them to stop their DVD players and all start them at the same time.
Thus after about 30 seconds, on the dance sets I make them do exactly this, the anim is stopped and restarted, by this time the users and those who were watching and now have the anim in cache will see it start at the same time and it will look right, it will still of course look wrong to anyone who TPs in after this.
I don't do this with the other sets because the resync is disruptive and most other sets are intended for private use where the couple are likely to have the animation in cache and will not have a problem, of course in all sets I have put the /1 sync command so that the stop and restart can be done manually by the users if they see the need.

I have also observed an issue when the set is used for an extended amount of time, the couple will appear to go progressively out of sync(although again this is in the eye of the beholder), I cannot fully explain this but I'm pretty sure its related to the frame rates in SL for the users and watchers of the anim, this is particularly an issue in clubs and high use sims of course, for this reason the "club versions" of the dances have a user definable second sync time, you can make them restart the anim at intervals like 10-20 minutes to take account for new people who TP'ed in and this "drifting out" problem.

I hope the above explanation has persuaded you that scripts cannot "go bad" in this respect, I have in the past replaced sets where people have claimed their set doesn't stay in sync, and of course I know it will make no difference because of the way anims work in SL, I replaced because the "placebo effect" of having a new set was the only option when someone is upset and saying the set has "gone bad".

Please understand this is not an excuse, I have done all I can to get around the limitations, it is also not a "problem" with SL, all online games must work this way, its a common misconception that we are "sharing the same world", we are not really, the world is created in your computer, all your interactions are sent to the server your sim is in, and them from that server to the client of the person you are "interacting" with