Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
Wednesday
Nov112009

Flushed With Success

After my TechEd session I thought we’d go out and celebrate in style. The style I imagined was a bit strange, in that we’d found out that there was a very strange bar near the hotel which had a rather strong toilet theme.  This theme extended to food served in potties and drink in sample glasses….

4094370193

This is us toasting another good day in Berlin. thanks to Adam for the snap

We were going to have the food too, but our nerve failed and so we went out and got a burger instead.

Wednesday
Nov112009

XNA on Zune Session Fun

I did my final session of this TechEd today. I was on at 5:30, in session slot 13, but in the end pretty much everything worked. Thanks to everyone who came along, I hope you all had a good time and learned something useful. I’ve put the slides and all the demo programs up on Skydrive so feel free to download them and have fun. For some reason I forgot to take a picture of the audience, but then since you all know what you look like anyway I suppose this is not much of a loss…..

You might want to take a look at the other sites which are linked from my post from yesterday.

Tuesday
Nov102009

Student Session Fun

Did my first TechEd 2009 session today. Students and XNA. What could go wrong? Well, fortunately, nothing much as it turned out – except for one of my demos getting a tiny bit stuck.  The audience was great, and I took a picture of them all:

4094369495

On the left….

4094369831

..in the middle..

4094370193

…and on the right

Thanks for being a great audience folks. I hope you enjoyed it.

After my bit we were joined by some other TechEd speakers and we had a really good question and answer session.

If you want to find the links to my stuff, you can find silly games content at www.verysillygames.com

You can find my Yellow Book on C#, and my Orange Book on Java to C# at www.csharpcourse.com

I will be posting the slides for the session, along with all the sample code, on this blog after my session on Wed.

Tuesday
Nov102009

Zune HD Ins and Outs

I’ve been preparing my TechEd sessions today. I’m doing two, one to Microsoft Student Partners (in a couple of hour or so) and one Interactive Session to the general conference. If you are here in Berlin please come along, I’d love to see you.

Since the session is about creating XNA games for the Zune HD not surprisingly I’ve been doing a bit of creating games for the Zune HD. I got my AlbumShaker running really nicely, and I thought I’d try running it on the original Zune players. I wasn’t expecting much, but I was really surprised to find that performance was quite acceptable, with the albums bouncing around the screen most satisfactorily. The program doesn’t seem to mind that it is running on one of the older devices, the game just gets “central” settings from the accelerometer.  I even added some code to read the Zune pad, which emulates a gamepad  thumbstick. This worked fine, except for a couple of issues.

Using the XNA Gamepad to Slow your Zune Game Down

The code for the album shaker makes a bunch of album sprite instances and then calls Draw and Update behaviours on every instance. The first version of my game called the GamePad.GetState method for each of the fifty or so albums on the screen. This did horrible things to performance. For some reason reading the Zunepad is very slow. I assumed that the pad would be read for a a given clock tick, and then that value cached for use in the game. This is not so. I got a huge performance improvement by reading the state once for all the albums and then picking up this value in each album.

Using the XNA Accelerometer to Make your Zune Game wobble

I was so pleased with my speedup on the original Zune I thought I’d do something similar with the accelerometer input, so I changed the game so that it read the accelerometer once and then cached that for use by all the items in that update. This had a really strange effect, where sometimes the items flickered madly about. I’m not sure why this happens, it is as if the GetRotation method on the AccelerometerState object actually corrupts the state in some way.

I only know that if you get a “fresh” reading for each item you want to input the game works fine.  And this doesn’t seem to  slow the game down either, which is nice.

So the moral of this is that it is fine to cache the gamepad settings (and in fact on the Zune this might make your game go faster) but the accelerometer values should not be cached..

Monday
Nov092009

TechEd and Mauerfall 2009

TechEd started today. I went to  a very good session on Windows Azure first thing. Then I had to go off and sort out some presentation related bits and bobs, which was a bit of a pain as there were a couple of other sessions I wanted to see. However, once the day’s work was done we headed off the the Brandenburg gate to see the Mauerfall event.

This was a celebration of the 20th anniversary of the fall of the Berlin wall by the toppling of an enormous row of domino-like blocks that stretched for over a kilometre. They had all kinds of heads of state there, a full orchestra and a live appearance by Bon Jovi.

4092689608

The inside of the station

4091925139

The outside of the station

4092690560

A nice view across the river

4092690982

On the way to the gate

4092691326

Waiting by the wall

We found a good spot near the food and drink stands and began to wait. And it started to rain. And rain. After two hours in the rain I found that most of the things I had with me that I thought were waterproof, like my coat and shoes, were not. After three hours in the rain everything was wet. After four hours everything was wet and very cold.  And then it started, We had speeches from the great and the good, music, and the blocks duly fell on cue. It was a great evening, even though I have never been so cold and wet.