Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Architecture question: Whence does the animation originate?

Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
11-30-2007 05:21
Sorry if this is common knowledge, but I'm suspecting a flaw in my basic understanding of the architecture. To wit:

When my viewer shows an animation playing on another avatar, how does it know what animation to play? Specifically, did that information originate with the sim, or did it come through the other avatar's viewer at some point, in a way analogous to how (I think) avatar textures are "baked" on that other avatar's client before being passed to my viewer?

In other words... could one build a kind of "personal AO" purely client-side, like one can change a skin without having to actually upload the texture? (I'm not actually trying to do that--it's just for purposes of explication; I'm really just trying to understand some anomalies that would make more sense if this were how things worked.) I've snooped unsuccessfully around the wiki but haven't consulted the actual viewer source--a pit from which I'm confident I'd never emerge.
Deira Llanfair
Deira to rhyme with Myra
Join date: 16 Oct 2006
Posts: 2,315
11-30-2007 08:50
I'd like to know the answer to this one too. I have observed that the client does not always know which animation to play though - because when I have tested my couples animations with my Alt account (running two instances of the client on the one desktop) - the animation can be running fine in one window and not be running at all, or even running a different animation in the other window.
_____________________
Deira :)
Must create animations for head-desk and palm-face!.
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
11-30-2007 09:27
Your viewer sends an AgentAnimation packet to to sim to start or stop an animation by UUID.
http://wiki.secondlife.com/wiki/AgentAnimation

All agents in the region receive an AvatarAnimation packet from the sim with the animation's UUID.
http://wiki.secondlife.com/wiki/AvatarAnimation

Viewers who don't have that animation cached send a TransferRequest
http://wiki.secondlife.com/wiki/TransferRequest

and get the animation back in a series of TransferPacket packets following one TransferInfo packet
http://wiki.secondlife.com/wiki/TransferInfo
http://wiki.secondlife.com/wiki/TransferPacket

as far as I can tell (:
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
11-30-2007 10:12
...and, if one of those requests gets lost for some reason, then that particular viewer might not be showing the same animation as all the others.

Always remember that SL works by thousands of clients and servers sending zillions of small messages to one another, but that the network does not guarantee that the message arrives on time or in the right order. Where it is crucial, SL tries to keep track. Where it is merely inconvenient, then we just wing it...

To answer another question, YES, it would be possible to create a viewer that plays animations or sets skins or anything else on the local client, but does not upload it for others to see. It would not be very easy though, unless you already know a hell of a lot about GL programming.
_____________________
So many monkeys, so little Shakespeare.
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
11-30-2007 16:03
From: Lee Ponzu
To answer another question, YES, it would be possible to create a viewer that plays animations or sets skins or anything else on the local client, but does not upload it for others to see. It would not be very easy though, unless you already know a hell of a lot about GL programming.
Well, my attempted analogy was to the ability to replace the (lower layer) skin-defining .tga files in the local client's "character" folder, which then get pushed out for everybody to see when the avatar's texture is baked. (See, e.g., /109/8d/222194/9.html#post1759513.) So, what I was kinda getting at is whether there's something similar (though simpler) with animations: that the animated agent's viewer is responsible for keeping track of the animation state of the associated avatar, and pushing updates to the sim for forwarding to all the other agents who might see the animated avatar. (That's as opposed to the sim keeping track of all agents' animation states and pushing updates to all viewers--including that of the animated avatar itself--which was how I had always assumed it to work before.)

If I understand the very first step of Day's response (thanks!), it sounds like the viewer-based approach indeed may be how it works. (I have no idea if there's any client-local directory of avatar-state-to-animation-UUID that would make possible a client-side AO the effects of which would be visible to all, but I wasn't really thinking about that seriously anyway.)
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
11-30-2007 17:59
From: someone
To answer another question, YES, it would be possible to create a viewer that plays animations or sets skins or anything else on the local client, but does not upload it for others to see. It would not be very easy though, unless you already know a hell of a lot about GL programming.


I won't say it's easy, but there's the possibility of injecting packets at your viewer instead, like the "Polymorphism proxy" that creates imaginary avatars in your viewer (: