Article on HTML5 game development

Discussion and feedback on Construct 2

Post » Wed Aug 29, 2012 11:45 am

I found this interesting because I am going through the pain of getting basic games working acceptably on mobile, our most important platform.

http://www.sitepoint.com/hints-for-making-a-cross-platform-html5-game/

Interesting bits:

When I began HTML5 game development, I thought it was a nice idea to render game using Canvas, because its quite useful on desktop computers. But on a platform like the iPhone 3GS, it turns out to be a bit of a headache. The game performance sucked; images were rendering at less than 5fps. I had to create rendering engines, one after another.

Currently, I rely on the DOM (Document Object Model). It dictates the way in which my applications are constructed of HTML elements and CSS3 selectors, rather than how theyre rendered to a Canvas. The advantage of using the DOM is that the game can be much faster and more responsive, due to hardware acceleration. Its important to test your game again and again, and I personally think using the DOM is a better choice than Canvas.

Deal with Audio Issues
Embedding sounds within a game is vital. Unfortunately, the biggest issue in developing a cross-platform HTML5 game is sound. Within HTML5 game development, Canvas has good support, Video is constantly improving, but Audio is still pretty patchy. Games cant play sound and music simultaneously. Taken from this aspect, HTML5 is not necessarily an ideal Flash alternative!
Other audio issues include:
     Different browsers support different sound formats (mp3, wav, ogg etc)
     iPhones and iPads allow only one mp3 sound to be loaded and played at any time
     Android has limited support of the <audio> tag and the JavaScript audio API
There are a few ways around these issues:
     For the format issue, I duplicate all game sounds in two formats (OGG and MP3), which covers most browsers.
     For the iOS platform, I keep sound and music in the desktop version of the game, and only music in the mobile version.
     As for Android, because it supports Flash audio play, so I use jPlayer to handle automatic HTML5/Flash audio transition.

B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Wed Aug 29, 2012 12:01 pm

You should only consider publishing through appMobi or Ludei for the time being. Their services hardware-accelerate games for maximum performance, and add reliable polyphonic audio support as well.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Aug 29, 2012 12:44 pm

Unfortunately, appMobi etc are not options for us, as our games are casino type games which are not allowed in the stores, and we have our own existing web based payment systems.

We have to deploy these apps in the standard browser, and find work arounds for the various issues (we can live without sound effects for now).
B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to Construct 2 General

Who is online

Users browsing this forum: MatheusCastellar and 18 guests