Project Eventuality: Windows Phone 7 application developer diary on a Samsung Omnia 7

Jan

Who's the Boss?
Staff member
Joined
May 24, 2010
Messages
14,887
Reaction score
13,572
Location
The Rabbit Hole
Microsoft has provided MyBroadband with a Samsung Omnia 7 to keep as a reference unit. This is always handy as it allows us to write about the device and platform (Windows Phone 7 in this case) from first-hand experience.

However, having already had a chance to review the device, we thought it would be put to better use in the hands of an experienced developer.

(Read our review of the Samsung Omnia 7 here)

In this thread, Shaun de Villiers, a professional C# developer with 8 years .NET experience, will write down his experiences developing for the platform.

Feel free to pelt him with questions and give your inputs.

A note on moderation: We'd like to keep this as clean as possible, so anything off topic (that isn't funny) may be moved to another thread or deleted. Try to keep the discussion about the project or WP7 development in general. Comparisons to development on other platforms are inevitable, but keep it civilised, please.
 
Eventuality

Download source code: http://dl.dropbox.com/u/10436093/Eventuality.zip


Hi, my name is Shaun de Villiers. I’m a professional C# developer with 8 years experience. I’ve been developing applications in .NET since version 1.1, doing mostly commercial work with the odd enjoyable detour through the toy and mobile game industries. My particular passion is for UI development. I am currently developing Silverlight applications for a company that specialises in custom solutions in the transport and logistics space.

Over the coming weeks I’m to take you through my experiences developing my first application for Windows Phone 7 (WP7). I’m going to approach this from a developer perspective, so at times it’s going to get technical, but I’m going to try and keep it interesting for non-programmers as well.

Feel free to ask me questions or point out any glaring factual errors – I’d appreciate the feedback.

The Project

When trying to decide to what sort of app my first WP7 app would be, I kept coming back to one thought: “I want to develop a game”. Not a particularly original idea, but there you have it. I’m going to blame it on too much time spent staring at grids filled with financial data.

I don’t want to overwhelm myself on my first project, so I’m going to keep it simple. I’m going to write the game in Silverlight not XNA, so that I can leverage my existing experience to get up to speed quickly. I have no skill in art or sound so I’ll keep those to a minimum – the game will be mostly text. Networking is complicated, so the game will be single player only (at a later stage I’d like to introduce some collaborative elements via SMS or the cloud).

I’m going to use Eventuality as the working title for the game. It will be a turn-based sci-fi game about a fleet of sleeper colony ships sent from Earth to colonise planets closer to the Galactic Center. After thousands of years of travel at near-light speed the ships awaken the colonists from cryostasis and they begin searching for suitable planets to colonise. Of course nothing ever works out perfectly and the colonists find themselves facing serious threats. The player’s goal is to control the fate of the ships in the fleet, dealing cards representing good and bad events to the ships in such a way as to try to safely land as many colonists on habitable planets as possible.

Installing the Tools

The first step in developing for WP7 is to install the Windows Phone SDK. The SDK can be downloaded from http://create.msdn.com/en-us/home/getting_started.

The Windows Phone SDK includes the following:

• Visual Studio 2010 Express for Windows Phone
• A Visual Studio add-in for developers who already have Visual Studio 2010 Professional or higher installed
• Windows Phone Emulator
• XNA Game Studio
• Expression Blend for Windows Phone
• Samples and documentation

The included copy of Expression Blend is a nice touch. Blend is a design package that allows UIs to be created without having to code the XAML by hand, and it saves a lot of time and frustration.

If you are using Visual Studio 2010 Express you will need to register to use it past the 30 day trial period. The registration is free but requires that you create a Windows Live account.

I had some difficulties getting Visual Studio 2010 Express for Windows Phone working. It refused to run until the Visual Studio 2010 Service Pack 1 was installed, although I had previously installed it for the other versions of Visual Studio on my machine. When I tried to install it again the installer was unable to find a temp file it was looking for. I attempted to reinstall it from scratch but the uninstall would not complete because of the same missing file. Luckily the failed install seemed to have done the trick, and I could run Visual Studio.

Procedural Content Generation

By far the most time consuming part of creating a game is creating the content. Art, sound, story and levels - all of these take considerable effort to create and refine. Art and sound content can be readily outsourced if you can afford it. The story and levels of a game are usually tightly tied into the game mechanic and are better done in-house. Unfortunately indie or hobbyist game developers typically don’t have an in-house team to help them to create the content for their game, nor can they afford to pay for much outsourced content.

Have you noticed how indie games tend to gravitate towards certain genres and game types? Most indie titles have 2D graphics and just enough story so the player knows what they are supposed to do next. Platformers, tower defence games and bullet-hell shooters abound. These are obviously the types of games that the developers enjoy playing, but they were also chosen because they can be created by small teams and play to the strengths of those teams.

Platformers are relatively simple to build levels for. Once an artist has created a tileset or two the tiles can be used to build a wide variety of different environments quickly and easily. Tower defence games typically have only a handful of different towers and a few basic enemy types, but the selection of enemies for the waves and how the player decides to place towers ensures that no two games are exactly alike. The ships and bullets in shooters move in simple patterns, relying on overwhelming numbers to challenge the player.

Procedural content generation is using computer algorithms to create or place content instead of hand-crafting every portion of the game. While the enemies in a tower defence game could be painstakingly handpicked for each wave, it might be easier to write a piece of code that looks at the player’s level and selects enemies that the player can handle for the next wave.

Generating content through code has some advantages over manually created content. It’s typically faster, especially in a programmer-heavy team. New content can be added at a later stage without having to rework everything – simply change the algorithm. Procedural content can be adapted on the fly to accommodate the player’s skill level. The algorithms can interact in ways that the developers never originally envisaged, creating unique experiences for the player.

Of course there are some significant downsides that have to be taken into account. Some games craft a very carefully controlled emotional experience for the player through music, story and art. This level of control just isn’t possible with procedurally generated content. Very few games can be entirely generated using code – at least some of the content will need to be manually generated to give the game flavour and keep it from becoming dull. Deciding which content to manually create is an important decision that needs to be made carefully. Complex, unpredictable interactions between algorithms can result in situations that make parts of the game trivially easy or impossibly hard.

I’ll be making extensive use of procedural content generation in Eventuality to create the player’s fleet of ships and the events that they encounter on their voyage. In a subsequent post I’ll go into more detail about generating the content for Eventuality, and keeping the player entertained by balancing the difficulty of the events.
 
Last edited:
I know this might be a bad one, but can I rather suggest using it for something that will benefit both MyBB and the WP7 users. Like a forum app of some sort?

Or maybe a News App that Display MyBB news with a comment section. I played a bit with VS 2010, more of an Android dev but I know the data capabilities of .net is more than doable with ease. I really think something like a well polished Silverlight App would do wonders for both MyBB and WP7, but then again that's just me :)
 
Thank you, roguemat.

To be honest, Elimentals, I just don't think I have enough interest in news reader apps to spend several months developing one in the evenings. :) Perhaps this thread will inspire one of the regular forum users to develop a WP7 MyBB app.
 
Installing the Tools

The first step in developing for WP7 is to install the Windows Phone SDK. The SDK can be downloaded from http://create.msdn.com/en-us/home/getting_started.

The Windows Phone SDK includes the following:

• Visual Studio 2010 Express for Windows Phone
• A Visual Studio add-in for developers who already have Visual Studio 2010 Professional or higher installed
• Windows Phone Emulator
• XNA Game Studio
• Expression Blend for Windows Phone
• Samples and documentation

The included copy of Expression Blend is a nice touch. Blend is a design package that allows UIs to be created without having to code the XAML by hand, and it saves a lot of time and frustration.

If you are using Visual Studio 2010 Express you will need to register to use it past the 30 day trial period. The registration is free but requires that you create a Windows Live account.

I had some difficulties getting Visual Studio 2010 Express for Windows Phone working. It refused to run until the Visual Studio 2010 Service Pack 1 was installed, although I had previously installed it for the other versions of Visual Studio on my machine. When I tried to install it again the installer was unable to find a temp file it was looking for. I attempted to reinstall it from scratch but the uninstall would not complete because of the same missing file. Luckily the failed install seemed to have done the trick, and I could run Visual Studio.
 
Thank you, roguemat.

To be honest, Elimentals, I just don't think I have enough interest in news reader apps to spend several months developing one in the evenings. :) Perhaps this thread will inspire one of the regular forum users to develop a WP7 MyBB app.
As soon as I read Elimentals post I decided to make one, because I actually really need it :)
 
Procedural Content Generation

By far the most time consuming part of creating a game is creating the content. Art, sound, story and levels - all of these take considerable effort to create and refine. Art and sound content can be readily outsourced if you can afford it. The story and levels of a game are usually tightly tied into the game mechanic and are better done in-house. Unfortunately indie or hobbyist game developers typically don’t have an in-house team to help them to create the content for their game, nor can they afford to pay for much outsourced content.

Have you noticed how indie games tend to gravitate towards certain genres and game types? Most indie titles have 2D graphics and just enough story so the player knows what they are supposed to do next. Platformers, tower defence games and bullet-hell shooters abound. These are obviously the types of games that the developers enjoy playing, but they were also chosen because they can be created by small teams and play to the strengths of those teams.

Platformers are relatively simple to build levels for. Once an artist has created a tileset or two the tiles can be used to build a wide variety of different environments quickly and easily. Tower defence games typically have only a handful of different towers and a few basic enemy types, but the selection of enemies for the waves and how the player decides to place towers ensures that no two games are exactly alike. The ships and bullets in shooters move in simple patterns, relying on overwhelming numbers to challenge the player.

Procedural content generation is using computer algorithms to create or place content instead of hand-crafting every portion of the game. While the enemies in a tower defence game could be painstakingly handpicked for each wave, it might be easier to write a piece of code that looks at the player’s level and selects enemies that the player can handle for the next wave.

Generating content through code has some advantages over manually created content. It’s typically faster, especially in a programmer-heavy team. New content can be added at a later stage without having to rework everything – simply change the algorithm. Procedural content can be adapted on the fly to accommodate the player’s skill level. The algorithms can interact in ways that the developers never originally envisaged, creating unique experiences for the player.

Of course there are some significant downsides that have to be taken into account. Some games craft a very carefully controlled emotional experience for the player through music, story and art. This level of control just isn’t possible with procedurally generated content. Very few games can be entirely generated using code – at least some of the content will need to be manually generated to give the game flavour and keep it from becoming dull. Deciding which content to manually create is an important decision that needs to be made carefully. Complex, unpredictable interactions between algorithms can result in situations that make parts of the game trivially easy or impossibly hard.

I’ll be making extensive use of procedural content generation in Eventuality to create the player’s fleet of ships and the events that they encounter on their voyage. In a subsequent post I’ll go into more detail about generating the content for Eventuality, and keeping the player entertained by balancing the difficulty of the events.
 
I've released the source code for Eventuality. You can find the link to download it in my first post. Feel free to do whatever you want with it, but I'm not responsible for anything you break. :) I'll be keeping the download link up to date as I develop further.
 
Top
Sign up to the MyBroadband newsletter
X