Consider Cocoon if XDK is not working (updated)

Discussion and feedback on Construct 2

Post » Thu Jan 26, 2017 8:42 pm

This is my crap game: https://play.google.com/store/apps/deta ... bbi.srduke
That was built 8 months ago or so with canvas+ and was/would be very slow with xdk.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Tue Jan 31, 2017 10:24 pm

part12studios wrote:no i havne't tried webview, it sounds like it sucks.. i have a pre android 5 phone so i know it will suck for my test device.. i'm ok with crosswalk and cocoon.io regardless of bloat.. i don't really care if a game is 30mb.. few people are going to not play my game because it's 22+ mb


Some clarification for those reading this thread regarding "webviews" and build systems:

* All Cordova apps (PhoneGap, XDK, Cordova and other HTML5 hybrid apps packaged for distribution in a mobile store) run in a "webview" (aka, the HTML5 runtime engine).

* The "webview" is built into the device OS/firmware, so performance varies as a function of the specific device hardware (CPU, RAM speed, Flash speed, etc.) and the version of the OS running on that device.

* iOS 9+ devices allow you to select between the "standard" webview and the "wk" webview. The "wk" webview has better performance than the "standard" webview.

* Android 5, 6, 7+ devices have a "replaceable" webview, which is equivalent in features and performance to the mobile Chrome browser runtime engine. That webview is automatically updated, from time-to-time, via the mobile app store.

* Android 4.x devices have fixed webviews, with substantially lower performance and features compared to the mobile Chrome browser runtime engine.

* Crosswalk is a replacement webview that can be installed on Android 4.x devices (as well as Android 5+ devices). It is based on the Chromium project, so generally has similar features and performance to the Android 5+ replaceable webview, but is usually several releases behind.

* Only Android allows for replacement of the webview. Windows and iOS devices do not allow the webview to be replaced, they are fixed in the device (in the case of iOS you can select between the two stated above).

* The Crosswalk webview is actually enabled via a Cordova plugin (as is the iOS "wk" webview). Checking the "Optimize with Crosswalk" option in the XDK simply enables including that plugin during the build phase.

Cordova CLI and PhoneGap Build and the Intel XDK are all standard Cordova build systems. Those systems, and any other build systems that depend on Cordova CLI (under the hood), will always build to the "standard webview" that is built into the device, unless the Crosswalk plugin is added to the mix for Android orthe "wk" webview plugin is added for your iOS projects. Windows devices have no such options, you get what you get.

Thus, the performance you get from your game will be the same whether you build with PhoneGap, Cordova or the XDK, assuming you build with the same set of plugins and the same HTML5 code. The reason you see performance that is usually worse with PhoneGap Build or Cordova CLI is because you have to take some extra steps to add the Crosswalk plugin to your project (which the XDK does automatically for you if you check that "optimize with Crosswalk" box). But if you include the Crosswalk plugin with PhoneGap or Cordova CLI you'll get similar performance to the XDK.

Cocoon and Canvas+ are doing some other tricks that provide specific optimizations for specific types of operations, so performance comparisons with those systems against standard Cordova builds will vary depending on how your app works. I do not have insight into precisely what they are doing, so I cannot comment on where to expect those performance advantages, but you should understand that YMMV when using those tools.
Intel Corporation
B
13
S
3
Posts: 78
Reputation: 923

Post » Tue Jan 31, 2017 11:33 pm

xmnboy wrote:
part12studios wrote:no i havne't tried webview, it sounds like it sucks.. i have a pre android 5 phone so i know it will suck for my test device.. i'm ok with crosswalk and cocoon.io regardless of bloat.. i don't really care if a game is 30mb.. few people are going to not play my game because it's 22+ mb


Some clarification for those reading this thread regarding "webviews" and build systems:

* All Cordova apps (PhoneGap, XDK, Cordova and other HTML5 hybrid apps packaged for distribution in a mobile store) run in a "webview" (aka, the HTML5 runtime engine).

* The "webview" is built into the device OS/firmware, so performance varies as a function of the specific device hardware (CPU, RAM speed, Flash speed, etc.) and the version of the OS running on that device.

* iOS 9+ devices allow you to select between the "standard" webview and the "wk" webview. The "wk" webview has better performance than the "standard" webview.

* Android 5, 6, 7+ devices have a "replaceable" webview, which is equivalent in features and performance to the mobile Chrome browser runtime engine. That webview is automatically updated, from time-to-time, via the mobile app store.

* Android 4.x devices have fixed webviews, with substantially lower performance and features compared to the mobile Chrome browser runtime engine.

* Crosswalk is a replacement webview that can be installed on Android 4.x devices (as well as Android 5+ devices). It is based on the Chromium project, so generally has similar features and performance to the Android 5+ replaceable webview, but is usually several releases behind.

* Only Android allows for replacement of the webview. Windows and iOS devices do not allow the webview to be replaced, they are fixed in the device (in the case of iOS you can select between the two stated above).

* The Crosswalk webview is actually enabled via a Cordova plugin (as is the iOS "wk" webview). Checking the "Optimize with Crosswalk" option in the XDK simply enables including that plugin during the build phase.

Cordova CLI and PhoneGap Build and the Intel XDK are all standard Cordova build systems. Those systems, and any other build systems that depend on Cordova CLI (under the hood), will always build to the "standard webview" that is built into the device, unless the Crosswalk plugin is added to the mix for Android orthe "wk" webview plugin is added for your iOS projects. Windows devices have no such options, you get what you get.

Thus, the performance you get from your game will be the same whether you build with PhoneGap, Cordova or the XDK, assuming you build with the same set of plugins and the same HTML5 code. The reason you see performance that is usually worse with PhoneGap Build or Cordova CLI is because you have to take some extra steps to add the Crosswalk plugin to your project (which the XDK does automatically for you if you check that "optimize with Crosswalk" box). But if you include the Crosswalk plugin with PhoneGap or Cordova CLI you'll get similar performance to the XDK.

Cocoon and Canvas+ are doing some other tricks that provide specific optimizations for specific types of operations, so performance comparisons with those systems against standard Cordova builds will vary depending on how your app works. I do not have insight into precisely what they are doing, so I cannot comment on where to expect those performance advantages, but you should understand that YMMV when using those tools.

Thanks for the jargon and mechanics clarification, I think that's what I assumed, more or less, my main concern is that I can't get ACCEPTABLE performance out of anything other than canvas+, when all I'm doing for the main part is rudimentary scrolling and a couple of other performance-negligible techniques (attraction/rejection engine, basic raytrace, tilemaps, etc). I always have my resolution at 1920x1200 because my device is HD, and even though I'm using pixel art that's scaled up, if I made it any smaller, it would be blurry. All of this runs at a solid 60fps with canvas+, so what I really want to know is why the only exporter that runs acceptably isn't supported by C2, and the supported exports (phonegap and xdk) aren't actually running with acceptable performance?

Maybe if I dig out my old game capx and my current game capx and send them along with an apk built with canvas+ and an apk built with xdk to someone, we could try and figure this thing out, but I can't see that happening.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Feb 06, 2017 9:58 am

Okay, so should I once again go to cocoon and go against scirra's recommendation of phonegap/xdk? Cause the performance in both of those is absolutely unacceptable whereas, straight of the bat, cocoon runs smooth as silk, if not a little buggy with tiles and gaps between backgrounds, etc.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Feb 06, 2017 3:17 pm

dude if it works do it. we just have to realize when we stray from a recommendation we're in unsupported waters. you just have to adapt your game to the technology not the other way around. if you can't get good performance on one solution you have to adapt.. unfortunately it's not the tools obligation to make sure your game runs well.

You may need to consider the game you're making or the effects / features it has to allow performance to be acceptable. The idea is to spend more time making games, not squeezing performance out of things. I'd rather simplify and publish and move no than waste time testing fps.

The new C3 announcement also might make this moot as well. They are doing an internal build solution for it. I haven't read the full blog yet, but I can tell you right now that's what I will be doing when I use C3.. and I'll just be sure to make games that work well within it.
B
55
S
9
G
1
Posts: 921
Reputation: 6,399

Post » Mon Feb 06, 2017 3:57 pm

part12studios wrote:dude if it works do it. we just have to realize when we stray from a recommendation we're in unsupported waters. you just have to adapt your game to the technology not the other way around. if you can't get good performance on one solution you have to adapt.. unfortunately it's not the tools obligation to make sure your game runs well.

You may need to consider the game you're making or the effects / features it has to allow performance to be acceptable. The idea is to spend more time making games, not squeezing performance out of things. I'd rather simplify and publish and move no than waste time testing fps.

The new C3 announcement also might make this moot as well. They are doing an internal build solution for it. I haven't read the full blog yet, but I can tell you right now that's what I will be doing when I use C3.. and I'll just be sure to make games that work well within it.

I have no reason to expect any improvement over XDK.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Feb 06, 2017 4:07 pm

totally.. use cocoon io for as long as you can since it works for this game. i'd just say next game not start with cocoon io.. start with xdk.. or whatever C3 is using.. april man.. april..
B
55
S
9
G
1
Posts: 921
Reputation: 6,399

Post » Mon Feb 06, 2017 10:08 pm

Zebbi wrote:This is my crap game: https://play.google.com/store/apps/deta ... bbi.srduke
That was built 8 months ago or so with canvas+ and was/would be very slow with xdk.


I only get a black screen with your game, I have a galaxy 6s with android 6.
B
28
S
11
G
20
Posts: 729
Reputation: 13,674

Post » Mon Feb 06, 2017 10:44 pm

The Mnk wrote:
Zebbi wrote:This is my crap game: https://play.google.com/store/apps/deta ... bbi.srduke
That was built 8 months ago or so with canvas+ and was/would be very slow with xdk.


I only get a black screen with your game, I have a galaxy 6s with android 6.

Doesn't surprise me, canvas+ does one job and only one job well. Starting up reliably was never one of it's strong points, so I gather.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Tue Feb 07, 2017 10:41 am

The Mnk wrote:
Zebbi wrote:This is my crap game: https://play.google.com/store/apps/deta ... bbi.srduke
That was built 8 months ago or so with canvas+ and was/would be very slow with xdk.


I only get a black screen with your game, I have a galaxy 6s with android 6.


You easily can find out what's causing the Black screen if you compile a Developer App from your project and run your source code.
All my games are made with Cocoon's Canvas+ engine due to its awesome performance and light apk file.
However with this benefits, some restrications are coming along.
Like some unsupported objects (Buttons, text boxes and so on).
I made a list a while ago

https://shatter-box.com/knowledgebase/s ... s-plugins/
Image Image iTunes: Match3 | Google Play: Match3
B
90
S
29
G
28
Posts: 1,066
Reputation: 26,065

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests