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.