Monday, August 18, 2008

Introduction to Silverlight

If you haven't already encountered it among the interactive and browser games websites of the web, Silverlight is the relatively new web application framework created by Microsoft to directly compete with Adobe Flash. Like the familiar Flash applications, Silverlight provides user-interactive graphics (2D and 3D), animation, media-playback, and other features on web pages via an easy to install browser plugin. Currently there is not a great number of websites with Silverlight content, mainly due to the fact that version 2.0 is still in beta (the final release is due in early fall) and offers huge improvements over version 1.0 (latest release in April this year), but links are given to some examples/games in a section below. Both versions of Silverlight are based on WPF (Windows Presentation Foundation) - the new user-interface framework for Windows, intended to replace the long-standing Windows Forms infrastructure on the desktop and also take its place on the web. The declarative/XML-based approach of WPF tends to be very suitable for web development. The availability of a substantial portion of the .NET Framework 3.5 in Silverlight 2 adds many powerful features including network communication. Silverlight is also likely to take a main role in media playback/streaming with its in-built support for the WMV, WMA and MP3 codecs and free streaming service.

Silverlight or Flash?

Official support for Silverlight on Mac OS and the recent development of Moonlight for Linux distributions (supported by Microsoft) could very well encourage Silverlight to be adopted on all main OSs, therefore being able to compete with Flash on more than just Windows. It is also stable across all main browsers.

There are no apparent significant disadvantages of Silverlight compared to Adobe Flash. Listed here are some of the potential advantages of developing with Silverlight:
  • Power of the .NET Framework - unlike ActionScript (the language used to develop in Flash), C# and VB.NET (as well as the dynamic languages such as IronPython and IronRuby) are popular fully-fledged languages in which many developers are already skilled. The additional learning required to develop with Silverlight rather than Flash is therefore hugely lower (even without any knowledge of WPF). Furthermore, much of the .NET Framework 3.5 and its associated technologies such as WPF and LINQ are available to fully utilise.
  • Visual Studio - it is widely regarded (at least among Windows users) that Visual Studio (the 2008 release) is the best IDE around, possibly on any OS. Although Visual Studio and the Adobe Flash software are both commercial, Visual Studio Professional edition (required for Silverlight development) is available for free to students via the DreamSpark scheme. Microsoft Expression Blend, a design application for WPF/Silverlight, is also available to students via the same scheme.
  • Graphics & Animation - XAML and the WPF animation model provide a much more straightforward system to use that Adobe, which relies on binary formats for specifying graphics/shapes and only a frame-based (as opposed to time-based) animation system.
  • Windows Live Silverlight Streaming - Microsoft is offering free hosting and streaming for videos to Silverlight applications with your Windows Live account. Maximum bandwidth usage will be unlimited once it is out of beta. See silverlight.live.com for more information.
  • Microsoft has a huge ability to mass-distribute Silverlight to all Windows user, thereby enabling it to dominate or certainly at least challenge the current predominance of Flash. Depending on the success of the Moonlight project, Silverlight could gain populartity on Linux even before Flash.
Getting Started with Development

Everything you need to get started with developing using Silverlight 1.0 or 2.0, including instructions for setting up the development environment and beginner to intermediate-level tutorials/videos, can be found here.

Links to Silverlight Examples/Games

Silverlight Showcase

Microsoft Popfly (create your own games/mashups)

Line Rider (game)

Zero Gravity (game)

Diver (game)

Other games (game)