Susan IbachTechnical Evangelist
After installing Windows Server 2008 on my machine (for training purposes), I tried to install the Zune software but it told me that this version of Windows is not supported. Actually, this is quiet logical, since such a Windows version is not aimed for entertainment purposes, I found a way to force the installation of the Zune software on Windows Server 2008. .
1. If you try to install the Zune software on Windows Server 2008, you’ll face this message:
2. This means that you’ll have to install it in a more “manual” manner. The first thing to do is to notice the location where the setup bootstrap unzips the files:
3. Navigate to this folder and open the “packages” subfolder inside it:
4. Inside that subfolder, there is a Zune-x86.msi file. Before running it, make sure to remove any previous installation of the Zune software;
5. After the installation is done, you’ll now be able to use the Zune software on your Windows Server 2008 machine.
In an upcoming blog post, I’ll show you how to install the Windows Phone 7 tools on Windows Server 2008 since they do not install as easily as on other “workstation” versions of Windows.
Doctor Calvin Law is able keep his hands sterile before surgery thanks to the Microsoft Xbox Kinect. The surgeons at Sunnybrook hospital have deployed the hardware solution to help their team scroll through CT images during surgery with hand gestures.
This allows the doctors to access the patient's information quickly without needing to leave the immediate area.
Kinect is more than a hardware gaming add-on for the XBOX console. The ability to set new standards to the medical industry is just one of few venues where Kinect is currently exploring.
The medical application was designed by Jamie Tremaine and Matt Strickland, who studied mechatronics and electrical engineering respectively at the University of Waterloo. Along with hardware designer Greg Brigley also from University of Waterloo, the group are transforming technological boundaries and helping surgeons navigate a patient's body. For more in-depth coverage, read here.
As I mentioned in a previous blog post, where I describe how to install the Zune software on Windows Server 2008, the Windows Phone 7 tools do not install on Windows Server 2008 as easily as on other “workstation” versions of Windows (Windows Vista, Windows 7). Once again, this is perfectly understandable since a server version of Windows is not aimed for application development purposes. However, since I installed Windows Server 2008 on my machine for training purposes, and since I don’t have enough computers at home to have one dedicated for this server version of Windows, I searched for a way to force the installation of these WP7 tools. Luckily (thanks to Aaron Stebner); I found a way as described in this post... But before going any further, I must mention that this is not officially supported by Microsoft, so do it (or not) at your own risks. Since my motivations were only training, that doesn’t matter to me.
1. Download the Windows Phone Developer Tools web boot strapper from here and save it on your hard drive. It is just a 3.2 MB file;
2. Open a command prompt window and type vm_web.exe /x to extract the contents of the setup package. You’ll have to indicate a location in which the files will be unzipped;
3. Navigate to the extracted folder and open the file baseline.dat file in notepad;
4. Look for the section named [gencomp7788];
5. Change the value InstallOnLHS from 1 to 0;
6. Change the value InstallOnWin7Server from 1 to 0;
7. Save and close baseline.dat;
8. Run setup.exe /web from the folder extracted to in step 2.
You can now develop Windows Phone 7 apps and games on your Windows Server 2008 machine. Please note that Visual Studio 2010 is required and that it installs without any particular problem on Windows Server 2008.
What makes a game great aside from the interesting game play, are the static data that makes the game dynamically fun. Pictures, fonts, sounds are all important elements that can make or break a game. These static data are called assets and are used by importers, processors, content loaders.
These steps will help with reducing the game’s loading time as the content is serialized at compile time.
XNA Game studio supports 2D asset formats .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.
PNG is the recommended format as many content generation tools support this.
Example:
Game assets are stored in the Content project when a XNA Game Studio 4.0 project is created.
Adding an asset is a simple process: right-click Content, select Add, click Existing Item, and then select an existing image file (for instance, hills.png).
With the assets in place, now load the asset into the game.
The asset needs to be stored in a variable there first we define a field to store the asset in the game class. The asset is serialized as Texture2D object and therefore the variable type should be Texture2D as well.
Texture2D hills;
The base class in the game project has a LoadContent virtual method which provides a location to load the assets and initialize the fields. By staging where you wish to load the assets in a game, able to save on initialization times and create a better experience.
loads the given asset, and stores the corresponding managed object in the class field.
C#
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: use this.Content to load your game content here
hills = this.Content.Load<Texture2D>("hills");
}
Images need to be incorporated to their correct hardware display resolution. In the XNA framework, the back buffer allows the scaling to be done by the hardware of the target device.
Configuring the back buffer for maximum resolution support by Windows Phone 7
if (this.Window.CurrentOrientation == DisplayOrientation.Portrait)
graphics.PreferredBackBufferWidth = 480;
graphics.PreferredBackBufferHeight = 800;
else
graphics.PreferredBackBufferWidth = 800;
graphics.PreferredBackBufferHeight = 480;
The ability to support all types of device orientation is set by this piece of code:
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight | DisplayOrientation.Portrait;
Drawing the picture onto the device
float scale = Math.Min(graphics.GraphicsDevice.Viewport.Width / hills.Width, graphics.GraphicsDevice.Viewport.Height / hills.Height);
GraphicsDevice.Clear(Color.White);
this.spriteBatch.Begin();
this.spriteBatch.Draw(hills, // Texture to render
new Vector2(0, 0), // Destination left top position
null,
Color.White, // Texture tint color
0, new Vector2(0, 0), // Origin left top position
scale, // Scale
SpriteEffects.None,
0);
this.spriteBatch.End();
Notice how we calculate the "scale" value at the top of the code sample. We want to scale the image as much as possible while keeping the entire image within the display bounds.
Windows Phone 7 includes a hardware image scaler. This allows XNA games to be written for any desired back buffer resolution without considering the physical screen size. The scaler automatically fits the drawing into the target display. It is worth mentioning that the hardware image scaler's work does not consume CPU time.
As previously indicated, we intend to show our image in full-screen mode with the best possible quality and without distortion. The following code fragment shows how we can implicitly use the hardware image scaler.
graphics.PreferredBackBufferWidth = 480 / 2;
graphics.PreferredBackBufferHeight = 800 / 2;
graphics.PreferredBackBufferWidth = 800 / 2;
graphics.PreferredBackBufferHeight = 480 / 2;
While we have halved each of the back buffer’s dimensions, the size of the rendered image is unaffected because the scaler resizes it to fit the device's display.
I love coding enough to consider it to be a form of art. To me, even fully functional code is only half-useful if it doesn’t follow conventions, doesn’t contain proper documentation, and is not reusable. I consider the definition of a properly written program as one that would qualify for the Pulitzer Prize nomination. If it were a piece of literature that is.
With that said, I might have created an impression of someone who would have doubts about a 24-hour coding session. Especially one aimed specifically at mobile development. After all, completing a computer science assignment overnight is one thing; producing market-ready and contest-winning apps for a phone in a 24-hour period is another.
But the target platform of the 2011 Canada-wide code-a-thons, Windows Phone 7, is no ordinary platform to develop for. It doesn’t require a dozen independent installation packages just to create and deploy a test app. It also doesn’t require you to consider a variety of different devices you code will run on; it’s one platform, one build. And it most certainly doesn’t turn your world upside down when it comes to the programming language. Development for Windows Phone 7 is done with the same C# language specification that is used for web, windows and even Xbox development. Game development projects done with XNA, for instance, can be deployed to Windows, Xbox and Windows Phone 7 without changing a single line of code (http://bit.ly/hAgYPO)!
A simple installation process, a powerful development environment and an easy high-level programming language; all that sums up to the fact that 24 hours allocated for coding will be spent doing just that. Sure 24-hours won’t yield a Pulitzer Prize winning app or artistically gorgeous code, but for Windows Phone 7 development it could be more than enough to produce an app that will sell to the world.
The March Code-a-Thon at Ryerson University took place at the university’s DMZ lab. The Digital Media Zone (alright, go ahead and call it Demilitarized Zone if you want to) is an incubator for Ryerson students who wish to develop their ideas into commercial enterprises. But for 24 hours, the Zone became home to a number of students who just wanted to create phone apps.
View of Yonge and Dundas from DMZ
Armed with pizza and red bull, Ryerson, U of T, York and other students from around GTA went on to create some pretty cool stuff.
Development and testing in progress
As an MSP, I was tasked with assisting students, but that didn’t prevent me from working on my app as well. Having worked with XNA before, I decided to create something in 3D. I knew I wouldn’t finish on time, but I figured I would at least attempt to impress the judges :)
The initial brainstorming sessions resulted in both fun and useful apps. At the end of the event, Developer Evangelist, Joey deVilla, encouraged everyone to submit their apps to the marketplace, with a bit more tweaking after the code-a-thon.
Some memorable results included a fake call app, described by Joey as a much needed app to get out of those occasional awkward situations. The 4th place was given to a very simple app that showed a picture of a hand, used the accelerometer to detected a “shove” motion, and played that killer sentence that no one wants to hear (please don’t make me say it here). Joey pointed out that sometimes it is the “simple & stupid” apps that become a big hit, pointing out the fart app as an example.
Let’s just say that the code-a-thon produced a bit more than fart apps
My app was a 3D view of the solar system. I grabbed flat planet maps from NASA’s imagery website and wrapped them around spheres, which were sized, placed and given orbits with relative constants for some factors, such as orbital period, taken directly from - you guessed it - Wikipedia. The attempt was simple and incomplete, but my goal to wow the judges succeeded to a certain extent; I ended up in the second place.
"Solar Sailor" Planet scales had to be identical, otherwise, aside from Jupiter and Saturn, nothing would be visible
The winning app was an implementation of the classic card game “Durak”. The winner received Samsung’s flagship Windows Phone 7, Focus. Another phone was given to the Digital Media Zone to encourage further WP7 development. A team within the Zone deployed their test apps on the phone the following day.
Work hard, play hard