The swf to silverlight/xaml converter I've been working on is now converting animation, and much to my surprise, it is quite chunky in Xaml. I'm pretty sure it can be improved with some profiling. Still, I'm a bit surprised. I'd be very interested to know how it plays on Vista -- not sure which I'd prefer to hear though, 'the same' or 'much better'. Maybe "it plays the same on all platforms, but better" : ).
Here are some comparisons files if you would like to have a look. Basically it is two complex objects with some simple easing tweens.
swf_xaml_animation.zip
The way I'm currently exporting is to add each symbol as a resource, then create a VisualBrush out of it. Then for each timeline (including root) I use a Canvas that gets filled with rectangles for each instance. Each rectangle is painted with the correct instance VisualBrush and transformed with the required matrix. The animation happens inside the timeline Canvas, and uses keyframe animation in order to get the discrete steps you need in character animation. I did it this way hoping to get caching of the graphic (symbols can't change in swf so barring large scaling that should help). I also tried using the 'Freeze' option, which seems it should behave something like 'cacheAsBitmap' in swf. Not sure if that is happening though, how can you tell? Any ideas for speed boosts most welcome!
Here are some things I think Silverlight has to improve or it could be dead in the water imo:
- It will have to play equally well and completely on each platform. That seems a tall order given the complexity and gpu use on vista, but it is 100% essential. Even with the desire to make cross platform seamless it is hard, so lets not even imagine using this as a tool to promote switching to Vista!
- For web presentations you should never get security exceptions based on valid markup (this happens right now running the above xaml in IE, not sure why). Even with code that is a stretch, but on markup is crazy.
- The animation logic, where properties are animated independent of objects was annoying in SMIL, annoying in SVG, and is still annoying in XAML. Add the inherited properties and dynamic nature to the mix, and it gets very hard to get anything done, even with tools, never mind by hand. Animation in Expression Blend is simply unworkable. You really need reasonable animation to get the platform popular I think.
And just to be fair, here are some things I think Flash has to address in light of Silverlight:
- Add support for a non dynamic language (and AS2 is dynamic). A language needs to be airtight to be toolable -- you don't want to refactor thousands of lines of code and be thinking it 'probably' worked. You want to know about your bugs. And then of course you have to build tools. The simplest way forward would be Java support imo (C# even better, but that probably won't happen : ). You can't scale code from a dynamic language without wasting waaaay too much time.
- A developer player that is not only strict, but will break into debug mode when something is missing. Asking a lot I know, but welcome to the new bar.
- Avoid letting Adobe bloat the crap out of the player, insert ads, bundle pdf, etc etc. I guess that is something that have to NOT do, but they really have to not do that. It happened with Flash over the years, but the player was sacred.
- Find RIAs that are actually useful and used, or give up on them. Silverlight is more "applications becoming web aware", where Flash is trying to be the "web become application aware". Flash had a head start, but Silverlight has a much easier path.
posted on Friday, May 04, 2007 7:56 PM