gles.js - a lightweight WebGL renderer for Android

Discussion and feedback on Construct 2

Post » Wed Mar 25, 2015 1:52 am

@saiyadjin thanks for the link :)

http://tmtg.net/glesjs/

For those who want to package their html5 game as an app (I certainly do) there is CocoonJS and Crosswalk (based on Chromium). I did find CocoonJS significantly faster than Chrome, but it still failed to produce sufficient speed on my tablet.


Since WebGL is virtually identical to OpenGL ES 2.0, which is available on any recent Android device, I was surprised with the low performance. I've seen my native apps do so much better. WebGL on mobile should be a better fit than WebGL on desktop, not worse. My suspicion is that Chrome/Chromium has a lot of security/safety/sandboxing overhead, and/or uses a renderbuffer compositing scheme for handling canvas scaling and HTML element overlays that doesn't play well with cheaper devices. CocoonJS probably has some of the same problems, in particular with regard to compositing.


At this point I have two games and some pixi.js and phaser.js examples running, and it looks good! I managed to whittle down the base APK size to 1,3 Mb. I've tested it against Chrome on several devices, but I guess evidence remains somewhat anecdotical. My experience is that gles.js indeed runs faster than Chrome, speed difference varies across devices. It's like between 50% faster and 5 times (!) faster. It also runs smoother, that is, where I often see small hiccups in Chrome even on fast devices, gles.js runs the same code silky smooth 60fps, which has become the norm on Android nowadays. And my limited testing with CocoonJS also indicates it's faster than their implementation.


I am happy to report that my second game, Tsunami Cruiser, also runs! I quickly made a gamepad port for the Ouya. I was quite surprised it runs at 60fps on the Ouya, as this beast is not well optimised and has like 2,000 particles and 100s of line segments and tons of trigonometry. CocoonJS runs this at around 40-50 fps with hiccups. Not bad, but the hiccups look terrible. I also ran it on the Moto G, where it also runs at 60fps (note you cannot move yet on Android). CocoonJS manages no more than 30fps on the Moto, and Chrome no more than around 20. So again, gles.js is consistently faster.


I know that Scirra will stick to slow CrossWalk because it's just easier for Ashley, since he is not making games and thinks that C2 devs can wait forever. But maybe @Ludei could contact gles.js author and use his knowledge? Or anyone else? Just dreaming...
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Wed Mar 25, 2015 4:43 am

"After that I want to do the following in the short(er) term:

improve Ouya support (iap), as I plan to release my web games for Ouya also.
Add font/text support. In the first place, pixi style bitmap fonts.
Add local storage support
add support for the most popular ad and monetisation services.
Finish testing pixi.js and phaser.js. Try three.js as well. And by popular demand, Construct 2. C2 won't be easy because it's not open source, which means it will be harder to debug."

This sounds like @Ashley need to pitch in and help, developing for mobiles is a large reason why I got into C2 in the first place. Our situation on Android has not gotten better for a long time and lately its been horrendous.

ps. The 50% to 500% performance improve noted by the author is akin to WKWebView on iOS8+ compared to regular WebView & Chromium. On iOS the situation is very good for performance of even mega size games.
B
68
S
24
G
19
Posts: 1,755
Reputation: 17,553

Post » Wed Mar 25, 2015 5:52 am

I'm starting to wonder if Android is even worth it.

Let's say we all woke up tomorrow to a magical universe where android performance was equal to 'native'...then what?

You still have an ecosystem that is very difficult to commercialize due to epic-level piracy, with a user base that overwhelmingly prefers free(mium) content, of which there is boatloads.

You still have to deal with thousands of different hardware configs, many of which don't work well to begin with.

You still have to figure a way to rise above heaps of festering shovelware (Poo Toucher 2: The Poo Knight Rises!) that is the end result of the very 'easy access' policies that make android attractive in the first place.

But then there are Ads...and they are so easy to implement! We all love ads...right?

. . . :?

The nail in the coffin: we don't live in a world of ponies and rainbows, and the reality of android performance is that it is all over the place, and will likely stay that way.

Meanwhile, iOS 8 is on 70-80% of Apple devices, and from what I've read and heard, perf rocks. The marketplace is less crowded, piracy is much lower, app sizes are reasonable, and there are only a handful of very well engineered devices to design for.

Me? I'm shopping for a Mac. ;)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Wed Mar 25, 2015 5:59 am

Not saying this is still 100% out of the possibility since it looks like this has improved in the last couple months but Ashley really commented on this wrapper the last time it was brought up. I personally think the only way we this wrapper would be supported is if someone does it themselves like ejecta was done i believe

Ashley wrote:In our experience non-browser HTML5 wrappers are a minefield of compatibility issues, bugs and performance problems of their own (like the fact CocoonJS never seemed to figure out why memory management is important). I am convinced there is no point supporting any new non-browser wrappers for Construct 2 games, and phasing out the existing ones when the browser technology catches up, which will happen with iOS 8 and Android L.


taken for this thread viewtopic.php?f=146&t=109396&p=801769&hilit=gles.js#p801769
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Wed Mar 25, 2015 6:07 am

@TiAm

Thousands of native developers are earning thousands of dollars on Android. So I guess that it's worth :) And you don't need special computer (Mac) or expensive phone/tablet to test your apps and you don't have to pay yearly fee for AppStore. Of course you can always deploy your game on iOS and double your salary.

And if you create good game (not crapware), then you can easily get good money with native AdMob and intertitials (3$ eCPM).
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Wed Mar 25, 2015 6:12 am

TiAm wrote:I'm starting to wonder if Android is even worth it.

Let's say we all woke up tomorrow to a magical universe where android performance was equal to 'native'...then what?

You still have an ecosystem that is very difficult to commercialize due to epic-level piracy, with a user base that overwhelmingly prefers free(mium) content, of which there is boatloads.

You still have to deal with thousands of different hardware configs, many of which don't work well to begin with.

You still have to figure a way to rise above heaps of festering shovelware (Poo Toucher 2: The Poo Knight Rises!) that is the end result of the very 'easy access' policies that make android attractive in the first place.

But then there are Ads...and they are so easy to implement! We all love ads...right?

. . . :?

The nail in the coffin: we don't live in a world of ponies and rainbows, and the reality of android performance is that it is all over the place, and will likely stay that way.

Meanwhile, iOS 8 is on 70-80% of Apple devices, and from what I've read and heard, perf rocks. The marketplace is less crowded, piracy is much lower, app sizes are reasonable, and there are only a handful of very well engineered devices to design for.

Me? I'm shopping for a Mac. ;)


I agree with every point you made.

If it ends up costing you a lot in time and/or money to port to Android, just stick with iOS. All the big devs say the same thing basically, their revenue share is 80/20 or even 90/10 in favour of iOS vs Android.

Still, the beauty of C2 (when it works) is that its very easy to port to multiple platforms. So if you build a game for mobiles, its a no-brainer to include Android! As such, an Android wrapper that is 50% to 500% faster is tremendously helpful.
B
68
S
24
G
19
Posts: 1,755
Reputation: 17,553

Post » Wed Mar 25, 2015 6:51 am

Silverforce wrote:If it ends up costing you a lot in time and/or money to port to Android, just stick with iOS. All the big devs say the same thing basically, their revenue share is 80/20 or even 90/10 in favour of iOS vs Android.


Exactly. The two things that began to change my mind: me reading one of your posts about how your game ran nearly as well on an iPad as on a desktop computer with a i5 3570k, and this article about Monument Valley's numbers.

Silverforce wrote:Still, the beauty of C2 (when it works) is that its very easy to port to multiple platforms. So if you build a game for mobiles, its a no-brainer to include Android! As such, an Android wrapper that is 50% to 500% faster is tremendously helpful.


I'd love to see it, but I think Ashley has made up his mind about wrappers, and honestly, I can see where he's coming from. Scirra isn't Unity, and I don't expect or want them to become that. There's no way they can handle the extra workload.

I'd love to be able to export to android in the future, just for the simple pleasure of seeing iPhone-less friends play my games. But anymore, it seems like 90% of our export woes have to do with android (okay, NW.JS isn't flawless, but it's a breeze compared to crosswalk). I'm starting to think it's a problem that doesn't merit a solution.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Wed Mar 25, 2015 7:51 am

@TiAM

Scirra isn't Unity, and I don't expect or want them to become that.


the main difference is that Unity takes some responsability. Scirra does not.

Problems with CocoonJS? Ask Ludei.
Problems with CrossWalk? Ask Crosswalk team.
Problems with Chromium? Submit a bug. Star issue.
Any other problems? Ask... submit... wait for better future.

and without FREE @Ludei support both iOS and Android export options would look like really bad.
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Wed Mar 25, 2015 11:49 am

Look at the bright side, Google will probably drop Android at some point.
Image ImageImage
B
165
S
49
G
148
Posts: 8,050
Reputation: 97,092

Post » Wed Mar 25, 2015 12:01 pm

My opinion hasn't changed: CocoonJS had such severe problems that users would demand refunds from us, and Ludei were not able to resolve them. I don't see this particular technology working out any differently. There have been recurring problems with every non-browser engine we've tried, which is several now: things like lack of memory management mean bigger games crash, and it can be an uphill struggle to even get the developers to understand the problem; meanwhile it's never been a problem in real browser engines. Then the lack of DOM, Web Audio, WebRTC, XML parsing and so on mean major C2 features get crossed off the list. This also causes other complaints like "it's not properly supported" or "why do you advertise features that don't work on mobile". So even if we followed up on this again we will just resurrect older problems and a different set of users will be unhappy.

These days it's almost impossible to write software without depending on some third parties - whether it's a compiler developer, operating system, device drivers, components (like that annoying D3DX installer requirement for Construct Classic games), library authors (e.g. for graphics/audio/input so you don't have to reinvent the wheel), installer engines, or even other software that conflicts with or breaks your own (like overzealous antivirus or conflicting software that breaks features, like some firewalls blocking C2's preview server). If you're tired of "ask someone then wait for a better future", then this does not go away by depending on other third parties. Think of running in to a problem caused by Microsoft (think of how they dropped XNA support - oops! we'd be hosed if we went with that), AMD (abjectly ignore driver bug reports and even if they fixed it most devices wouldn't be updated anyway), library authors or whoever else who may not have our own priorities as their focus. Yes, it sucks when Chromium goes through a rough patch and bugs end up in NW.js and Crosswalk which are on slower release cycles. But no, I don't believe radical technology shifts are going to make this any better, and they have a huge work overhead; what a terrible shame it would be to set ourselves 2 years behind working with some other technology, only to find it's not any better. Meanwhile I am confident whatever current HTML5 issues there are on any platform will get worked out.
Scirra Founder
B
382
S
223
G
86
Posts: 24,003
Reputation: 189,843

Next

Return to Construct 2 General

Who is online

Users browsing this forum: gameglaux, odiusfly, TheRealDannyyy and 1 guest