Avatar Kart work in progress
Jun 1st
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
Mar 17th
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.
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
Jan 5th
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.
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.![]()
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
Dec 17th
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
Nov 13th
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!
Lines now on Xbox Live
Nov 12th
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.
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
Sep 6th
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”.
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).
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.
And yes, I am aware of the hidden word in the title and it is purely accidental
Mail.app and iPhone encode Japanese as Korean
Jul 27th
The latest of ridiculous bugs I have found after my switchover to Mac is that Korean takes precedence over Japanese when “Automatic” is selected as the encoding on Mail.app. It literally sees Japanese text as Korean and encodes emails as ISO-2022-KR (Korean) if both Japanese and Korean are selected under Languages.

Try it yourself: make sure both Korean and Japanese are in the Languages list (so they show both show up in Mail.app’s Message > Text Encoding) and send an email containing Japanese text when encoding is set to “Automatic”. View the full message source and see that it encodes the message as ISO-2022-KR, not ShiftJIS or UTF-8 which it should. You have to completely remove Korean from the list if you want to use Automatic encoding, or manually select the encoding yourself every time. I cannot find a setting to force an encoding (er, UTF-8) on every email you send.
This is not a problem if the recipient is a PC/Mac user since the mail client will sort it out – but sending mails to a Japanese phone, which obviously has no idea what to do with Korean text encoding (and can’t suss out that its actually Japanese text) means that the lucky recipient gets 文字化け、mojibake, jumbled garbage.
Its even worse on the iPhone
If you ever decide to turn Korean keyboards on in the Language settings, or switch to Korean, iPhone appears to add Korean to the Languages list when choosing its own encoding. However, you cannot change the encoding manually on iPhone, or ever remove Korean from the list, even if you then disable Korean input.
The net result? You can never send Japanese mails to Japanese mobile phones ever again on your iPhone, until you do a full system restore. Which I am now doing. If you reply to a mail that was sent to you in ShiftJIS, the iPhone is at least clever enough to reply in the same encoding type but you are SOL if you want to compose a new one.
Rubbish. Windows Mobile has an option to “always send mail as UTF-8″. I wonder how many iPhone users in Japan have fallen foul of this?
iPhone O2 – how to fix the image compression
Jul 13th
O2 in the UK butcher images while using GPRS/3G/EDGE – seriously effecting the iPhone. Images are recompressed to horrendous levels – look at the App Store here:

As you can see, the Facebook and Super Monkey Ball banners have been recompressed. This effects webpages aswell – meaning downloading new wallpapers or browsing Flickr is a waste of time. However, if you change the username for the O2 access point under Settings > General > Network > Cellular Data Network to “bypass” from the default “vertigo” like so:
The compression is now turned off! Now the “whole internet in your pocket” is actually the whole internet in your pocket.

Symfony in Enterprise – Tips and Experiences
Jul 2nd

At work I am currently tasked with redeveloping an intranet application used to track customers, products owned, support contracts, support records and all sorts of other CRM-esqué functions. The version used at the moment is a very fast Perl/MySQL/Mod_perl/Apache setup built over a few years. Its got to the point where the company needs more functionality and hacking extra functions into the current code is getting more and more difficult.
Why Symfony? Why PHP?
The current trend for “rich internet applications” is Ruby on Rails. Ruby has very powerful Object Role Modelling features that completely abstract the database from your code – no more writing SQL queries once the initial database has been set up. Database tables become class generators and rows become class references, free to be instantiated, updated and saved. Symfony is probably the closest PHP Framework to Ruby, as it utilises the Propel ORM layer (so can use almost any RDMS) and has a full Model View Controller structure. PHP runs on the vast majority of Apache installations and requires no extra software installed on the server – in addition finding skilled PHP programmers is far easier (although this might change). Symfony is also probably one of the most well documented Open Source web framework projects that I have come across, featuring a whole book written by a member of the community very close to the development team, an expansive Wiki on the project homepage and hundreds of plugins to simplify everything from AJAX to RSS feed generation.
Symfony can be used in two ways – through config files (text files defined using YAML, a simple markup language) which are passed to Generators to create the final scripts, or by manually coding the actions and pages. In reality, a combination of the two will be used. Tweaking the included Administration Generator will yield respectable results for the standard CRUD (Create, Read, Update, Delete) functions and it is extremely simple to create modules and actions with the included command-line tool that creates skeleton templates for you to use.
No longer do you have to plug in debugging tools (such as the Xdebug php extension) to get decent errors and stack traces when your application fails – Symfony provides a development view of your application that will output extremely useful information (such as execution time, a list of all SQL queries made and globals) right in the page outputted to your browser. Debugging the application I’ve been working has been as easy as that of a desktop app (coming from my experience of Visual Studio) – Symfony will work in conjunction with many PHP debugging extensions for further information if you need it (I haven’t).
Plus, Symfony is good enough for Yahoo to use it for a 20 Million user app, Yahoo Bookmarks!
Results
I’ve been working alone for a month on the project and what strikes me is the huge amount of already achieved with no prior experience of Symfony:
- A complete database redesign using the excellent MySQL Workbench. Adding many-to-many relationships where there were none before requires a good deal of thought but the results when the ORM classes are generated by Propel in Symfony are well worth the effort
- Database migration handled by the CLI features of Symfony. One command will generate a .php file you can run at the command line (or cron job) with automatic access to all the features of your main application. Where the database had been vastly redesigned to support relationships, custom migration code had to be written (but where tables have not changed, you can copy table data directly in one line of manual SQL). The migration script takes about half an hour to run (approx. 3,000,000 records).
- User security and session support, timeouts etc
- Full creation and editing of all the major record types with administration control panels
- AJAX views and manipulation of information with per-user rearrangeable panels ala iGoogle
- Full filtering functions for searches with auto-paginated results (soon with Excel export)
- Global per-user filters that effect all searches
- …and lots of other actions specific to the application
Tips
Some advice to newcomers to Symfony from my experience:
- Don’t rewrite the wheel. Use the plugins available and tweak them if necessary.
- Use the Admin Generator, don’t fight it. Instead of writing custom create/edit/list actions when the Administration Generator does not meet your requirements (or altering the CSS won’t help), override templates with per-module versions of your own. Even better is creating a new Generator all together (although it is a headache writing PHP code that writes PHP code!) – check out the sfAdvancedAdminGenerator plugin for inspiration.
- Don’t worry too much about performance especially if your application is running a bit sluggish on your local machine. On a proper server with a production installation of Apache and MySQL, the application I thought was a bit slow flew given the chance. You can optimise later.
- Don’t be scared of upgrading – I went up a symfony version during production without a hitch and without a change in my code (from 1.0 to 1.1 this will be different)
- Use a decent IDE. I use PDT Eclipse and it definitely speeds up development. You will frequently have to edit several files at once so at least use a text editor with tabs.
- Read the book! I can’t stress this one enough. It is extremely well written and is available for free on the website.
I’ll post some more impressions and a brief postmortem when the project is finished.
