Is HTML5 a legit language for developing game?

Started by
28 comments, last by dacypher22 10 years, 2 months ago

@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

Playing: Riftforge - an online rpg with tactical combat similar to 90s RPGs

Sign up for the playtest and get a 50,000 gold headstart!

Advertisement
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.

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.

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!

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.

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.

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

@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?

Please check out Phaser for html5 game development. It's a pretty slick game framework using hml5.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

"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.

This topic is closed to new replies.

Advertisement