Facebook Game – Mountains out of Molehill

Facebook Game - Mountains out of MolehillSorry for the gratuitous pun but I couldn’t resist ;)

I’d been meaning to do this for a while but this weekend I replaced my BitmapData based renderer for my game with one that utilises the new hardware accelerated graphics of Flash Player 11 (formally Molehill). Rather than getting into the low level code required to make a custom renderer I decided to use one of the 2D frameworks that the Flash community have come up with. I chose the excellent ND2D by Lars Gerckens because it seemed to have all the features I’d need and the demos blew my socks off (press space to cycle through the demos on that page)! I like Lars’ implementation of Sprite Clouds (a group of sprites with a common texture), they work perfectly for game entities like projectiles and particle effects.

My renderer is un-optimised (I was eager to get something up and running as soon as possible without doing too much refactoring) and I’ll be making some changes to bring the game more in-line with the ND2D display list paradigm, but I think its a good start. I’ve noticed a huge performance boost already, the game is running at a smooth 60fps on my PC now. The next step will be to up the game viewport size as this was previously limited by how many tiles I could render every frame using BitmapData.copyPixels() without performance suffering. I’ve also noticed that screen tearing has completely disappeared (it was a real pain when using the BitmapData method).

If your planning to get involved with Flash Player 11 game developement then there are a few things to bear in mind when designing your application structure. The biggest one is that all Stage3D content is rendered on a layer (or layers) below the main flash stage. So, regardless of where your ND2D world is added to the display list, your game content will be behind all other display objects. As a result you need to cut a hole through all display objects that make up your UI (backgrounds etc) so the Stage3D content can shine through. Another thing thats worth implementing from the get-go is a time based (rather than frame based) update system. This is standard game dev practice but I’ve only just got into it. Instead of moving items the same distance every frame (I believe) it is better to move items based on the time since the last frame was rendered. All ND2D sprites have a step() method that accepts an ‘elapsed’ parameter. The ‘elapsed’ param is the number of seconds since the last update and all movement should be based on that (“sprite.x += 1 * elapsed” rather than “sprite.x += 10″). The resulting movement is much smoother as it compensates for variation in the number of milliseconds between updates caused by CPU/GPU usage.

Dabbling with this framework has got me really excited about the possibilities that will arise when this version of Flash Player penetrates through the market enough to start using it for client projects!

Money Timeline

Money Timeline

My girlfriend suggested I use a budget to keep a better grip on my finances. I never got around to doing one because I got sidetracked by making an AIR app which imports my bank statements and visualises my expenses over years, months and days. It was great fun to create a tool which I actually use and looks nice!

Money Timeline - Day View

Facebook Game – Work In Progress

Facebook Game - WIP
I’ve been working on this game for some time now. Its a twin stick shooter in which players settle a land and then defend it from attacks whilst attack lands owned by their Facebook friends. The graphics engine uses BitmapData blitting to render large numbers of assets quickly. The system generates landscapes using perlin noise which can be seen in this render of possible lands – http://www.flickr.com/photos/tomdanvers/5765825135/lightbox/. I’m allowing players to see my work in progress builds so I can get feedback as the game progresses.

http://apps.facebook.com/re-source/

Tele2 – Fastpris Verdensrekord

Tele2 Fastpris Verdensrekord

Norwegian telecomms company Tele2 decided to promote a mobile phone package by setting the world record for ‘longest phone call’. We created a site to support the live event. I did the flash development and worked closely with another developer to create a wordpress based site that allow the public to experience the record attempt in realtime.

http://www.verdensrekord.no/

We overcame some pretty major challenges to create a website that could be updated dynamically for the duration of the event. We had 5 FMS feeds on the site that the users could switch between at will. Admins were able to leave updates about the live event on a timeline which also rendered the viewer stats for each competing couple in graph form.