Don't Miss Out

Follow us now so you don't miss new releases!


Lightning Draw

Guest

9.547 seconds

RamPackWobble

35.473 seconds

Tsengar

38.173 seconds

For the first 3 people to download this release!

Quick Draw

Guest

4m 56s

Guest

4m 30s

totoe

5m 36s

anakromic

8m 31s

Guest

8m 5s

Guest

11m 50s

Guest

15m 40s

Guest

15m 60s

AbelaNET

15m 9s

Guest

16m 17s

Jijiji

17m 55s

Grave

20m 6s

Be one of the first 15 people to download this release!

Construct 2 Release r235

There is a more up to date Stable Release! Download the latest Stable release instead here.
Download

59.7 mb, Windows 8/Windows 7/Vista/XP

Wednesday, September 14, 2016

New this build: new offline support using Service Workers!

Changes in offline support

For a long time Construct 2 games have been able to run offline using a browser technology called AppCache. This is more or less a text file with a list of URLs to save (appearing as offline.appcache in your exports). However AppCache is generally regarded as a mistake, and browser makers are starting to begin a long-term process of dropping support for it. A new and more powerful technology called Service Worker is being developed to replace AppCache for offline support, as well as being capable of other background services like background sync, push notifications, and geofencing (much of which is still in development).

Service Workers are currently only supported in Chrome and Firefox, although it's in development for Edge and is under consideration for Safari. It is likely that in the long-term all browsers will support Service Workers and ultimately AppCache will be removed, so the transition is inevitable.

Offline support with Service Worker

The new offline support is designed to work similarly to AppCache, i.e.:

  • The first visit causes the whole game to be saved locally.
  • Subsequent visits load entirely from the locally saved copy. Not only does this mean it can load offline, it also loads faster and saves bandwidth since no further server resources are requested.
  • When you upload a new version, on the next visit it loads the old version still, but updates to the new version in the background.
  • Once the background update has finished, pressing the browser "reload" button will then load the new version. (This means you usually have to reload twice, with enough time in between for the background download to finish.)

Note this only applies to web-based exports. Platforms like Cordova, NW.js and Windows Store apps already load from local resources, so none of this applies to them.

The Service Worker based implementation has some differences to the old AppCache support:

  • Service Workers only work on HTTPS. We have warned before that powerful new web platform features will only allowed on HTTPS. If you haven't yet moved to secure hosting, note it is now required for offline support.
  • AppCache could slow down the first load of the game, since it would be caching the entire game (such as music files that aren't needed immediately) while the progress bar is showing. The new Service Worker system waits until the game finishes loading before starting to save a local copy, so it shouldn't slow down the first load.
  • In Chrome, it can't update when you press "reload" - you currently have to close and reopen the browser window/tab (hopefully this can be fixed)
  • Because the new system works differently to the old one, we've deprecated the Browser plugin's 'Is downloading update" and "On update ready" conditions. These only work with AppCache.
  • Like some browsers did with AppCache, the Service Worker will log messages to the browser console indicating if it is up-to-date, downloading an update, ready to update, etc. You should look for these messages if you want to test a new version you've uploaded so you know when it's ready.

Since not all browsers support Service Workers yet, we are still keeping the old AppCache support for the time being! This means:

  • Exported games use both AppCache and Service Worker for offline support
  • Browsers that support Service Worker will use that and ignore AppCache (except note this bug in Chrome that means it will unintentionally save an AppCache but not use it)
  • Browsers that don't support Service Worker will keep using AppCache

Overall, this is a bit complicated, but the transition needs to happen. Due to the various differences and complexities of making the transition we are keen for this to get thorough testing. So if you publish to the web at all, please try exporting your games, playing them once online, going offline (e.g. pull out network cable, disable wifi, etc), then trying to load the game from the same URL again. All being well it should still load and play the same as it did before, even with no connection. Remember if users do "add to homescreen", save shortcuts, or use other features to make a web page more app-like, offline support is particularly important for those cases since users will expect it to act like an app that works offline too.

Changelog

Feature

New offline support based on Service Worker

Change

Browser plugin: deprecated 'Is downloading update' and 'On update ready' conditions

Bug Fix

Mouse plugin: mouse buttons could get stuck in a "pressed" state if opening a window in a click

Bug Fix

IAP plugin: Javascript error using preview-over-wifi


Do you like this release?

We'd love it if you could show your appreciation of it by retweeting and sharing it on Facebook and Twitter!

Posted by Scirra Ltd on 9/14/2016

Comments

2
Jijiji 3,649 rep

Very interesting update! thank you

Wednesday, September 14, 2016 at 3:28:36 PM
1
Paradox 38.8k rep

Thank you!

Wednesday, September 14, 2016 at 3:37:59 PM
1
Laughing14 2,414 rep

SCIRRA RULES

Wednesday, September 14, 2016 at 3:38:15 PM
1
AbelaNET 14.6k rep

Always looking forward for these updates. Keep it up.

Wednesday, September 14, 2016 at 3:43:17 PM
1
Marxally 1,825 rep

The new offline feature looks promising, great update!

Wednesday, September 14, 2016 at 3:43:22 PM
1
orangemicro 3,354 rep

I use "add to homescreen" for each one of my games for the full-screen feature. Thanks for the update!

Wednesday, September 14, 2016 at 3:45:51 PM
1
prashant3999 1,488 rep

Thanks Scirra great work team keep it up

Wednesday, September 14, 2016 at 3:55:28 PM
0
sanjibnanda 5,221 rep

simply saying ! ---thanks

Wednesday, September 14, 2016 at 4:04:16 PM
0
jogosgratispro 20.5k rep

You guys are amazing. Always on top of everything. Thanks!

Wednesday, September 14, 2016 at 4:06:33 PM
0
Rexu 3,260 rep

Deprecated? What? I've been using them all the time!

Wednesday, September 14, 2016 at 4:06:35 PM
0
chadorireborn 59.0k rep

Nice update xD

Wednesday, September 14, 2016 at 4:07:06 PM
0
iceangel 31.3k rep

Thanks Scirra Team!

Wednesday, September 14, 2016 at 4:38:20 PM
0
gillenew 23.4k rep

nice update :)

Wednesday, September 14, 2016 at 4:40:21 PM
0
edisone 18.3k rep

awesome...ty so much

Wednesday, September 14, 2016 at 5:04:16 PM
0
glerikud 19.9k rep

Awesome. Great that you managed to push it into beta. Thank you. :)

Wednesday, September 14, 2016 at 5:10:18 PM

Leave a comment

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