Cocoon 2.2.0 – V8 Update is here!

We have some important updates. The main one is the new Canvas+ Android Javascript V8 virtual machine integration.

Canvas+ Android V8 update

Canvas+ Android uses the v8 Javascript engine internally. We haven’t updated it in a long time as it requires quite a big code update inside Cocoon. As the previous version was a bit old already (v3.5), after the summer we decided to take the time to update v8 to a more recent version (v5.4) and now it’s ready to be used in the latest Canvas+ plugin v2.6.0 that is available in Cocoon v2.2.0.

What can I expect from this update?

The main two things that you’ll notice with this update are:

  • Better performance in JS. This version delivers a number of key improvements in memory footprint and startup speed. These primarily help accelerate initial script execution and reduce page load.
  • ECMAScript ES6 support.

Better performance includes many different specific performance improvements like:

  • TypedArray performance improvements. TypedArrays are heavily used in rendering engines. For example, engines often create typed arrays (such as Float32Array) in JavaScript and pass them to WebGL after applying transformations.
  • Idle garbage collection scheduling. Garbage collection operations are scheduled during idle times on the main thread which unblocks the compositor and results in smoother rendering.
  • Improvements in specific Javascript features: executing loops like for-in, Object.assign, Promise and RegExp instantiation, calling Object.prototype.hasOwnProperty, Math.floor, Math.round and Math.ceil, Array.prototype.push, Object.keys, Array.prototype.join & Array.prototype.toString, Flattening repeat strings e.g. ‘.’.repeat(1000), etc

There are a lot more things, theseare just the main ones. You can read further in the V8 release notes here.

As v2.6.0 includes lots of new features and is quite an update we have also released a new v2.5.x branch release, Canvas+ v2.5.4 that includes the previous V8 version but with all the bug fixes that are also included in v2.6.0 so in case you find any issues with v2.6.0, you can still switch back to v2.5.4.

If you want to use v2.5.4, you’ll need to manually set that Canvas+ plugin version in you project config.xml:

<plugin name="com.ludei.canvasplus.android" spec="2.5.4"/>

The V8 update is a Canvas+ Android only feature.

New Cocoon v2.2.0

We have released a new Cocoon v2.2.0 that includes fixes and updates in all the Cocoon core plugins and Canvas+ v2.6.0. When choosing Cocoon v2.2.0 you’ll be automatically using the updated plugin set. The main plugin improvements are:

  • Canvas+ 2.6.0 with bug fixes and the V8 update
  • Webview+ update with lots of bug fixes for the iOS Webview+ and Developer App integration.

As always, you can use this Cocoon version by just changing the Cocoon version in your project:

Of course you can still use previous versions of Cocoon and you’ll only be using 2.2.0 automatically in case you have set the Cocoon version to latest.

Architecture selection

This is something that has been requested several times in the past. At the moment when building a Cocoon app for Android both, armv7 and x86 where being built, since this release you can select if you want to build armv7, x86 or both architectures.

This will save both final APK size and also compilation time so you no longer need to wait twice the time in case you only need one architecture or you are just testing.

2.5.4 & 2.6.0 Bugfixes and improvements

Apart from the Canvas+ Android v8 update we have been working on bug fixes for both Canvas+ Android and iOS.

These are the main ones:

  • Now the Canvas+ internal webview uses the accelerated environment by default in iOS.
  • Reduced APK size as ARM architecture has been removed from Canvas+ Android 2.6.0.
  • Fixed hang when the App is suspended and an Audio pause is received.
  • Updated iOS device ID list reported by getDeviceInfo().
  • Fixed iOS internal webview so JS execution is not paused when the webview is not showing.
  • Fix crash when texture is disposed twice: this happens when texture loader thinks that texture is still alive but the new image was not loaded or is empty, and tries to dispose the current texture. (ie. When using image.src=“” to dispose images)
  • Fixed Local Storage data write to the internal plist with proper encoding. This might cause local storage corruption.
  • Fixed issue with font-size and line-height in fonts definition parsing.
  • Enable NPOT textures by default. This will be noticeable in some memory saving when allocating textures that are not POT.
  • Audio loading issues. Some audios might not be loaded correctly with slow connections.

Let us know what you think about this new update!

Interview With Lucky Cat Studios

This article is the first of a series we are planing to with key HTML5 developers and companies that use Cocoon and are making a difference with their apps and games.

The first of this series is dedicated to Lucky Cat Studios that have recently had a massive success with their Nom Cat and Sky Chasers games. We talk with Herdjie Zhou, Founder and CEO of Lucky Cat about HTML5, childhood memories and how to create great games that people love.

Lucky Kat

Lucky Cat headquarters

Tell us about Lucky Kat Studios and you

Lucky Kat started exactly one year ago in February 2015. We are based in the Hague, in the Netherlands and we are currently a team of 5. We’re focused on creating mobile games that bring a smile to your face.

Herdjie copy

My brother, Hernan is founder and CTO, and I am co-founder and CEO of the company. My main tasks and responsibilities are creating a vibrant and inspiring company culture and make sure people around the world play our games.

Which are your latest projects?

Recently we launched Sky Chasers on both iOS and Android. It’s a good mixture of Super Mario World and Lunar Lander. It has been featured worldwide by Apple and has received much love from game critics e.g. Pocket Gamer Silver Award.

Our first title as a studio was Nom Cat. It features all the celebrity internet cats such as Grumpy Cat, Garfield, Nyan Cat, Keyboard Cat etc. The game as been featured as well by both Apple and Google and went viral on social media. It was the perfect kickstart for our company.

gameplay4

Nom Cat game. You probably recognize both of them

Where do you get inspiration for your games?

We’re heavily inspired by SNES and NES games and are focused on translating these childhood memories to the modern era of mobile gaming.

Which were your favorite NES/SNES games?

Our favorite NES game is Double Dragon 2 and for SNES it’s the Donkey Kong Country series.

Tell us about your game creation process

We start with prototyping – and pitch game ideas to each other. When we like an idea, we go into production. We work in small teams, so that other team members are able to give honest feedback. Also, we do a lot of playtesting to see if we’re going towards the right direction. We try to get our creation process within a 3 month period.

Sky Chasers

Latest Sky Chasers game

Why did you choose HTML5 as a gaming technology?

Using HTML5 we’re able to release our games faster – our proprietary game engine is in HTML5/ JS. Also testing is easier as we can send out links to family and friends.

What technologies have you used before?

Marmelade SDK.

How does Cocoon fit in that process

We built our own proprietary HTML5 / JS game engine called “Bento”. Cocoon is the perfect match for us to port our games to native. It’s fast, easy and reliable. Team members of Cocoon have helped us many times on crucial moments before and during launch of our games. Great support, great people! Cocoon forums are a good way to get in contact with other devs.

How do you see the future of the HTML5 gaming

HTML5 gaming has still a lot of challenges to overcome in the West. We are not sure exactly why this is. In contrary, in the East e.g. China, HTML5 gaming has been adopted by the mass and is now the next big thing in gaming.

What are your next projects?

We’re working on two new projects currently and hope to show you more very soon. Of course, they will be mobile games and in pixel art style 🙂

 

Thanks Herdjie for your time!

If you want to see Lucky Kat’s daily development process, please follow them on Snapchat “luckykatgames” or on Twitter @luckykatstudios.

Canvas+ Plugin 2.2 Update

We have updated the Canvas+plugin version (for both iOS and Android)  with some bugfixes and new features.

To get this new features you just need to compile with the latest Cocoon version in the cloud.

Canvas+ improvements

  • Added support for Cookies in Android XHR.
  • window.location.href = URL to work.
  • Made getAttribute to return null if the attribute is not found. Previously it returned an empty string.
  • Improved XHR related error messages.
  • Added postMessage support to window.
  • Support for the anchor tag/element.
  • Added “hasAttribute” and “classList” to every node.
  • Added search to location.
  • Added JSON support for XHR connections and fixed a bug that was passing “undefined” to user and password in XHR open commands (did break connections in Android with JQuery).
  • Added minor modifications to make Canvas+ more JQuery and Construct2 (non CocoonJS export) friendly.
  • Added srcElement to every event instance.
  • Added DOMParser, querySelector and querySelectorAll.
  • Added getElementsByClassName.

Canvas+ extensions

  • Added secure text option for the text dialog
  • When a canvas object is disposed from javascript, dispose the context too.
  • Added XHR Dispose.
  • Only allow input capture on canvas and image HTML Elements.

Canvas+ bug fixes

  • Store vertexAttribPointerData in the WebGL defender. These fixes some conflicts with canvas2d and wangle renderer (specially on Pixi V3).

Cordova related

  • Added support for Cordova online/offline events.

Hope you enjoy this new Canvas+ version!