XNA QR Codes

July 3rd, 2009

imageI’ve just pieced together a renderer for QR codes that outputs a texture instead of System.Drawing.Image objects (the Xbox .Net Framework version does not have access to the Drawing namespace). I’ll be using this as a way of uploading times on Avatar Kart to my server instead of copying a code which you had to do in Lines, my previous game. I will release the code once I’ve tidied it up a bit.

Avatar Kart – now with avatars!

June 16th, 2009

My Avatar Kart game now has:

  • A skybox
  • An original track
  • a floor for the world
  • Debug and chase cameras
  • A starting countdown

I also finally got Avatars in the code (Xbox 360 only so no videos yet). Microsoft has not decided to release the bones for the avatars, so I cannot do custom animations or poses yet. Therefore they are standing in the karts at the moment…

image image

Symfony – from 1.0 to 1.2

June 2nd, 2009

I’ve now had the pleasure of developing two line of business applications using two very contrasting versions of the Symfony framework in PHP/MySQL. Whereas symfony 1.0 allowed you to generate custom CRUD (create, read, update and delete) interfaces by editing simple human-readable config files and overriding simple functions, new symfony 1.2 systems require you to understand badly documented APIs (more on that later), PHP’s OO programming quirks, the exact method call order of the new forms framework and write completely new classes to provide custom filter functionality. 1.1 was an interim version that left in backward compatibility.

Imagine you want to add a custom filter to the standard object lists that require custom joins or subselects on columns not in the object’s table. We want an extra filter called “is_missing_address”:

Symfony 1.0

  • Add “is_missing_address” and boolean type to the list in generator.yml
  • Override the addFilterCriteria() method in the actions.php file to add the custom SQL when the “is_missing_address” filter is active

Symfony 1.2

  • Add “is_missing_address” to the filters list in generator.yml
  • Add the sfWidgetFormChoice() Widget with all the select tag values to the list of Widgets in the Filters form class’s configure() method
  • Add the sfValidatorChoice() class to the list of Validators
  • Override the getValues() method of the filter form to include “is_missing_address” and a custom criteria method name
  • Add a method such as addMissingAddressColumnCriteria() to the filter form class that adds the custom SQL

There are benefits to doing it the 1.2 way once you know what you are doing, but it is extremely complicated before you get your head around it. 1.0 was vastly more accessible partly in due to its amazing documentation.

imageI learnt symfony 1.0 by reading The Definitive Guide to symfony, written by the two lead developers. This was a fantastic book, detailed and simple. It was also clearly written (mainly by Francois Zaninotto) and obviously properly proofread before publishing.

The two lead developers have appeared to have a massive falling out after 1.0 was finished and massive changes brought in. The main author of the book has quit the project entirely after attempting to document the new changes and realising that 1.2 is only powerful and not simple. Simplicity and speed of development is probably the only two reasons anyone would want to use symfony in the first place (and probably PHP) – both of these points have been removed. The new documentation is full of French-lish such as “Softwares” and the homepage has what can only be described as non-native english. I believe parts of 1.0 were written with the documentation in mind (Documentation Driven Development), but 1.2 appears to have been made as powerful as possible, gaining maybe 10% more functionality at the expense of being easy to learn.

You do get what you pay for however, and symfony is free to use. I would not pay to use it when money gets you access to something like ASP.NET MVC now with fantastic MSDN documentation (there are free versions but it still requires a Windows server to host with). The symfony developers offer expensive training workshops – if the framework was still designed with simplicity in mind, you wouldn’t need training workshops or “symfony camps”.

The standard response to negative comments on open source projects appears to be “why don’t you volunteer to fix some bugs or correct some documentation?”. If I did that, it wouldn’t be free now would it?

Avatar Kart work in progress

June 1st, 2009

During my down time I’ve been cracking on with XNA and am developing “Avatar Kart” – essentially Super Mario Kart on the SNES with Xbox avatars (we have to wait until XNA Game Studio 3.1 this summer for avatar support). In a couple of days I’ve managed to finish:

  • CPU Car AI
  • Physics and wall collisions
  • Terrain effects
  • Lap counts and car rankings
  • Split screen

The track is still from SMK and the cars are empty but it does the job. Although its in 3D, I’m trying to get a 2D mode7 type handling feeling, really tight controls and simple graphics. I’ve already hit the performance wall of floating point operations in the compact framework on the Xbox so will need to spend some time optimising later. I will be replacing the Mario Kart track with my own design soon.

Below is a video of how its looking so far:

Fullscreen flashcard program

March 17th, 2009

image I’ve put together the first version of a simple program for displaying flashcards in fullscreen, mainly as an exercise in WPF but also because its damn useful for all sorts of teaching environments. Flash cards are simple text files that anyone can edit – just load them up and hit spacebar to cycle through them. “Big Flash Cards” is now at version 0.1 :-)

It supports Unicode so is perfect for Japanese lessons, for which I designed it. Example flash card files are included – they are very easy to edit and are simple text files. This is a very early version so there will be bugs.

bigflash

Download Big Flash Cards (117kb zip)

Vista and Windows 7 users: just unzip and run BigFlashCards.exe
Windows XP users: You need at least version 3.0 of the .NET Framework. Download it here.

For those that care, this was developed in Visual Studio C# 2008 solely on a tiny little Dell Mini9 laptop.

“Native” HD MKV playback in Windows 7

January 5th, 2009

Windows 7 has been out for a few days for MSDN members and the public beta is due soon. One of the best new features is native DivX, AVCHD and mp4 video support. With the codec framework completely changed (as explained by Long Zheng here), usual MKV splitters for Windows Media Player no longer work and viewing HD MKV files now definitely requires VLC for now.

image On my travels I found an application called TSMuxer on the doom9 forums – this has the ability to very quickly convert HD video files between formats with no quality loss whatsoever. This works by changing the container formats but keeping the video and audio streams the same.image

The screenshot above shows the settings I used to convert an episode of Heroes into an AVCHD .m2ts file. The process took about 2 minutes and resulted in a file that plays natively in Windows Media Player 12, Windows Media Center and even better – streams and plays in HD to an Xbox 360 Media Center Extender. No stupid codec packs and no dodgy DirectShow filters. Lovely.

Back in Japan

December 17th, 2008

For the forseeable future I’m back in Japan since finally finishing my Uni course. After working full time since May I’ve decided to have a bit of a gap year style break before I settle down somewhere. Expect this blog to become a bit more of a personal one with some photos etc.

My phone is back in action and my keitai address is ed.andersen at softbank.ne.jp :-) Feel free to drop me a line.

Lines on the New Xbox Experience

November 13th, 2008

Thanks to the ever-excellent Zman at The Z Buffer, I’ve been sent some screenshots of what Lines actually looks like on the New Xbox Experience. Awesome!

image

image

image

Lines now on Xbox Live

November 12th, 2008

So my grand plan to rewrite my game for the Community Games launch didn’t quite go according to plan, so I decided to polish up the original version as a bit of practice. It has now been approved and is on Xbox Live Community Games – NXE users can download the trial and buy it now, while everyone on the old dashboard will have to wait until November 19th. The internet ranking site is up at http://www.edngames.com – by soliciting scores I should be able to get a decent idea of how many people are buying the full game which you need to do to get internet ranking passwords.

Edbox-7 copy

The Community Games community is just getting off the ground, and already establishing its own “ground rules” for peer review based on the very loose guidelines set forth by Microsoft (presumably so they cannot be held responsible for anything that gets passed). The most important points to watch out for, and the community WILL FAIL you for breaking are:

  • Be able to use multiple controllers – much to the chagrin of some of the creators, the community will fail your game if you cannot play it with any controller plugged in. Don’t hardcode for PlayerIndex.One.
  • Test with more than one storage device – you have to be able to support memory cards as well as hard discs, and to be able to show the Guide selector asyncronously. I was caught out by the case where you can cancel the selection (which will cause EndShowStorageDeviceSelection to return null) so remember this is a valid input.
  • Small text and TitleSafeArea – many reviewers are using SD CRT tellies, not lovely HDTVs that many are now using and many creators use to test their games. Small text is a massive issue and SDTV users WILL fail your game if they can’t read anything crucial to gameplay (instructions etc). In addition, the area of the game screen you can see on a SDTV is much smaller due to the increased overscan, so use the TitleSafeArea property to make sure your text is within the overscan limits.
  • Make a “game” – the community has already had its fair share of drama, including one member simply submitting reskinned Starter Kits (templates from Microsoft) that didn’t meet the submission rules and one producing a Magic 8-Ball style game that requires the chatpad peripheral that simply nobody owns to play. Even if the game technically meets the submission criteria, the community can and will still fail it if they deem it unsuitable for the service (or increasingly if the submission will make the service look bad) either by trying their hardest to find a crash bug or simply not reviewing the game so it never passes peer review.

Lines is available for 200 Microsoft Points which is about $2.50. I get 70% of this so I could get some beer money. Fingers crossed!

Lines EX – rebuilding with XNA 3

September 6th, 2008

My dissertation project saw me making an XNA game (Lines) and website to go with it (edngames.com) which used web services to make essentially a cut down Xbox Live on the PC with rich presence support, automatic high score uploading etc. I feel it was very successful (and the markers agreed) but I didn’t get the time to spend on the game portion that I wanted to, instead concentrating mainly on the distribution scenarios and the user experience. With the Xbox Live Community Arcade coming up and the new CTP of XNA 3 released, I thought it would be the right time to rewrite the game using everything I’ve learnt over the last year since I began the project ready for the Community Arcade launch “this fall”.

image

Instead of using SpriteBatch, I’ve decided to place 2D flat quads in 3D space. While still getting free rotation, transparency etc, I now get resolution independence and extra effects such as being able to skew sprites.

I already have the main game code so am working on the menu system. By having sprites in a 3D space, changing the camera location means aspect ratio independence too by zooming out or changing the field of view – below shows the main menu in 16:9 and 4:3 (the zooming will work with all aspect ratios meaning no stretching).

image image

My favourite benefit however is the Smash Bros. style 3D effect you can achieve by moving the camera with the right stick. Completely pointless but very cool and can help you debug the locations of your sprites in the game world.

image

And yes, I am aware of the hidden word in the title and it is purely accidental :-)