
Rebuilding An HTML5 Game In Unity - mrtnkl
http://www.smashingmagazine.com/2014/04/24/rebuilding-an-html5-game-in-unity/
======
lnanek2
I wonder if they could have just used CocoonJS, which is basically a
reimplementation of WebView with better performance for games.

But, anyway, yeah, it's well know the WebView on Android is a disaster. A top
Facebook guy famously gave a key note at Android DevCon about why they
switched to more native on mobile and said, "We don't hate the web [and HTML],
we hate the webview." after going through countless bugs and performance
problems they encountered trying to do HTML on Android.

> A mechanism such as CSS to style items generated through code would be
> welcome.

Maybe they didn't know, but this is mostly ameliorated by just having an
example object setup however you like in the Unity Editor and then in your
code you always just clone the example and place it instead of creating some
new object. The example is basically your "style" and even non-coders on the
team are usually fine with tweaking it.

~~~
yulaow
At this point my question is the following: why on android and ios we have not
a javascript/html5 -> native framework?

I mean, the guys of windows phone made it. It is awesome and with great
performance... why android and ios that came up in the market way before have
still not implemented it?

~~~
jaegerpicker
Why would Apple or Google build such a thing? They are already both "winning"
the market in their own metrics. They both have huge numbers of developers and
have little interest in building tools that allow developers to work in a
cross platform way. MS built the HTML5/JS tools because they are behind and
need to attract every developer possible.

~~~
yulaow
Well because there are still more web developers out there than mobile
(native) developers. So, in any case, it would help getting more apps in their
store -> more happy users -> more money

~~~
zenbowman
Yes, but web technologies generally forbid you from doing anything remotely
innovative because of the way they are designed.

Most "web apps" work worse than most apps we had two decades earlier, both in
terms of design and performance. If you want people to pay for software on the
app store, it helps if you put some effort into making your app responsive and
exploiting the machine you are on. The only way to do this is with native
applications.

~~~
yulaow
And that's why I was talking about creating a framework that use
javascript/html5 to create native apps, like winJS on windowsPhone

------
GlickWick
My experience with Unity has been pretty solid too. I was incredibly surprised
as to how easy it was to get my game prototypes running on pretty much
everything.

My major gripe, much like the author's, is the Asset Store. It's full of
garbage with no real demo or refund system. There's also a lot of assets that
were built with old versions of Unity with no real way to identify them as
such. This especially sucks for 2D games, as the Unity2D system is pretty new.

There's also no great GUI system built into the framework yet, so you're stuck
buying nGUI or dfGUI.

------
ntaso
I can recommend Impact.js. It's a commercial engine for 99$ but so far, I
enjoyed working with it. It's canvas-based and optimized for tile-based
2D-games, but you can do other 2D-games as well with it. It comes with a nice
level editor.

You can get near-native performance with Ejecta, which is something like a
WebGL enhanced Canvas-only version of a web browser to put the game on the App
Store.

[http://impactjs.com/](http://impactjs.com/)

(Note: not affiliated, I just like the engine)

~~~
evo_9
Another option is Phaser - A free, open source game engine similar to Impact:
[http://phaser.io/](http://phaser.io/)

~~~
kin
I've been seeing Phaser a lot. Does anyone know of any commercially successful
games built with these HTML5/JS engines? I understand success should have
nothing to do w/ framework but certainly there are limitations/struggles of
trying to build a non-native game.

I'm basically trying to see if I should bet that mobile browsers will mature
enough or if I should simply invest my time in learning native mobile dev

~~~
thoughtpalette
I've played around with Phaser, and I've played around with PhoneGap. Using
what you know will always get your further faster than learning native, but
there _could_ be performance issues depending on the game.

------
DatBear
>Nothing is wrong with charging for add-ons, such as vector drawing and
tweening libraries, but it sets the standard for others to charge for their
code and is the complete opposite of the realm of the open Web, which
everybody is trying to push forward.

I don't like it when companies complain about having to pay for code, assets,
etc. Not everything should be open source, not everything should be free,
sometimes people should be able to be paid for the work that they do for your
benefit.

------
kevingadd
Many mobile devices still have neither hw-accelerated Canvas or WebGL, which
makes it pretty hard to run a performant HTML5 game on them. Unfortunate.

------
azakai
Unity announced they will support exporting to HTML5/WebGL, so it will be
possible to do a direct comparison of the original HTML5 version of this game
with one written in Unity and then exported to HTML5.

[http://unity3d.com/5](http://unity3d.com/5)

------
the_gipsy
The HTML5 version was using CSS, not canvas or WebGL.

Sadly, Unity still can't "export" to html and requires the user to install a
plugin for web, which is not available for linux.

~~~
m0rph3v5
WebGL export is coming in Unity5

------
camus2
do you have a link to numolition in HTML5? i'm curious about how it runs on
mobile.

