Commentary on: 5 Best Practices for Building HTML5 Game
Kai Jager writing for MSDN has posted 5 tips for best practices for writing HTML5 Games – here’s his 5 tips (with my comments on each):
1. Use a framework
Kai’s point is that while at the basic level, making a HTML5 is pretty straightforward, to build a “professional” level game there’s a lot of nitty-gritty details such as asset loading and timer shenanigans that need to dealt with. His recommendation is to use a framework such as Impact.JS. While in theory this is a good idea, I’d recommend understanding the basics of HTML5 game development before you put too many abstractions between yourself and your game. HTML5 Game engines are fairly new and are “leaky abstractions” – they are new enough that you’ll often need to make significant modifications to do anything out of the ordinary. Failing to understand the technology your game is going to be built on means your going to run into problems you can’t solve when you open up the Impact source code and have no idea what’s going on.
2. Consider small- and touch-screen devices
Great idea – especially with the metro interface launching with windows 8 – where touch screen devices will become first-class citizens in the general computing world. HTML5 is the only technology that should work across any modern device – so use that to your advantage by considering different types of devices and resolutions right from the start.
3. Automatically save the player’s progress
User, especially on mobile or at work will jump in and out of your game frequently – so letting them jump right back into where they were originally should be an important consideration. I’d add also that you should load your assets progressively – so the user doesn’t have to sit at a long loading screen just to get a 5 minute game break.
4. Use a profiler
Games need to be as-fast-as-possible, using a profiler is the only way you’ll get that extra performance out of your game – and please don’t assume what you think is fast is going to be fast – there’s lot’s of levels of optimization going on, so tricks such as loop-unrolling might end up being a net performance hit when compared with optimizations the JIT compilers of today are doing.
5. Be creative
Not much to say here – other than HTML5 opens up lots of new opportunities to take games out of their confined boxes (whether literal boxes like the XBox or figurative ones like the flash player SWF box we’re used to on the web) – so go shift some paradigms.
Check out the full article