NetSync ReportAnimation Questions

ktweedy1
ktweedy1 ✭✭
edited December 2010 in DotNet
I have been playing with the NetSync demo and trying to use the animation sync event.

The call is

public void ReportAnimationUpdate(long netID, string animationClip, float animationCrossFade)

I am curious what is the intent of the animationCrossFade and how is it used.

For unity we can have several animation running at once, so looks like to sync animations I need to extend this call to include layer, weight, speed, and play type (one time, looping, etc.). For most of my animations this is initialized once, so maybe I only need is Play, CrossFade and Stop. Anyone can share how they are doing this?

Also, it sends the ServerTimeInMilliSeconds. Anyone can share how they are syncing animations time wise? If they animation is starting late do i adjust thetime so it ends at the time it needs to end? or do I start the animation at the delayed time instead of the beginning?

Comments

  • The ReportAnimationUpdate() in the NetSync demo is not intended to be used for characters. Character animation is (or at least can be) very complex. However, I found the ReportAnimationUpdate useful for synchronizing animations for simple objects, like doors, elevators, etc. - objects with simple states, where each transition maps to a specific animation.

    I've just completed the first version of an online game using the NetSync approach (extended and tweaked in many ways, but basically the same setup). To handle the relatively complex character animations, we developed a Unity tool where designers can setup animation-graphs, and data-driven run-time code to handle the states and transitions as dictated by the designers. As a programmer, you basically asks the animation-graph to go to a specific state, and it will return true/false depending on the transition between the two states being present or not, and it will playback the animations as setup by the designer automatically. We also developed an AnimationProxy, which is basically the same run-time code running on all other clients, but listening for control events from the "owner". By sending the (successfull) transitions and the current time from the owner, we can synchronize the animations with minimal network footprint.

    Hope this helps :)