The Near Future of the Web Platform

by Ashley | 12th, April 2013

As you probably know, Construct 2's game engine is based exclusively on HTML5 browser technology. Even when ported to other platforms as "native" apps using wrappers like node-webkit or CocoonJS, it's still the same HTML5-based engine powering the game. This means feature support depends on what the browser provides (or in some cases what the wrapper supports). The web is advancing quickly, and there are some features and developments on the horizon which may be of interest to Construct 2 users. Here's a summary of what we're keeping an eye on here at Scirra.

Improving mobile browsers

Android 4+ users can now use Chrome for Android, which is now more or less up-to-date with the desktop browser and is on the same 6-week update cycle. It's immeasurably better than the Android stock browser, so we strongly recommend using it. New Android devices also now ship with Chrome as the default browser. There's also a beta version you can use to check out updates sooner, like with the desktop version. There's also Firefox for Android, although its WebGL performance is a bit slow at the moment due to a known issue.

Safari for iOS is steadily improving as iOS gets updated. iOS 6 brought the Web Audio API for Safari, as well as faster Javascript performance, and has had hardware accelerated rendering since iOS 5. Be sure to update your iOS devices whenever possible to get the latest features and performance benefits.

With the latest Safari iOS and Chrome for Android, our tests have shown browser gaming on mobile is surprisingly good - just watch out for the weaker GPUs and limited memory, especially on old devices. While mobile browsers are still a little behind desktop browsers, they're steadily improving and catching up. We think the gap should be closed up soon!

Increasing WebGL support

We've supported a WebGL renderer for Construct 2 games for a long time now. It's about twice as fast as canvas 2D - or more, depending on the benchmark - even on mobile. It also supports some really awesome effects. However for a long time it hasn't been widely supported, only working on desktop Chrome and Firefox. This is beginning to change.

Most interestingly, it appears Internet Explorer 11 may support WebGL. If it did, WebGL would be supported in all major desktop browsers. Note however this is based on clues from a leaked build; Microsoft could change their mind... but let's hope they don't, especially since a significant part of our criticism of IE10 was about the lack of WebGL support.

On mobile, improvements are on the way too. Chrome for Android can enable it from chrome://flags, and we expect it should be on by default in the near future. Firefox for Android supports it, and new mobile platforms like Firefox OS and Blackberry 10 also support it by default. If IE11 supports it then hopefully Windows Phone 8 will as well. That just leaves Safari - but considering they already support it but have disabled it, hopefully they'll join in eventually as well. Finally, Ludei have announced support for WebGL in CocoonJS, which should allow you to rely on WebGL support in iOS and Android native apps regardless of the browser. So the picture of WebGL support should be improving a lot in the near future!

Chrome splits from WebKit

For the past few years, Chromium (the engine behind Chrome) and Safari have shared the same open-source rendering engine, called WebKit. Recently Google decided to split off from WebKit and create their own independent engine called Blink.

In the short term, this will have very little effect; for now, Blink is still virtually identical to WebKit. However it's interesting to think about the long term implications. It means Google has more freedom to experiment with their browser engine. This could mean more features and better performance, all delivered more quickly than was previously possible. We're definitely watching with interest to see what Blink is going to make possible.

Rumour of Chromium-powered Android web view

This is a pretty technical point, but if any of you have tried publishing a game with PhoneGap, you've likely found the performance very poor on both Android and iOS. This is because the native app's browser (the Web View control) is very slow on these platforms. It's not actually a full browser, and lacks the things that make browsers fast, like hardware-accelerated rendering. While CocoonJS exists to solve this problem, we've heard rumour from Google that Android might use Chromium for the web view. This means making it more like a real browser, and hopefully includes all the performance benefits as well. We don't know if this will really ship, but let's hope it turns up in Android 5!

Asm.js

Mozilla have launched a fascinating project called asm.js, aimed at making it possible to get native performance from browser apps. However, we probably won't be taking advantage of it for Construct 2. I've explained why in more detail in this forum reply I made about asm.js.

WebRTC

The User Media object uses WebRTC to let you access a video feed from the user's camera in Construct 2. Microphone input is also on the way. You can try it now using this microphone input demo, but it currently requres Chrome Canary (and a microphone!). It should be coming soon to stable Chrome and hopefully other browsers after that. This can allow for some truly innovative ways to control games - anyone remember GNILLEY?

WebRTC doesn't stop there. It's all about real-time peer-to-peer communication. It opens up the possibility of low-latency multiplayer networking, in a way which is much more efficient than WebSockets can achieve. We'd love to explore this further in future, but we can't guarantee anything right now. It's still an early browser feature, and we've got a lot of other requests to consider in the mean time!

Web Audio API

When the browser supports the Web Audio API it allows for all kinds of advanced audio effects, including positioned sounds. It's currently supported in desktop Chrome and iOS Safari. However Firefox are actively working on it, and Chrome for Android should support it soon too. We think audio effects are a great way to make games more immersive, so let's hope it continues to become standardised and become adopted by other browsers and platforms.

Web MIDI API

While it's a bit more of a niche use case, for musical games being able to use MIDI input and output could be exciting. This one isn't supported anywhere yet but is on the standardisation track. If browsers support MIDI input and output, we'll be sure to add a plugin for it!

Ambient light reading

This is another more unusual one, but a lot of phones and tablets have ambient light sensors built in. Mozilla are working on a way to make this accessible to web content. Imagine a game with a level you can only play in a dark room, or in bright sunshine. Again we'll make a plugin if it comes to browsers!

Speech recognition & synthesis

Voice-controlled games could be an interesting avenue to explore, as well as having the game automatically talk back at you. This could make for another interesting plugin. Chrome are actively working on this, and apparently Firefox are interested too.

ScirraMark

We've mentioned several browser technologies in this post, like WebGL and the Web Audio API. We set up a test page called ScirraMark which can quickly report which of them your browser supports, and give an overall score. It's useful for testing a range of browsers and platforms for their gaming capability. We will extend this to test for new upcoming features once they get implemented in at least one browser.

The Web is the Platform

I hope this shows how the web is advancing quickly and showing lots of promise as a deeply capable platform for your games to run on. We're excited about a lot of the developments on the way, and our aim is to make sure as many of them as possible are exposed through plugins in Construct 2, so you can play with them and find cool ways to integrate them in to your projects. And in the long term, it's doubtless there's even more to come!

Now follow us and share this

Tags:

Comments

12
Jailson 12.1k rep

I was missing Ashley articles! This is totally a inspiring one! :)

Friday, April 12, 2013 at 5:10:27 PM
7
NaSTy 5,050 rep

Very very interesting article!

Friday, April 12, 2013 at 5:11:17 PM
5
Fimbul 5,856 rep

What's the current state of multiplayer support in browsers?
I keep being disappointed when reading roadmaps (talking about browser roadmaps and not scirra roadmaps) and seeing *NOTHING* with regards to UDP or peer-to-peer, and even the solutions that were proposed (but ultimately forgotten) are unsuitable, such as a UDP implementation geared towards voice/video chatting and being completely unsuitable for gaming, or another using UDP solely for p2p offloading of content files, or another that automatically implemented state and reliability into UDP packages.

Moreover, I see a lot of those features being dropped or forgotten, all this while things like the MMO demo (which wasn't really massive) or the bomberman game (which wasn't really real time) - we appear to be stuck in a networking limbo, circa 1995 technology!

I'm beggining to think we're going to have to lobby and send proposed design specs ourselves, since those responsible seem to understand next to nothing with regards to multiplayer gaming.

Friday, April 12, 2013 at 5:18:46 PM
4
kenli 6,393 rep

Web is future platform, awesome!

Friday, April 12, 2013 at 5:23:03 PM
10
Ashley 112.2k rep

@Fimbul - WebRTC DataChannels = peer-to-peer UDP networking in the browser. It's perfect for games and is beginning to see some browser implementation already.

Friday, April 12, 2013 at 5:25:20 PM
4
RandomExile 11.4k rep

I think the ambient light support is going to be mainly important to ensure visibility in environments where the light levels are outside of the player's control and the phone can automatically compensate. However, it would be a neat effect if you could actually brighten the screen for gunfire effects, or when a parallax sun comes into view, etc.

Friday, April 12, 2013 at 5:28:32 PM
7
thehen 10.2k rep

Chromium-powered Android web view is really exciting. I had no idea :D

Friday, April 12, 2013 at 5:32:25 PM
-11
Konidias 2,105 rep

I count 3 "soon"s and 3 "future"s... It's all great and good but until "soon" become "now" and future become "present" this is all just hopeful wishing.

I just don't like all this talk like Scirra is making promises that this will be an inevitability. It's all to sell more Construct 2 licenses on wishes and dreams. Why not just focus on what is currently available? Oh wait I know why, because it doesn't support all the promises that Construct 2 can create games for all platforms that compete with native to near native performance. =/

Friday, April 12, 2013 at 5:39:11 PM
3
appeality 2,383 rep

@Fimbul -- On the backend, I recommend looking at Microsoft's open source SignalR framework. They already have a demo running a multiplayer game...now, we just need an awesome plugin to hook in with moderate ease. I know there are some overcomplicated examples out there with other technologies, but there has to be an easier way.

SignalR is great because everything over the wire is sent via json and the framework uses one of several technologies automatically, e.g. websockets, sse, etc. So, if a browser does not support Websockets, it moves to SSE, then to something else, then long polling. When you think about it, multiplayer is really just a series of messages going back and forth to the server.

I know the basics of SignalR and I would be interested in working with some C2 plugin expert on getting something going. We really need to take advantage of this!

Oh...and SignalR is just about as real time as you can get. Plus, you can set up groups that act as "rooms" for our purposes, tap into individual clients, etc.

Friday, April 12, 2013 at 5:47:40 PM
2
appeality 2,383 rep

Continued...

I read about latency with the existing websockets plugin, however you should check out the demo of the multiplayer game using signalR

shootr.signalr.net/

Friday, April 12, 2013 at 6:05:57 PM
-15
fassFlash 3,894 rep

I thought that Construct 2 is a serious platform to make good,serious and fun ga- NO! You must make mini games for the web engine! Now that's f*cking better than making a good game that you have to at least wait until it downloads from the internet! How about making games for money, like selling games? You cannot sell these mini games, the only thing you can make in Construct 2, because if you try to make a big game full of adventures and sh*t, it will lag like Crysis 3 made on Flash on a Pentium processor without a cooler, so you have to make mini games for the web pages!And the wrappers won't help, they just make the games run on .exe. BUT THEY DON'T NEED TO BE DOWNLOADED DERP YOU JUST CLICK A LINK AND PLAY THE GAEM LOLOLOOLOLOLOLL

Friday, April 12, 2013 at 6:18:07 PM
2
jwjb 4,489 rep

Great article and it was fun to watch the GNILLEY clip too, thanks for all of your hard work.

Friday, April 12, 2013 at 6:22:20 PM
1
maxlive2010 1,477 rep

Really all is of congratulations, long life to Construct 2,

€µ 4m• • ¢•nstru¢t 2 3l3 €´mµ1t• d¡v3rt1dº € út1l ¢•nt¡nu€m n3ss3 ¢ªm¡nh• g€nt3...

Friday, April 12, 2013 at 7:17:57 PM
6
RandomExile 11.4k rep

@Konidias I think the Scirra team's earned a fair amount of faith when it comes to delivery. A lot of this blog is about potential capability, some of which depends on outside developments, but based on the production cycle and responsiveness we've seen from Tom/Ashley, if they say they're prepared to implement something, we can trust it'll happen. (I didn't downvote your comment, either; I'm just offering a responding opinion.)

Friday, April 12, 2013 at 7:24:21 PM
6
Rory 10.4k rep

I'm glad and so impressed by all the dedication and faith that Scirra has had on HTML5, all slowly proving them right. It's just amazing that Ludei is progressing so fast, bringing 3D and WebGL into mobile rendering. I've been anticipating this for my latest game, and I can't wait to finally be able to use it!

Friday, April 12, 2013 at 7:26:37 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.