Noël approche à grand pas et la hôte du père noël se rempli de petites surprises concoctées par le lutins, dont une version r153 de construct 2 ^^

Friday, December 06, 2013

New this build: a new experimental asm.js powered physics engine option, and low-res fullscreen scaling!
asm.js physics

Asm.js is a technology invented by Mozilla that allows high-performance languages like C and C++ to be compiled down in to a special assembly-like subset of Javascript. Engines which are optimised for this subset can then generate very well-optimised assembly code for it, resulting in performance close to native speeds. We’re now providing an experimental option to choose an asm.js-compiled physics engine to run the Physics behavior.

The existing physics engine is not particularly fast for a couple of reasons. There are a few factors involved here, and I’ll cover it in more detail in a blog post soon. (Edit: now posted here – More about asm.js powered physics) However our own tests have shown the asm.js physics can be 2-3x faster in Chrome and Firefox, including on mobile, which is such a big jump it’s close to a native engine! Note only Chrome and Firefox are specially optimised for asm.js at the moment, but IE and Safari don’t appear to be any slower with asm.js.

There are two drawbacks to the asm.js physics engine that are why it’s not a new default. Firstly, it does not support the Disable collisions action. This is enough to break some existing games. We’re investigating adding support for this. Secondly it can actually be slower in native iOS apps, because iOS apps are not allowed to compile Javascript and have to interpret it at a slower speed. Since asm.js generates large amounts of very simple code, the lack of a JIT can actually reduce performance. This shouldn’t be a problem given that there’s an option to keep using the old engine, or use CocoonJS native physics which works on iOS. Still, if you are not disabling collisions and aren’t publishing an iOS app or can use CocoonJS native physics, the asm.js physics option should otherwise be feature-complete and much, much faster in many cases. Don’t forget it’s experimental though, so let us know if you have any issues!
Low-resolution fullscreen scaling

When using a fullscreen scaling mode like Letterbox scale, there is a new Fullscreen scaling project property that can control how the scaling is done. The default is high quality, which is what it has done previously: each object drawn at a bigger size directly to the screen. The new low quality option does something new: it first renders the screen to an unscaled canvas at the size of the Window size project property. Then, after all objects have been rendered, it simply stretches up the result to fill the screen.

Low quality mode can improve performance on systems with limited GPU power, like mobile devices or cheap laptops running in HD resolution. There is a lot less rendering work, since objects and shaders are rendered to a smaller canvas with fewer pixels, and then the end result is simply scaled up in one go, which is fast. This is particularly good for retro games using point sampling, since in some cases it will appear identical, but significantly reduce the rendering work. It might even be desirable, since it causes shader effects to appear in low-res mode as well, keeping the pixelly appearance of the game. However as the name suggests for many games the quality will be reduced. In high-quality mode, downscaled sprites, text and shaders appear crisp and detailed; in low-quality mode, downscaled sprites lose detail, text becomes blurry or pixellated, and shaders render at lower quality. There is a new system action which can turn it on and off at runtime, so it could provide an easy way to have a « low resolution » option in your game’s settings for players to use if performance is poor.

Changelog

Add
New option to enable asm.js physics engine. The option to choose the physics engine has been removed from the CocoonJS object and added to project properties instead. Note asm.js physics does not support ‘disable collisions’.

Add
New ‘Fullscreen scaling’ project property. Defaults to ‘High quality’ (same as before) but ‘Low quality’ enables rendering at the project window size then simply stretching the result up afterwards.

Add
New system action ‘Set fullscreen scaling’ to allow changing quality mode at runtime

Change
WebGL renderer now falls back to canvas2d renderer using the « failIfMajorPerformanceCaveat » context attribute. This should ensure best performance by avoiding software-rendered or otherwise very slow WebGL implementations.

Change
The editor now enforces that group names are unique project-wide, instead of on just the same event sheet. This prevents the issue where activating or deactivating a group affects all groups with the same name. Note that any existing projects which use the same group name more than once will still load the same for backwards compatibility, but you cannot create new groups with duplicate names.

Bug Fix
Tilemap: now displays collision polys properly when ‘Show collision polys’ ticked in ribbon

Bug Fix
Tilemap: could display incorrectly in editor when the graphics card driver did not support non-power-of-two textures

Bug Fix
Tilemap: could sometimes save/load incorrectly using JSON when empty tiles existed in the tilemap

Bug Fix
In the canvas2d renderer, layers using their own texture did not use ‘Point’ sampling even if it was set in Project Properties

Bug Fix
Could create event groups with empty names, which then could not be renamed

Cette version Beta est téléchargeable ici : https://www.scirra.com/construct2/releases/r153

Bon week-end (-;

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *