Preparing for Mad Game Development

HookADuck

Getting plenty of interest in the Mad Game Development next week, which is great. If you are thinking of taking part, but worried about your programming background I’ll be doing some sessions next week which should help a bit. If you want something to do to prepare, I’d suggest getting in some practice with XNA and maybe a Physics engine. Easier than you think, and very, very useful.

Oh, and downloading the latest version of Visual Studio Express for Windows Phone might be a plan.

Mad Game Development Week at Hull

Sweeties

We are having a "Mad Game Development" in the department next week. Any students who are interested in taking part can sign up and get cracking on our game idea.

The game will be developed in a week, starting on Monday 18th of October and running up to the weekend of the 23rd and 24th of October when we are going have a "pressure session" where we can work overnight to get the game ready for submission to Xbox Live.

The scenario for the game will be released on Monday 18th at 9:00am on www.robmiles.com (i.e. here). Students from Hull are welcome to form teams of up to 4 to get together and produce a game. All the games must be written using XNA and target the Windows PC and Xbox 360. We will have some Xbox 360 machines on site for testing over the weekend, and some Windows Phones. If the game passes our stringent quality control we will submit to Xbox Indie games and maybe even Windows Phone Marketplace on Sunday.

If you want to create a Windows Phone version of the game then we will have a special category for Windows Phone submissions. A team can create one version that works on one platform or different versions. Your call.

If you sign up we would expect you to come along on Saturday morning to the department to take part in the "all nighter" part of the development, finishing at lunchtime on Sunday . We will be on hand to give help (we might even be working on our own version of the game).

Pizza and drinks will be provided during the night. We will also have a few games set up for rest and recreation. If you think you will have any time to spare.

We will be producing some artwork and other assets for the game. You can use ours, or make your own. We will also have a writer from 360 magazine along over the weekend to cover the game development and see what you are doing. So you might even end up in the magazine. And we have some Microsoft goodies to give away during the night.

We will be holding briefing meetings during next week when you can come and discuss how you are getting on. These will be at 1:15pm on Monday 18th, Wed 20th and Friday 22nd of October in the Design Lab (room 312).

If you want to take part, form a team and send me an email with the name of your team and the names of the members. I will register you and give you access to the resource pages on Skydrive, which will go live on Monday next week.

The development is open to students in the University of Hull from any Department and any year.

Staff can enter too, but they aren't allowed to have any of the goodies.

Windows Phone 7 to go

HTC HD7 exclusive to O2_2

Well, it’s official. Microsoft have made a new Mobile phone. In fact they’ve made several. Probably more than 7. But I digress.

The launch event today sounded fun, and things are going to be even more fun next week. Now I freely admit I love my iphone. And it was with a twinge of regret that I popped the sim out of it and into my Windows Phone a while back. But I don’t really regret the move over.

I find the Windows Phone easier to navigate and it does all I want, including run my programs.  I’m presently wondering if I’ll need to get up early on the 21st when everything launches to get my Windows Phone of choice, the HTC HD7. We shall see.

DDD Manchester

DDD Audience

A great audience. Even though not all of them like cheese.

Today I got on the train to Manchester, did 90 minutes of standup with a broken voice and then got on a train back to Hull. I had to wear two microphones, that’s how bad my voice was.

Anyhoo, the sessions I did (Writing Windows Phone Games and Windows Phone Marketplace) seemed to go OK. Thanks to the guys at Appamundi for inviting me to speak.

I said I’d put the slides and sample code up on the net and, as a man of my croaky word, you can find it all here.

On the way out of Manchester I, of course, took some photos.

DDD Odeon

Print Works and Odeon looking good

The Wheel of Manchester

“The Wheel of Manchester” – it doesn’t half go round fast…

DDD in Manchester Finalised

Hull Centre

This is not Manchester

The final schedule for the Developer, Developer, Developer event in Manchester next Thursday has now been set:

08:30 - 09:00 Registration, coffee
09:00 - 09:10 Welcome 
                              Andy Wigley, Andrej Radinger
09:10 - 09:30 Windows Phone 7: A new kind of phone
                              Andrej Radinger
09:30 - 10:30 Understanding the Windows Phone 7 Development Tools
                              Maarten Struys
10:30 - 11:15 Silverlight App Development on Windows Phone 7 
                              Andy Wigley
11:15 - 11:30 Coffee
11:30 - 12:15 Integrating with the device capabilities
                              Andy Wigley
12:15 - 13:00 Raising the dead: Apps that survive Tombstoning
                              Andy Wigley
13:00 - 13:30 Lunch (Not provided)
13:30 - 14:30 Games Programming on Windows Phone 7
                              Rob Miles
14:30 - 15:15 How to sell Apps through Marketplace
                               Rob Miles
15:15 - 15:30 Coffee
15:30 - 15:50 Cutting-edge WP7 apps: Cortexica’s visual search API
                              Richard Bassett
15:50 - 16:35 Creating Silverlight Apps that work Offline
                              Andrej Radinger 
16:35 - 17:00 Wrap-up and the BIG PHONE GIVEAWAY

If you want to register, go here.

Free Windows Phone Developer Event Next Week

alt

Coming to a cinema near you. Probably.

Hot on the heels of the Windows Phone 7 Live training that we did last week in Bellevue,  Andy and myself will be presenting at a Developer, Developer Developer (DDD) event in Manchester next week on Thursday 7th October (seems appropriate).

If you want to find out how to get started with Windows Phone then come along to the free day’s worth of training. I’ll be doing two sessions on XNA for Windows Phone. I’ll also be telling the jokes that I wasn’t able to use in the Live Broadcasts…. Should be fun.

You can sign up here.

Slide Writing

Our Hotel

We spent today updating the slide decks of our Windows 7 content in readiness for a couple of days of recording. The plan is to have all the Jump Start material bang up to date and compatible with the final release of the phone SDK last week.  The videos will be available soon.

When we had knocked things into shape we wandered down to Bellevue Mall and tea. I took my camera.

Bellevue Building

I could photograph this building all day.

Bellevue Nails

Bellevue Nails

Jump Start Advanced Phone Training

Windows Phone SMEs

Windows Phone SMEs (Subject Matter Experts). I wish I could put names to the faces, but if you are a Windows Phone developer you will have read material from at least one of these folks and used software they have written.

Today Andy and I did another day of Windows Live training. Hundreds of viewers on the other end of the line waiting to find out more about developing for the platform. And it was great fun. Andy covered the new Silverlight controls, Bing maps and performance. I did some XNA stuff and we had a couple of Expression Blend experts along to add even more value.

Then at the end we had the best bit (at least for me). A whole bunch of Windows Phone developers turned up to answer questions live for the last hour. Great questions, great answers and a good time afterwards, when the free beer turned up. Afterwards we went in search of a Best Buy store, and gadgets. On the way we passed a Nissan dealer….

A Mighty Cube

A Mighty Cube

Didn’t actually buy anything, which is a first for me I think. Then we wandered back to the hotel.

Skyline

All the material from yesterday was recorded, and will serve as a nice continuation of the existing content. Andy and I will be spending the rest of the week here in Bellevue re-recording the existing stuff and bringing it up to date.

Working in Hotel Rooms

A Great Place to Work

One of the pictures on the wall seems almost appropriate.

They say that when J.K. Rowling wanted to get some writing done she would check into a hotel and work there, free from distraction. Apparently as a result of this the final Harry Potter book was nearly called “Harry Potter and the Room Service of Doom”. But I digress.

I’ve spent quite a while in my hotel room working over the last day or so. Usually at three in the morning. I’ve found that I can plug the hotel room TV into my laptop, leading to the rather impressive dual monitor setup you can see above. And I have got quite a lot done. At the moment we are putting the starting touches to the sessions we are doing tomorrow, at the Windows Phone  Jump Start. I’m also digging out some of my favourite jokes. Should be fun. You can sign up here.

Jump Start to Bellevue

alt

My first meal in America. Of course.

Jumped (well, walked actually) onto a plane today to head off to Seattle for the next set of Jump Start sessions. Andy and I will be doing some more live magic next week on Tuesday, when we are going to present a bunch of advanced Windows Phone topics. I’m doing a session on more advanced XNA, including how to  make your games “Marketplace Ready”. You can sign up here. As soon as I arrived I shot off to the mall to take a look round and on the way back I got well and truly drenched by some traditional Seattle rain. It is nice to be here again.

Windows Phone 7 Developer Tools Released

Boat Race

(the Windows Phone user is the one in the speedboat)

The final version of the Windows Phone developer tools have now been released. These are the ones that you can use to create applications for the Windows Phone Marketplace. They are also of interest to XNA developers because this SDK is also the one used to create XNA 4.0 games for Xbox and Windows PC. They are a free download from here. If you want an ISO image to use for an offline install of the SDK you can find that here.

Oh, and if you want to find out more you really should sign up for our advanced sessions on Windows Phone Development. Andy and I will be reprising our double act (and giving away another private jet) on Tuesday next week. You can sign up here.

Windows Phone 7 Goes Gold

4952647892

Windows Phone 7 has “gone gold”. The term comes from the old, CD-ROM, days when software manufacturers would send a "gold” master CD to the duplication plant. In the case of Windows Phone it means that the phone manufacturers have been given the final version of the product to put into their handsets.

I’ve been using Windows Phone 7 for a while now and I love it. Going back to the iphone turns out to be hard work. Windows Phone is one of those clever interfaces that grows on you. The more you use it the more of these little touches that you notice, like the way that icons rotate when you change the screen orientation. And moving between programs using the back button is really easy. Microsoft have a really big mountain to climb with this new platform. But they have also made something rather special. With a bit of luck the phones themselves should not be long coming as well.

The whole Windows Phone team deserves immense respect for what they have achieved in such a short time. Kudos folks.

Windows Phone Screen Stealing Status Bar

image

I got some very useful comments on my post about how to make XNA games use the full screen of the Windows Phone. The thing that I didn’t make clear was that in an XNA game you will lose screen space even if the bar is not displaying anything. The best way to view the effect of this is to go into the settings of the phone (or emulator) and change the Background to light (Phone>Settings>theme).  Above shows what you get. The status bar is drawn white and the game screen area is scaled down by that lovely hardware in the phone itself. As you can see, your game is losing out on screen space.

If you want to make full use of all the screen you just need to add this line into the constructor for your game:

graphics.IsFullScreen = true;

image

Much better.

Windows Phone 7 Games

Miles Better Value

I hate this sign

I had a student come to see me today. One of our soon to be second years. He had spent some time working on a Windows Phone game and wanted to try it on a real device. He was using the accelerometer and not sure he was using it correctly.

Worked first time.

He had a touch controlled configuration menu and everything. Excellent stuff.

If you are on the Hull campus and want to try a Windows Phone app on a real device give me a yell and drop round some time.

Windows Phone Phone Calls

Hull Universtiy Library

It will come as no surprise to you that your Windows Phone programs are interrupted when the phone rings. However, if you are running an XNA game at the time it will not actually stop. This will probably annoy your game player though, as once they come back from explaining that they don’t want any double glazing just right now they will probably find that all their lives have been lost and the game is over.

To get around this you should make your XNA game drop into pause mode when a call comes in. You can get notification of things like phone calls by binding to the Activated and Deactivated events.

this.Activated += 
                  new EventHandler<EventArgs>(Game1_Activated);
this.Deactivated += 
                  new EventHandler<EventArgs>(Game1_Deactivated);

You can get Visual Studio 2010 to do all the hard work here, just type “this.Activated +=” and then press Tab in response to the magic that happens next.  Then put code into the methods that are generated and away you go.

Note: This is not what happens if the player presses Windows or Back. In those cases your game program is stopped. But that is a subject for another post I think.

Windows Phone 7 Training now Live

on the same page

Relive the magic… (and thanks again to pinksugarface for the pic)

If you want to get started on Windows Phone development head on down here for 12 hours of training, neatly broken down into bite sized sections. Andy and I cover getting started, Silverlight, XNA, the Windows Phone Marketplace and lots of other things besides. And if you stay to the end you get to find out who wins their own private jet. Really.

XNA Games and Windows Phone Screens

London bridge

If you are writing games for Windows Phone there are a couple of things worth knowing about how the display works.

Firstly, the top bar of the screen is used to display things like battery level, signal status and the like. This status bar only appears when the user touches that part of the screen, which is good because it makes the whole of the screen available when you don’t want to know your precise signal strength. However in an XNA game you might not want this to appear if the user happens to touch that part of the screen. You can stop the status bar from appearing by telling the graphics adapter to use full screen mode.

graphics.IsFullScreen = true;

Do this in the constructor for your game class, just after the graphics device has been created, and your game will get exclusive use of the entire screen.

The other thing worth knowing is how to stop the screen timeout turning up and ruining the gameplay. The screen will time out if there has been no touch activity for a while, which means that games controlled entirely by the accelerometer may get timed out. You can disable time-out by using the statement:

Guide.IsScreenSaverEnabled = false;

Now your game will run forever, or until the battery goes flat – whichever comes sooner…

Understanding Windows Phone Orientation in XNA

Panic Orientation

The many orientations of Panic.

Above you can see  my Windows Phone 7 Panic Button application. This gives you a panic button to press at any point in your panic inducing life. To make it work in any orientation I had to do a couple of things.

I had to tell the Windows Phone system the orientations my XNA game can support. I did this in the constructor for the game:

public PanicButtonGame()
{
    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";

    graphics.SupportedOrientations =
        DisplayOrientation.Default |
        DisplayOrientation.LandscapeLeft |
        DisplayOrientation.LandscapeRight |
        DisplayOrientation.Portrait;
    // rest of constructor here
}

This effectively tells XNA that the graphics device for my game can support any way the player might want to hold the phone. The next thing I had to do was get an event fired when the orientation changed so that I could re-position that all important button:

public PanicButtonGame()
{
     // start of constructor here

    Window.OrientationChanged +=
          new EventHandler<EventArgs>
                                (Window_OrientationChanged);

    // Frame rate is 30 fps by default for Windows Phone.
    TargetElapsedTime = TimeSpan.FromTicks(333333);
}

void Window_OrientationChanged(object sender, EventArgs e)
{
    // called when the orientation changes
    positionButton();
}

When the game is running and the player changes the orientation of the phone my method bound to the Window_OrientationChanged event will fire and re-position the button on the screen.

If you game can only support particular orientations then just leave out the ones that you don’t want to make available. 

Things get interesting if you do something stupid with preferred resolutions and orientation:

graphics.SupportedOrientations = DisplayOrientation.Portrait;
graphics.PreferredBackBufferWidth = 400;
graphics.PreferredBackBufferHeight = 240;

I’ve asked to work in Portrait orientation. However, I’ve also asked for a screen which is 400 wide and 240 high (i.e. a landscape one) which is a bit daft. What happens here is that my program will think it has a “screen”  400 wide by 240 high, but this will then be scaled by the hardware to fit in a display working  in portrait mode, which means that I’ll get my screen scrunched into the middle of the screen, with black bands above and below:

image

I’ve added a blue background here so you can see what happens.

If you want to select particular screen orientations and also use the hardware scaler you have to make sure that your selections agree or this will happen to you.

Windows Phone Graphics Speedup with BEPUphysics

 

The folks at BEPU have made a wonderful 3D physics engine for XNA on Windows Phone. You can see it in action  above.

And they’ve now ported it onto Windows Phone. I’ve downloaded the demo software onto my device and initially it ran rather slowly. However, Windows Phone has a lovely trick which makes it unique amongst mobile devices. You can set the display resolution to a lower value and hardware autoscales it to fit the screen of the device.  This is great for two reasons:

  • It means you no longer have to write games to fit a particular screen size
  • You can get a performance hike by rendering to a smaller screen and having it scaled up

You set the resolution that you want in the constructor of your game object in the XNA game. I asked for the lowest resolution:

// Pre-autoscale settings.
graphics.PreferredBackBufferWidth = 240;
graphics.PreferredBackBufferHeight = 400;

I had to do some fiddling with the display to make the buttons work (you can find out more here) but the result was a physics display that looked lovely (and only a tiny bit blurred).

If you want to get your hands on some ready made 3D physics (with very generous licensing terms)  then you should head over to BEPU.

If you want to speed up your XNA game on Windows Phone (or make it future proof as far as resolution is concerned) then you should start using the settings above.