Don't Miss Out

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


Lightning Draw

aruche

20.67 seconds

Przemek32767

35.473 seconds

Sisyphus

50.887 seconds

For the first 3 people to download this release!

Quick Draw

Guest

1m 14s

basti

2m 32s

Guest

2m 47s

Guest

2m 53s

Elyain

3m 42s

Ubivis

3m 1s

Guest

3m 18s

Guest

3m 28s

Guest

4m 34s

Guest

4m 5s

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

Construct 2 Release r202

This is an old Beta release! Download the latest Beta release instead here.
Download

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

Tuesday, April 14, 2015

New this build: a new Local Storage plugin to replace the old WebStorage plugin. There's also a breaking change in the evaluation of power expressions (^) which hopefully not too many projects depend on - more on that below.

New Local Storage plugin

The new Local Storage does mostly the same thing as WebStorage - storing data locally to a user's device - but with a number of improvements:

  • Asynchronous storage: WebStorage was synchronous, so a long store/load would jank the game (pause while it processes). Local Storage uses asynchronous storage where supported (IndexedDB or WebSQL) firing triggers when stores or loads are complete, allowing storage to work in parallel to the game and improving performance in storage-intensive scenarios. (Note on old browsers which don't support IndexedDB or WebSQL it falls back to using synchronous storage like WebStorage did, but all modern browsers support asynchronous storage.)
  • WebStorage often faced tight storage limits, commonly with just around 5mb total storage allowed. Since Local Storage uses IndexedDB or WebSQL where supported and these have higher storage quotas, on many platforms you have a much higher storage capacity (commonly around 50mb, or effectively unlimited after a permission prompt).
  • Local Storage preserves the types of values stored. WebStorage would return all values as strings, even if you store a number, which can cause confusing bugs. Local Storage returns a number if you store a number, avoiding issues with unexpected types.
  • The WebStorage API has actually been removed from Chrome Web Store apps, so WebStorage can't store anything on that platform. Since Local Storage uses IndexedDB in Chrome which is still supported, it means storage is now possible again in Chrome Web Store apps. WebStorage support may even be deprecated and removed from browsers in future, since there is a movement away from synchronous features, so moving to the new Local Storage plugin helps future-proof your apps.
  • 'Session storage' has been removed in the new plugin, since it had no benefits over using global variables and added a lot of baggage.
  • It has a less confusing name (beginners frequently thought "Web" in the "WebStorage" name meant it wouldn't work offline, but it does)

These changes are too extensive to retro-fit to the old WebStorage plugin, so instead Local Storage has been introduced as a new plugin to replace WebStorage.

The downside is it's a little tricker to use. In particular since getting item values is asynchronous, there is not a simple "get item value" expression: you must use the "get item" action and then a moment later the "On item get" trigger fires with the value being available. Also note that since Local Storage uses a different storage mechanism, it will not be able to read any existing data saved with WebStorage. However the above benefits mean that it's still a good idea to transition to the new plugin if possible. Existing projects can keep using WebStorage, but it is now deprecated and cannot be used in new projects.

Breaking change: operator precedence

Recently a bug was reported noting that Construct 2 has the wrong operator precedence for power (^) and unary minus (as in the minus in -x). So for example the expression -x^2 would be evaluated as (-x)^2, and always return a positive result. This is inconsistent with the standard BODMAS order of operations, which means it should be evaluated as -(x^2) and always return a negative result. The problem with making this kind of change is it can break existing projects that rely on an expression like -x^2 returning a positive result in order to work correctly. However as discussed in the bug report it was determined that the change ought to be made since it's a pretty fundamental mathematical issue.

Hopefully few projects will be affected. However if you find anything working differently in this build, review your project for any use of expressions of the form -x^y and replace them with (-x)^y to make them work the same as before.

Changelog

Feature

New 'Local Storage' plugin to supersede WebStorage

Change

WebStorage plugin: now deprecated in favour of Local Storage. Existing projects can continue to use it but we recommend transitioning to Local Storage where possible.

Change

Updated Google Closure Compiler to the latest version

Change

Increased viewport and layout margin size limit to 100,000 (from 10,000)

Change

Scirra Arcade plugin is hidden in the editor, since the Arcade is not taking submissions until the new Arcade is ready

Bug Fix

Event sheet view: finishing editing a comment by pressing enter now leaves the comment selected

Bug Fix

Properties bar: now displays properties when navigating the Project Bar items by keyboard

Bug Fix

Runtime: possible memory leak/inflated savegame size when destroying objects used in 'On collision' events

Bug Fix

Runtime: possible false positive collision detection in first tick after restarting a layout

Bug Fix

Physics asm.js: possible javascript error restarting layout after connecting objects with joints

Bug Fix

Breaking change: expression power operator (^) precedence is now higher than unary minus (-x)

Bug Fix

Issue that could cause the preview server to stop responding to requests. This could have weird preview-only consequences, like pathfinding not working after playing audio.

Bug Fix

Audio: could fail to pause audio if it had previously been paused and resumed

Bug Fix

Sprite: 'Load image from URL' with resizing the object sometimes may not have updated the object size

Performance

WebGL renderer: improvement to handling of GPU buffers which could improve performance on some devices


Leave a comment

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