Saturday 14 August 2010

Windows vs Xbox360

I do most of my development and testing on Windows. It's a much quicker cycle from code to test to code again. From time to time I have to test on the Xbox360 to make sure it all runs.

Whenever I test on the 360 there are always differences. The number of times I have seen a code 4 error! This time it was very unexpected because it was type casting.

I had tidied up my storage code. I had lots of the same loading and saving code where the only difference was the class of file it was working with. I did the obvious and converted it to a generic function using the base 'object' class and type cast to the type I needed.

This all worked perfectly first time on Windows. Not at all on the Xbox360. Turns out that no matter how I try I cannot return a value when I cast it back from the 'object' class. On the Xbox360 it always returns null.

I re-wrote the code so I didn't have to return a value. I keep the generic 'object' in the one method and have a set of if statements to store the results in the correct type. Not as neat but it works.

While on the subject of peculiarities and storage the Guide function on the 360 can be misleading. Sometimes it returns busy when it is not or perhaps it was a moment ago but it's not now! I have had to add several automatic retry loops in my code to avoid that problem.

Friday 6 August 2010

Menus

Once I started I couldn't finish.

Following on from making the menu controls more consistent I deviated on to making the menus look better. I already had a fully working and complete menu system but it needed something.

For the last few weeks I've been working on the graphics for the menu screens. I am just about finished now.



My original plan had always been to have a menu system that felt like you were already in the game. I had put that idea aside because of the extra work on top of the game to get that working. That is what I have now done.

Plenty of other games have similar interfaces and I am pleased with my implementation. Each menu screen looks like the view inside a space ship. Not the shiniest of crafts but a more utilitarian vessel.