• Advertisement
Sign in to follow this  

Is HTML5 a legit language for developing game?

This topic is 1451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Developing mini game has been a hobby of mine for quite sometime. I did make some games on Java before, but I'm more familar HTML & javascript so I really love the idea of developing game using html5.

 

But since html5 is still quite new I'm a little bit worried. It is not well-supported yet even in web development - which is what html5 was born for. Is it ok to make games using html5?

 

I saw some engine says it can port its game to html5 and even put it in Android/iOS wrapper. The boast seems quite questionable but also brought me some hope...

Share this post


Link to post
Share on other sites
Advertisement

Flame war not intended ... I just don't like what Jobs has done to computing (Steve Wozniak kind of backs me up on this). But that wasn't the bulk of my point.

 

I don't want to imply that HTML5 should be tossed in the bin because, as I said, it has many good uses. I've seen some impressive 3D demos, and some great 2D game ports, but unfortunately those were browser-specific (which to me is a limiting factor), and didn't always perform well mobile devices (which to me is also a limiting factor, especially for games). It's been my experience that unless there's some sort of overarching uberagency to IMPOSE standards, we're not likely to see them coming to an apex, instead, development of individual standards will continue in parallel (with a bunch of common overlap, as today). That includes Microsoft, of course -- Internet Explorer is always a special challenge to work with (especially a couple of versions back).

 

I agree that workarounds exist, and that working on the wild frontier can be fun and rewarding, but developing a game in HTML5 is a challenge and for me requires too much effort on things that are elegantly implemented in Flash (AIR on mobile).

 

There is currently a debate happening about implementing a closed Digital Rights Management regime into the open HTML5 standard -- is this a start down that slippery slope to closed and proprietary? Or are we there already? There are many forces competing for access to web standards and I'm not sure that'll go away any time soon. Proprietary software standards are nimbler and faster and so I can't see those not being implemented in browsers as new features (but only for those browsers, of course).

 

Basically, I don't see this horse race coming to an end any time soon, so while I don't doubt that eventually most HTML5 features (which are still being discussed) will be implemented in most browsers, there will continue to be those nagging differences. Maybe I've just gotten pessimistic over the years :)

Share this post


Link to post
Share on other sites

Let my share my small experience here.

 

Here is the game I made in HTML5:

www.creatures-of-gaia.com/play.php

 

Write once, run debug everywhere!

 

I think that, despite HTML5 intentions are ideal (write once, run everywhere), it is in practice very differently from theory.

The problem is the sheer number of devices * browser. First, you have to make your game look nice on a variety of resolutions, aspect ratios and device performance, which is a challenge in itself. Making your game run well on a small low-end device and look good on a big screen ideally requires different sets of graphics (low-res, hi-res, etc.).

 

However, the real problem lies in the fact that the technology is not mature nor homogenous. On some browsers, you'll have to play ogg files, on others mp3 ...and detect and load the appropriates files accordingly. Same goes for all other APIs, some browsers support it, some don't, and some do with a twist. Even simple things like "window.orientation" to detect portrait or landscape work completely differently on the various devices ...if it works at all.

 

Things go even deeper, as mobile browsers are not even stable. For instance, on my Android device, the game runs fine in the default browser, but chrome and FF crash (reason unknown). For iphones, the game mysteriously stopped to load at some point. No error, nothing, it just stopped. It took me a long time to discover it's because of a built-in limitation in safari mobile that images can only be 5 Mega-pixels big. In the end, it requires a lot of testing, a "per device / per browser" attitude to fix things one after another, if possible at all.

 

The tools and Ecosystem ...we're at the very beginning

 

...oh well, I think I don't have to go into details for that one. The web is a boiling place and there are a lot of initiatives emerging everywhere, but it's still very young.

 

You are not native

 

The great thing about HTML5 is that it can run almost everywhere. However, you still have the drawbacks that you don't have native performance (big gap), don't have the same look and feel, and limited phone features support.

 

My preferences

 

Despite all my bashing, for casual games I think HTML5 is a nice pick and I would probably continue using it. I think the thing I like the most is that you can simply put it on the web and people can play it by the click of a link ...the only problem is that nobody does. For my games, I used HaXe and createJS. It was a good choice and I can highly recommend them. For game makers, I heard a lot of good things about construct2.

Edited by creatures-of-gaia.com

Share this post


Link to post
Share on other sites

@PatrickB Obviously, you haven't seen what Flash does to my Macbook Pro. So I guess this is where Steve was coming from... if it does it to MBP, imagine what happens to iPad (iPhone).

 

As to the original poster, HTML5 is OK for simple interfaces but once you get to "real" game development, it could be cumbersome. Keep in mind that a ton of people are stuck at IE9 which has problematic support for HTML5 and (as we found out) WebSockets. 

 

I wouldn't say we're pushing the envelop, but Riftforge is a pretty good example of a game that is well-suited to HTML5. It's turn-based and it doesn't have unit animations (only effect animations): 

https://riftforge.com

Share this post


Link to post
Share on other sites
Overall my experience using HTM5 has been positive. That being said, the issues I have experienced are due to the Canvas not cooperating with what I want it to do (for example, no way to disable min/mag filter when scaling images), JavaScript performance which is overall quite good on the desktop, but varies wildly on mobile as you could imagine. And also the difficulty in managing a large codebase in a dynamic language.

Share this post


Link to post
Share on other sites

HTML5 is okay for basic games with minimum animations for Desktop. Its mobile support is very poor and kills mobile battery as fast as Flash did. If you want something really performant, cross platform and as easy to develop as JS - you always have Flash here. Stage3D and ability to make as performant as native games on mobile due to underlying OpenGL-based rendering system is astounding. It won't go anywhere anytime soon, despite everything doomsayers have been telling us for 10 years.

Share this post


Link to post
Share on other sites

I'm a web dev currently but moving back to games (used to do native stuff, back in the day, and it is back in the day!) and the kind-of anti-HTML5 rhetoric you sometimes hear of comes either from native guys who feel threatened or in the gaming industry, the former group will always feel threatened and rag on new tech whereas, thankfully, the forerunners of the latter group are almost unanimously changing their opinion about HTML5 and the web platform.  It is a shame that many very good (and well cited) responses here sound dreadfully, dreadfully dated.

 

It is fairly astounding that people still try to sway questionners to Flash.  Given that someone asking a question is generally looking for information, it is irresponsible to sway them towards an outdated technology that is going absolutely nowhere.  Whilst you can probably cite a company that is still throwing in with it try to name a big company that has not dropped Flash as an active development platform, including, of course, Adobe.  I wont cite because any search will throw up articles, some several years old explaining why backing Flash is an incredibly bad move.

 

As I employ and frequently interview guys of varying experience (from very good contractors to younger guys) whose background is with Flash but must now 'slum it with us Javascripters' it is evident that throwing your eggs (and all of that time you'll spend learning something) behind Flash is not a good move.  The problem is that certain companies have invested heavily and are unable through fear or ineptitude to ditch their Flash ecosystem and they will continue to shout for a while yet.  Luckily it becomes easier with each passing week to ignore them - plus their voice is diminishing anyway.

 

HTML5 is still developing but I'm not sure why anybody with any experience of actually writing applications or games on the web would consider it new.  As I'm an active developer exploring ES6 spec I can assure you that HTML5 will soon become 'old', or, at least, it will become mature.  The question of maturity is far more difficult to tackle.

 

The strengths of Flash (if you choose to ignore its many crippling weaknesses) are still ahead of HTML5.  This is largely a question of investment and time.  Flash is flawed and could never have moved much further forward than when it died.  HTML5 is still a maturing platform and parity is almost already active - this is incredible given that the scope of HTML5 is far greater and the emergence of mobile (whilst the final nail in the Flash coffin) has only expanded that scope.  Luckily, HTML5 is just that damn amazing that it can take on challenges like mobile and be flexible enough to survive and thrive!

 

As a game developer the biggest challenge you face is not actually fragmentation (which is a major major issue) but performance.  Performance is always thrown as a criticism of the fundamentals of the web platform but its all relative.  Whilst optimal performance is desireable it is actually unnecessary, if something is perceived by the user to be performant enough then it doesnt matter if it is optimal.  However, many games are a group of application that push performance and getting JS (in its current guise) to perform fast enough is difficult and requires incredible skill.  Whilst JS is often perceived as being a 'weak' language (partly through its loosely typed and interpreted nature but mostly due to previous employment of JS) it, when part of the greater web platform, is actually incredibly difficult to write properly and requires as much as skill as many other mature languages.

 

Having said that, the question of optimisation is also important.  Some reckon Typescript or HaXe help the optimisation step as certain assumptions can be made about the structure of the code but the main reason large companies making 'web platform' games use these JS variants is code structure and readibility within larger teams.  Dart performance seems good and is growing in adoption and there is emscripten and asm.js that are really reaching forward how much JS can be optimised to increase performance.  This is all without considering steps made forward by V8 or other interpreters, if you believe Microsoft then their JS interpreter for IE11 is supposed to be absolutely top-notch and beats Google's.  I cant really comment on which is better but suffice to say there is considerable development and investment in making these technologies better so expect support to only get better.

 

Depending on what you want to make, HTML5 is ready now (audio, as mentioned, is extremely problematic, although usually not insurmountable).  Offline support is available, although unwieldy, multi-player 'support' can often be easier (this is admittedly a sweeping statement to be taken with a pinch of salt) and the ecosystem is thriving (although forerunners are not yet entrenched as industry 'standards').  The GPU is within your reach (with fallbacks in most cases, canvas is near ubiquitous although performance is perceived as sketchy often due to CPU limitations) although not across all devices, as said, fallbacks do exist but may not be good enough depeding on your use-case.

 

If you're still worried check out Google Experiments, there are even some 'complete' games in there of very high quality.  Libraries like Three.js, Pixi.js, Phaser and loads of others are largely building on lessons learned from Flash but are pushing forward 'gaming' on the web platform and well worth a look.

 

However, JS is hard.  Programming on the web is very hard.  You have to write a lot yourself and there is a lot to understand about the nature of the web.  The games industry is learning, often the hard way (the graveyard of failed projects is large), that the web platform has very unique and new problems that it has not seen before.  The sands beneath your games' foundations are still shifting with HTML5 which is, to say the least, disconcerting.  Still, it is extremely exciting!

Edited by furiousuk

Share this post


Link to post
Share on other sites

Check out ImpactJS. It works basically the same across all desktop browsers (the only real oddball is of course IE, which I think requires IE 9 and up). For mobile, you would probably do better with something like CocoonJS, which is dead simple and allows you to package your game as a native app (technically called a "hybrid app"). In my opinion, packaging an HTML5 game as an app that can be downloaded through the various app stores is an infinitely better choice than having it web-based, simply for visibility, monetization options, etc. But I understand that having choices is a good thing, and some games are not designed to be downloaded through the app store (such as site gamification apps, brand-awareness mini-games, etc.). The main issue is that HTML5 Audio is still being sorted out on mobile. 

 

There are pages and pages of games that work cross-browser with one codebase for Impact, and CocoonJS has pages and pages of converted HTML5 games doing well in all the major app stores, so to say it isn't valid today is simply wrong. 

 

The bottom line for me is that after a while, HTML5 Audio will be sorted out and HTML5 games will work fine on mobile, whereas native Flash is basically banished from mobile now that their last major hold-out, Android, dropped native Flash support a while back. HTML5 is going to continue to get better and better, but Flash isn't coming back to mobile outside of AIR packaging. Is Flash "dead" or "dying"? Of course not, and it likely won't be for decades. But the days of 95%+ installbase on all Internet-connected devices is long over. 

Edited by dacypher22

Share this post


Link to post
Share on other sites

HTML5 is the closest development setup that I have found that resembles the good old days of programming in BASIC on computers like the 48k Speccy or the Commodore 64.

I can just switch on a device write a couple of lines refresh the browser and see instant gratification.  I can even write code on my iPad or iPhone (not really that useful or productive but still fun).

 

As for cross platform issues I haven't had any major issues other than the ones mentioned by previous posters which are well documented and well known issues so they really shouldn't hold anybody back or be a stumbling block.

Share this post


Link to post
Share on other sites

I actually just wrote a blog post about this. Simply put, HTML5 is definitely legit, but write HTML5 games for that purpose. Intend them to run in browser. Don't try to replace an otherwise native app or try to make the next CoD in JS. I'm mainly a C++ guy, but I wanted to give it a shot, so I'm currently writing a small JS game with pixi.js. I'm impressed, but it's definitely different.

 

I saw some engine says it can port its game to html5 and even put it in Android/iOS wrapper. The boast seems quite questionable but also brought me some hope...

Don't do this. The performance of UIWebView is not the same as the browser. Chrome for Android is amazing though.

 

HTML5 for game development is something to stay well clear of, unless you're ready to waste a bunch of time and meet with frustration. I have developed many games in Flash and some in HTML5/JavaScript, some of them being direct ports of each other, so I've had lots of time to experience the broken promises of the HTML5 "standard".

 

If you're just looking to play around, HTML5 and JavaScript are probably the most accessible (you need a browser and a text editor), but I would highly recommend taking those skills and transferring them to something like ActionScript or even Java. C++ is a great language for sheer performance but it requires a learning curve.

It sounds like your attempts haven't been very recent. Even in just the past 6 months HTML5 support has grown. It is just as much capable, if not more, than Flash now, and it's going to continue to grow.

I reccomend playing around with all those languages regardless, though! biggrin.png

 

As to the original poster, HTML5 is OK for simple interfaces but once you get to "real" game development, it could be cumbersome. Keep in mind that a ton of people are stuck at IE9 which has problematic support for HTML5 and (as we found out) WebSockets. 

IE has always been a problem to web developers in general. I honestly wouldn't even worry about it. Anyone using IE9 (or IE at all) probably isn't looking to play web games, and if they are, they should upgrade. That is like supporting iOS1 when releasing iOS games.

 

HTML5 is okay for basic games with minimum animations for Desktop. Its mobile support is very poor and kills mobile battery as fast as Flash did. If you want something really performant, cross platform and as easy to develop as JS - you always have Flash here. Stage3D and ability to make as performant as native games on mobile due to underlying OpenGL-based rendering system is astounding. It won't go anywhere anytime soon, despite everything doomsayers have been telling us for 10 years.

 

The bottom line for me is that after a while, HTML5 Audio will be sorted out and HTML5 games will work fine on mobile, whereas native Flash is basically banished from mobile now that their last major hold-out, Android, dropped native Flash support a while back. HTML5 is going to continue to get better and better, but Flash isn't coming back to mobile outside of AIR packaging. Is Flash "dead" or "dying"? Of course not, and it likely won't be for decades. But the days of 95%+ installbase on all Internet-connected devices is long over. 

I forgot about AIR and Stage3D. I've always been an advocate of "Flash is here to stay," but I'm on the other side now. You bring up good points, but Flash in browser is definitely on the way to retirement. If you're new to either at this point, and trying to decide between HTML5 and Flash, I vote HTML5. wacko.png

Share this post


Link to post
Share on other sites

@PatrickB Obviously, you haven't seen what Flash does to my Macbook Pro. So I guess this is where Steve was coming from... if it does it to MBP, imagine what happens to iPad (iPhone).

 

As to the original poster, HTML5 is OK for simple interfaces but once you get to "real" game development, it could be cumbersome. Keep in mind that a ton of people are stuck at IE9 which has problematic support for HTML5 and (as we found out) WebSockets. 

 

I wouldn't say we're pushing the envelop, but Riftforge is a pretty good example of a game that is well-suited to HTML5. It's turn-based and it doesn't have unit animations (only effect animations): 

https://riftforge.com

 

Flash runs great on every device I have (including mobile). The problem is today the same as it was when Jobs made his pronouncement---slow, bulky Apple products based on a purposefully crippled OS (in the name of "user experience"), are the problem, not Flash. I've done countless side-by-side comparisons (many of them not involving Flash), and Macs have always -- no exaggeration - been far slower and crash-prone. I've had fanbois sitting next to me during these comparisons tossing out "explanation" after "explanation" about why OSX was slow here, or why applications were more prone to crash there, etc. End result: Apple products suck. That's why Apple has been shifting the blame from Flash to Java to Reader...did you ever stop to think that maybe it's not the rest of the world that's the problem but the hardware / OS?

Share this post


Link to post
Share on other sites

"Depending on what you want to make, HTML5 is ready now (audio, as mentioned, is extremely problematic, although usually not insurmountable).  Offline support is available, although unwieldy, multi-player 'support' can often be easier (this is admittedly a sweeping statement to be taken with a pinch of salt) and the ecosystem is thriving (although forerunners are not yet entrenched as industry 'standards').  The GPU is within your reach (with fallbacks in most cases, canvas is near ubiquitous although performance is perceived as sketchy often due to CPU limitations) although not across all devices, as said, fallbacks do exist but may not be good enough depeding on your use-case."

 

Let me see if I got this straight:

 

You can't really do audio, you can't reliably store data offline, maybe in the future there'll be multiplayer support, and you can get GPU acceleration and 3D but only with a bunch of caveats. Internet Explorer is a big JavaScript "gotcha" (who uses that dumb old Internet Explorer anyways?), and mobile support (isn't that what HTML5 was supposed to be all about?), is less than amazing.

 

"As a game developer the biggest challenge you face is not actually fragmentation (which is a major major issue) but performance."

 

There's more?!

 

"Whilst JS is often perceived as being a 'weak' language (partly through its loosely typed and interpreted nature but mostly due to previous employment of JS) it, when part of the greater web platform, is actually incredibly difficult to write properly and requires as much as skill as many other mature languages."

 

Well that's a selling feature. Incredibly difficult.

 

"However, JS is hard.  Programming on the web is very hard.  You have to write a lot yourself and there is a lot to understand about the nature of the web.  The games industry is learning, often the hard way (the graveyard of failed projects is large)."

 

Well I'm sold.

 

"HTML5 is still a maturing platform and parity is almost already active."

 

Right...http://en.wikipedia.org/wiki/Comparison_of_HTML5_and_Flash

 

The same problems that plagued Flash in the early days are back all over again because lessons of the past are being tossed in the trash in favour of a bullheaded push for HTML5. Often CSS and JavaScript get forgotten, but they're an integral part of the whole. And overall, that adds a whole lot of complexity. Plus, unless you want to limit your audience, there's that cross-browser thing, which is still a problem.

You can do things like PhoneGap to app-ify your JavaScript/HTML5/CSS3, but it`s nice to be able to step into other technologies if it doesn't work out. In the browser, even more so. ActionScript is simply a more complex version of JavaScript -- it's not about 'slummin' it but it really is like the old days of Flash. I can't avoid HTML/JavaScript/CSS in my daily work, and I don't dislike it (remember that Flash runs in HTML and obeys the laws of JavaScript to some degree), but it's just not what it's promised to be. And considering JavaScript/HTML are older than Flash/ActionScript, they (HTML/JS) just never quite managed to make the same advances or penetration. Maybe that's a community open standards thing vs. single custodian thing, I don't know.

Edited by Patrick B

Share this post


Link to post
Share on other sites

On the topic of cross-browser code, its a great ideal, and I don't think its beyond workable, even if its painful -- but, on the other hand, you can side-step most of it if you can simply accept not running on absolutely every browser. In that case, you are simply saying "Browser X is effectively my game client application". I think that's mostly fine, millions of people will already have your game client, your game client is probably already white-listed in most school/work environments (whether people should be playing in those locations is up to them to decide when and when its not appropriate), and for someone that really want's to play your game, what difference, really, does it make whether they download a proprietary client or a specific browser? When you start looking at issues of security and trust and potential liability, a browser is actually better in many respects for both the developer and the end user.

 

You still might have to deal with intra-version performance regressions or broken features -- it's not a guarantee that new versions contain changes that affect the way your game works, but its common enough you'll probably bump against it from time to time. If you picked Chrome as your target browser, Google tends to be on or near the bleeding edge, and chrome alone accounts for almost 60% of web traffic, so you can probably say conservatively that 50% of web users already have your client installed, which is huge. If you were able to add Mozilla to your list of supported browsers, that's another ~25%. IE, another 10%. And all three of those are working towards merging their desktop and mobile versions over the long term, Google is phasing out their mobile browser to be replaced by mobile Chrome, and IE, although behind the others on features, is already the same codebase across Desktop, Windows RT, and Windows Phone (They're not at feature parity yet, though).

 

So, yes, its a lot of work to maximize the promised potential of HTML5 today, but even just 50-60 percent of web users as a potential audience is not to be understated -- That's bigger than all of the big app stores and steam combined. Chrome has over 750 million active users; if you could make a dollar from even 1 percent of those users, you'd be a rich man. Easier said than done, of course, but its got the potential. For transparency's sake, Adobe reports that Flash can reach 2 billion users, but that number rolls up essentially all PC and mobile install-base, because those platforms can be targeted by Adobe Air (compiles flash to native apps), so its not people who have Flash Player et all installed.

Share this post


Link to post
Share on other sites

I learned a little HTML5... The language is reasonably new but it is amazing and can absolutely be used to create games.

 

A very popular game you'd probably know about which has recently implemented HTML5 would be Runescape. Check it out http://www.runescape.com/beta/html5

Share this post


Link to post
Share on other sites

I learned a little HTML5... The language is reasonably new but it is amazing and can absolutely be used to create games.

 

A very popular game you'd probably know about which has recently implemented HTML5 would be Runescape. Check it out http://www.runescape.com/beta/html5

 How the hay does one port a Java MMORPG game into HTML5 ?!

 

 There has to be another back end language being used - unmodified JavaScript can not handle multiplayer in real time !

Edited by Shippou

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement