Sunday, June 14, 2009

Foray into Silverlight

I finally installed the Visual Studio 2008 Service Pack 1 and the Silverlight 2 development tools. I created my very first Silverlight test project today! Along the way I found something rather alarming. Visual editing of the design surface is not possible for Silverlight apps in Visual Studio 2008! You cannot drag and drop controls on the Window, nor can you edit the properties of controls using the Property Window in VS2008. My XAML chops are getting better every day, but this will really force me to exercise them. I understand the VS2010 might include design time support for Silverlight, which would be most welcome. On the other hand, this might finally push me to get off my behind and get Expression Blend.

Another position was that my fledgling port of the Solar Vengeance logical engine class library ported to Silverlight without any errors or changes needed.

When I develop a game, I always strive to cleanly separate the logical data model from the user interface. I create a .NET Class Library project that contains the logical model of the game, and a separate project for the user interface.

By maintaining this strict seperation it is now much easier for me to port SV to another platform such as WPF and/or Silverlight. I'm also probably going to change how the multiplayer communication works. A beefed up custom PrismServer will use the same SV logical engine to create an instance of the game and serve as the "host" of the game. It will receive the orders from players, process the turn, and send the results back to each client on each Impluse.

I have some challenges ahead if I want to create an SV front end in Silverlight. In particular, Silverlight does not support the DrawingContext and OnRender method which is the basis of my TurboSprite animation system. If I want a Silverlight SV, I will have to leverage its animation model, perhaps building my lightweight framework around Composition.Rendering which lets you get at the animation loop in a WPF/Silverlight app.

For now, here's my first "Hello, World" Silverlight page ...

http://www.siliconcommandergames.com/SVSilverlight/TestPage.html

No comments:

Post a Comment