Jump to content

Common Phaser + CocoonJS issues


Recommended Posts

using ogg to and i have no error of that kind..  but long loops "jump on the first note".. it's played twice...  i don't know how to describe it in english...

 

in fact i don't have most of the errors and workarounds needed here...  i do the "this.webgl=false" hack on the phaser source and most of the problems (except the bitmapfont problem - where i use a custom xml parser to solve it)  are gone..

Link to post
Share on other sites
  • Replies 302
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Last update of this information was 13 August 2014.   Note: As of this writing, CocoonJS (2.0.*) comes in a total of three modes.   [system] WebView creates an instance of the default browser for

Good news, everyone: I got audio to work! (Within the CocoonJS Launcher. Will check compiled app and reconfirm. EDIT: Works!).   Thanks to an idea from @Haden (thanks again for that), I found out th

What an awesome post - thank you And just so you know I've just made all of the above changes into the 1.2 core version.

Posted Images

Unrelated to the ogg issue, but I have to admit I found Ashley's latest post on the Scirra site fascinating. He's basically saying there is no need for Cocoon on iOS8 any more, and that actually PhoneGap will outperform it as soon as they move to WKWebView. As a result they deprecated the Cocoon exporter. Given the weird amount of hacks you're all having to use for Cocoon and the lack of assistance from Ludei I'm thinking that might not be a bad practise to follow.

Link to post
Share on other sites

@Rich - I really like the look of PhoneGap but for less technical people like myself I just don't know how to use it. CocoonJS has a lot of flaws but the basic usage is super simple - and I can make use of advertising and other features relatively easily. PhoneGap on the other hand is just not very friendly for me. I'd happily switch to something simpler if I could but PhoneGap (and similar) are anything but simple :(

Link to post
Share on other sites

Unrelated to the ogg issue, but I have to admit I found Ashley's latest post on the Scirra site fascinating. He's basically saying there is no need for Cocoon on iOS8 any more, and that actually PhoneGap will outperform it as soon as they move to WKWebView. As a result they deprecated the Cocoon exporter. Given the weird amount of hacks you're all having to use for Cocoon and the lack of assistance from Ludei I'm thinking that might not be a bad practise to follow.

 

To apply my own prognosticating to this: I think there is a move, even among the wrapper engines like CocoonJS and Ejecta, toward more WebView-based tools. As one example, Ludei's own CocoonJS Command-line Interface is just the Cordova tools with the injection of WebView+ (Chromium libs) on top. And PhoneGap, as is pretty commonly known, is just Apache Cordova with a different name and a remote compiling option.

 

Based off this article, and some moves I've seen and have started to make myself, then, I definitely see WebView (be that UI or WK) as a large part of the future of mobile HTML5. Those apps compiled to use the native API, and not have to go through a translation layer, are always going to be faster. As long as the WebView code improves, and I see no reasons why it wouldn't, I see the same long term answer Scirra did: more WebView, less wrappers.

 

However, as someone who has tried (albeit very slowly) to introduce patches for Cordova/PhoneGap to Phaser, I don't think anyone should suddenly jump ship from CocoonJS to Cordova. There are some major issues, like the use of the Media plugin, for example, that complicate even the seemingly simple task of playing audio. And Phaser definitely needs to catch more Cordova events (like "pause", "resume", and "backbutton" to start) before even simple apps will work as expected in production settings.

 

That written, though, if CocoonJS was dropped from Phaser in the coming months, maybe even by the beginning of next year, I wouldn't mourn it too much. I was a big proponent of it early this year, I know. But, given the frustration of all the weird hacks we've had to use and constant shifting of what works with each version, I've stopped being an apologist for it. Maybe the next version will be better, maybe, but there is only so much "Oh, the next version, for sure!" I can take.

Link to post
Share on other sites

Just so I'm clear: I don't plan on removing any Cocoon support from Phaser 2, although I certainly won't spend much time on trying to solve issues with it, when even Ludei can't seem to find the time to help either.

 

However, Phaser 3 development starts in the next couple of months, and I'm seriously questioning if it should even factor in that codebase at all.

Link to post
Share on other sites

I'm pretty new to using Cocoon.js and Phaser but I've noticed my one project that worked awesome in 2.0.7, does not work in 2.1.1 when just swapping the phaser.js files. (only using Arcade physics)

 

When trying to debug in webview+ mode, I get nothing but a blank screen and no errors. When using Canvas, I do get an error in the boot state that says the .add method is unknown which is a little baffling. 2.1.1 works amazing in all browsers I've tried with the same code.

 

Not sure if anyone else has experienced the same thing and found a work around.

 

Edit: Realized I typed in v2.1.0 instead of v2.1.1 which I'm actually using.

Edited by Orbital Game Studios
Link to post
Share on other sites
  • 2 weeks later...

cocoonjs. works quite well right now ..  as long as  i don't use anchor.seTo, and a custom bitmap json parser found in this forum, and the "blank image hack" at the end of create to make my buttons appear and of course CANVAS mode..  (the "this.webgl=false" phaser hack is not needed anymore..)

 

 

the question is..  is anyone using cocoonjs in WEBGL mode successfully ?  (my game doesn't even start with webgl and cocoon.. no errors)

 

edit:  with force webgl screencanvas i managed to make it work but the performance is HALF the performance of canvas mode :(

 

one thing i did notice though is that my game is crashing for no reason on some very very rare occasions..  which is NOT happening with android crosswalk (crosswalk is workling like charm with webgl btw..  if cocoonjs weren't giving me 10 more fps (in canvas mode) i would never look at cocoonjs ever again.. buggy as it is)

Link to post
Share on other sites

@valueerror - when you say cocoonjs is crashing for no reason what do you see? I've noticed the game freezing and becoming unreponsive - seemingly randomly. I submitted a bug report about it here:

http://support.ludei.com/hc/communities/public/questions/200366689-Leaderboard-freezes-game-on-ios

 

For me the bug seems to be related to the leaderboards, or other times the game interacts with gamecenter.

Link to post
Share on other sites
  • 4 weeks later...
  • 3 weeks later...

Hello, 

New versions of some components of CocoonJS are published and, regarding Phaser, there are some important features and bug fixes we would like to share with you all: 

  • iOS ARM64 support
  • Enabled WV+ on 64 bit devices
  • Fix rare bug where Canvas+ could crash when executing code in onTouchEnd listeners
  • Fixed threading bug which was consuming battery when app was in background in Canvas+ (Android)
  • Fixed blank screen issue. 
  • Fixed missing last sprite using CANVAS renderer. 

The complete list is much wider. In case you want to have a look at it, here there is a link to the blog post: http://blog.ludei.com/latest-cocoonjs-releases-20141120/

 

Regards.

Link to post
Share on other sites

Hello, 

 

Ludei - Great stuff! Does this mean I can remove my nasty little hack from the Game.js?

 

Yes, you can delete that hack. In addition, we are analyzing the different hacks regarding navigator.isCocoonJS for being able to delete them too, so the game will work as in a normal browser without any trouble. 

 

Thanks a lot for your time and sorry for all the inconveniences caused. 

Regards. 

Link to post
Share on other sites

Hello, 

 

This one is more complicated. The problem is that if you disable the screencanvas when using phaser.CANVAS and WebGL, the performance will be affected and it will decrease. We like to treat screencanvas more as performance extension than a hack, as it happens with some specific WebGL GPU extensions.However, we will keep on investigating this issue and other ones and we will make a pull request to delete as many cocoonjs checks as possible.

 

Regards. 

Link to post
Share on other sites

huh..  this is a new on..     "uploaded file is not a valid zip file"   well... it is a zip file.. definitely..  also i didn't change anything and it worked before

 

Could you please tell us if you are compressing the file using the default compression in macosx? If so, please, try using another one. We are aware that sometimes the compression using this system can cause troubles. If the problem persists, please, let us know and we will have a look at it. 

 

Regards. 

Link to post
Share on other sites

thx ludei..  i used the default compression from KDE/plasma (linux)   i then zipped the file using a console/terminal tool and it worked - thx very much..  

 

my game works very well in the cocoonjs launcher - unfortunately i still see a black screen when compiling the game.. but everything is there.. sound, buttons, player, - just not visible..  disabling webgl (in my game and in the compiler) didn't help (which did the trick in the launcher)

 

 

also my music files (ogg) jump on the first note.. it's played twice - not a showstopper but quite strange

Link to post
Share on other sites

thx ludei..  i used the default compression from KDE/plasma (linux)   i then zipped the file using a console/terminal tool and it worked - thx very much..  

 

my game works very well in the cocoonjs launcher - unfortunately i still see a black screen when compiling the game.. but everything is there.. sound, buttons, player, - just not visible..  disabling webgl (in my game and in the compiler) didn't help (which did the trick in the launcher)

 

 

also my music files (ogg) jump on the first note.. it's played twice - not a showstopper but quite strange

 

Is it possible to have a test case that reproduces the issue? The ones we had from other Phaser users worked fine, so we need to have a deeper look at your project. If possible, please, open a topic in our community, because we are not constantly checking this forum and in the community we will receive the notifications when the topic is updated. Sorry for the inconvenience.

 

Regards.  

Link to post
Share on other sites

sorry for this "false" alarm concerning the black screen..  the "webgl" option was still turned on in the cloud compiler settings..    i can NOT use webgl otherwise the screen will be black but with webgl turned off canvas+ works quite well..  same thing in the launcher.. no errors in console..  phaser says it uses webgl..  but everything is black..  providing a testcase is very dififcult at the moment..  but when i find some time i'll provide one :)

 

 

 (besides the music jumping on on the first note on every loop ;-) )   there is  another thing:

 

i tested ads (admob) and they work very well in the cocoonjs launcher (from the store) with canvas+  - the exact same app doesn't show any ads when being compiled.. but think i added my adunit id's correctly in the ad settings  (why else should they show up in the launcher ?  

Link to post
Share on other sites
  • rich unpinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...