Book Image

3D Game Development with Microsoft Silverlight 3: Beginner's Guide

By : Gaston C. Hillar
Book Image

3D Game Development with Microsoft Silverlight 3: Beginner's Guide

By: Gaston C. Hillar

Overview of this book

Microsoft Silverlight is a programmable web browser plug-in that enables the animation, vector graphics, and audio-video playback features that characterize Rich Internet Applications. Silverlight is a great (and growing) RIA platform and games are the next level to exploit in it. But it doesn't offer 3D capabilities out of the box and integrating a 3D engine can involve lot of complex mathematics and matrix algebra. This book will help C# developers to get their fingers on the pulse of 3D in Silverlight. This book uses Balder, an open source 3D engine offering 3D capabilities for Silverlight 3. It leaves out boring matrix algebra and complex 3D mathematics. By the end of the book you will have explored the entire engine, and will be able to design and program your own 3D games with ease! The book begins by introducing you to the fundamental concepts of 2D games and then drives you into the 3D world, using easy-to-follow, step-by-step examples. The book employs amazing graphics and impressive performance, and increasingly adds more features to a 3D game giving you a rich interactive experience. By following the practical examples in this book, you will learn the important concepts, from the creation of the initial models, up to the addition of physics and artificial intelligence. The book helps you to provide realistic behaviors for 3D characters by enveloping models with different textures, using lights to create effects, animating multiple 3D characters using a physics engine (Farseer Physics Engine), and simulating real-life physics. Videos, music, and sounds associated with specific events offer the final touches to the 3D game development learning experience.
Table of Contents (21 chapters)
3D Game Development with Microsoft Silverlight 3
Credits
About the Author
Acknowledgement
About the Reviewer
Preface
Pop quiz—Answers

Time for action—preparing the development environment


First, we must download and install various Silverlight development tools.

We need to install Visual C# 2008 (.NET Framework 3.5) with Service Pack 1 or greater (Visual C# 2010) in order to successfully complete the installations provided here. Installing Silverlight 3 Tools will uninstall the previous Silverlight versions. We will not be able to create Silverlight 2 applications using Visual C# 2008 with Silverlight 3 Tools installed in our system. Visual C# 2010 does not have this restriction because it allows us to choose the desired Silverlight version target.

Note

You can use the free Visual Web Developer 2008 Express Edition or greater (http://www.microsoft.com/express/vwd/). However, you have to read the documentation and consider its limitations carefully.

The following are steps for preparing the development environment:

  1. 1. Download the following files:

    Application name

    Download link

    File name

    Description

    Expression Design

    http://www.microsoft.com/expression/products/Overview.aspx?key=design

    Design_Trial_en.exe

    It is a commercial tool, but the trial offers a free fully functional version for 30 days. This tool will enable us to transform vector assets to the appropriate format for use in Silverlight 3.

    Inkscape

    http://inkscape.org/download/?lang=en

    Inkscape-0.46.win32.exe

    It is a very complete free, open source, vector drawing program. This tool will enable us to import many vector assets in different, popular file formats and export them to a format recognized by Expression Design.

    Silverlight 3 Tools for Visual Studio

    http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&displaylang=en

    Silverlight3_Tools.exe

    We must install it to create Silverlight 3 applications in Visual Studio IDE using XAML and C#. This will uninstall previous Silverlight SDKs (Software Development Kits).

    Silverlight 3 Offline Documentation (in a CHM format)

    http://www.microsoft.com/downloads/details.aspx?familyid=0A9773A7-C854-41FA-B73D-535ABFB73BAF&displaylang=en

    Silverlight_3_Docs.zip

    We must download and decompress this file, as we will be needing access to the Silverlight 3 official documentation.

    Expression Blend 3 + SketchFlow

    http://www.microsoft.com/expression/try-it/Default.aspx#PageTop

    Blend_Trial_en.exe

    This tool will enable us to create content and prototypes that target Silverlight 3. It will be really helpful to use Expression Blend 3 to create rapid prototypes for some game scenes.

    .NET RIA Services

    http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&displaylang=en

    RiaServices.msi

    This framework allows the creation of business applications that are capable of talking to our games. In the same link, there is a PDF file available for download with interesting documentation about this framework.

    Silverlight Toolkit (updated for Silverlight 3 compatibility)

    http://codeplex.com/Silverlight

    Silverlight 3 Toolkit July 2009.msi

    It is convenient to download the latest stable release. This toolkit provides a nice collection of Silverlight controls, components, and utilities made available outside the normal Silverlight release cycle. It will be really helpful to use these controls to provide many game statistics. Besides, it includes more Silverlight themes.

  2. 2. Run the installers in the same order in which they appear in the previous list, and follow the steps to complete the installation wizards. Take into account that to install Silverlight 3 Tools for Visual Studio, you will need an Internet connection for a small download when the wizard begins. One of the items enumerated under the Products affected by the software update: list is Download Preparation, as shown in the following screenshot:

  3. 3. Once the installations have successfully finished, run Visual Studio 2008 or Visual Web Developer 2008 (or later). You will see the Microsoft Silverlight Projects label displayed on the splash screen, as shown in the following picture:

  4. 4. If the splash screen disappears too quickly, you will not be able to check Silverlight's availability. However, you can check it once Visual Studio 2008 or Visual Web Developer 2008 (or later) is running. Select Help | About Microsoft Visual Studio. A dialog box will appear and you will see Microsoft Silverlight Projects 2008 displayed under the Installed products list. Select this item and check whether Product details shows number 3 after the second dot (.). For example, 9.0.30730.126 indicates that Silverlight 3 is installed, as shown in the following picture:

What just happened?

We installed Silverlight 3 Tools for Visual Studio, Expression Blend 3 for Silverlight 3, .NET RIA Services, and Silverlight Toolkit.

Now, we have everything we need to begin creating and testing amazing 2D games using Silverlight 3 and C#.