Pages

Thursday, July 9, 2009

Silverlight for games

Target set. Weapons chosen

What sort of game do I want to build?
Even though this blog is quite recent, I have been thinking about the kind of game I want to make for a long time. I asked myself - "What do I miss in games these days?". Then I knew what I wanted to build. A simple 2D adventure game with a deep plot line. A game simple enough that anyone can pick up and play. A game that packs entertainment in a nice little package so that you don't have to invest 40-80 hours to finish it.

A game where the story is central and the graphics and game play are just elements that help in telling the story. A game which someone shouldn't feel bad for giving up a good book for (OK -I might be setting the standards too high here)

Weapon of choice?
Having decided what I wanted to build I started thinking of the tools I want to use to build the game.

My initial choice was XNA and it was an obvious choice for games. I have been dabbling with it and was quite excited about being able to deliver games on the Xbox 360 through the Community Games channel. I had even figured out the toolset with Paint.NET for pixel art and a custom Game Map Editor like the Xna Map Editor and even looked at SilverLua for game scripting.

Then I started looking at WPF for the Game Map Editor since it was much easier to get traditional UI as well as 2D graphics needed for the map editor(instead of hacking XNA with WnForms). This is when something clicked inside me. Suddenly Silverlight which shares its API with WPF seemed to be a really compelling option.

Silverlight vs XNA

Advantages of XNA
1. Ability to deliver the game on Xbox360(or the Zune). There is no other way to do this currently without XNA.

2. XNA is built for games. Silverlight on the other hand is not. There might need to be some adjustments made and some performance/features sacrificed owing to this.

Advantages of Silverlight
1. With the little info available XNA community game sales, it seemed to be not that exciting after all. I felt more and more that PC was a bigger delivery platform especially given the nature of the game. I had better chances of delivering it to a more casual audience through the PC than the Xbox. For this Silverlight is much better suited than XNA since I don't have to worry about installation, runtime redistribution issues in Silverlight like I would have to do with XNA.

2. As an added bonus I can potentially get the game delivered cross-platform to Mac and Linux if I used Silverlight (Even though I am not sure how open Mac and Linux users are to an Microsoft technology)

3. In game UI can be greatly simplified by using the Silverlight controls but at the same time have the flexibility to "skin" the UI to make it look more exciting in a game environment

4. Making the game experience more social by integrating with social networking sites(like Facebook connect) is much easier with Silverlight game delivered on the web. This opens an entirely new avenue to explore.

5. Containing piracy on PC would be easier with Silverlight than XNA (Or so I hope. Theoretically it would be possible to get the Silverlight code and find a way to hack it and run it offline)

6. Delivering the game solely through the web also opens interesting monetizing options.

7. The Roadmap for Silverlight with Silverlight 3.0 and beyond like Out of Browser experience and GPU accelerated graphics is quite exciting.

So there it is. I've decided to use Silverlight for my adventure game.

An intersting side effect of chosing Silverlight is that I started to increasingly consider Vector Graphics for my game instead of raster graphics since WPF/Silverlight 2D API is more vector graphics based. The main advantage in my mind is cleanly scalable graphics and resolution independant games (Consider playing a silverlight game full screen. Scaling pixel graphics would make it blocky or too fuzzy after filtering to avoid blockiness). I have looked at using the cool and free tool Inkscape for SVG graphics that can be converted to XAML and used from Silverlight(More on this in a later post)

Flash?
People might ask me why I didn't consider Flash at this point. It has all the advantages of Silverlight as well as much wider adoption across machines and platforms. The main reason is I like the productivity I get on the .NET platform over ActionScript or whatever new environment I have to get used to.

Also the installation of Silverlight on Windows takes less than 20 seconds and I don't think that should be a big barrier if the game turns out to be good after all. (I am not sure of the experience on the Mac and Linux but something I will be looking into).

And again the roadmap/rumors on Silverlight on Mobile platforms(and Xbox360?) makes me think Silverlight might not be bad after all in the longer run.

iPhone?
Everyone wants to get their game onto the iPhone. It seems to be becoming the defacto mobile gaming platform that is open enough to be easily developed for. At this point I am going to concentrate my efforts on the broader PC base and probably revisit iPhone development at a much later time(once my game is successful?). For now I am just making sure I am not basing any of my game data directly dependant on Silverlight(like using XAML) so that it can be more easily ported to other platforms. Who knows? Silverlight might be ported to iPhone even.

So that's it. I have decided on the game to be built and therefore the technology to use based on my target platform.

This post has become much longer than I anticipated. Please feel free to post your comments here if you disagree(or agree) with me on any of the above things.

Update(July 10th, 2009) : Silverlight 3 has been released

4 comments:

  1. You will probably be able to save a lot of work by using a ready-made adventure game maker kind of program (like www.visionaire2d.net, there are a ton of others like it - some free and others merely cheap).

    Don't reinvent the wheel.

    ReplyDelete
  2. I very briefly considered RPG Makers but I decided to do something on my own so that I have the flexibility and can create something that's more in keeping with the current trends(like social networking).

    The other motivation is that developing expertise in a more mainstream technology(than a RPG maker) like Silverlight might provide more oppurtunities to supplement just building games.

    ReplyDelete
  3. Good stuff. Are you planning to distribute the game commercially ? If you were, choosing a platform with a built-in distribution model, like the Xbox or iPhone would have been better.
    Then again, the core game is what's important and the ports can come later once you've got the basic gameplay nailed.

    ReplyDelete
  4. Yup. Definitely going to try and sell it. There are two models of getting your app/game noticed - Through a centralized app store(iPhone) or through the social network(Facebook). Either way it's a crowded space and the best thing I can do is make a good game and throw it in all sorts of places and hope it will get noticed. So I haven't thought much about how I'm going to sell it.

    ReplyDelete