CocoonJS HELP ASAP!

0 favourites
  • 14 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I exported my game using the CocoonJS option. I then copy the zip file onto the CocoonJS app on my iPhone through iTunes. Whenever I try launching the game on my iPhone, the screen goes black for 5 seconds and then the CocoonJS app crashes. What could the problem be?

  • How big is your game? Whats the memory use in Construct 2? Because for CocoonJS, multiply whatever memory use in C2 by about 4 and thats what it uses on mobiles.

  • I feel your pain, the best solution is to not use CocoonJS as I had similar problems:

    https://www.scirra.com/tutorials/907/de ... e-easy-way

    It's not a viable long term solution.

  • I'm working with the OP on the game. I took a screenshot of some of the warnings that we receive while trying to unzip and here are the ones that we encounter (not too sure if it make diagnosing the issue any easier):

    Not implemented canvas addEventListener:

    webglocontextrestored

    Not implemented canvas addEventListener:

    webglcontextlost

    Not found getElementByld: c2canvasdiv

    The game doesn't even make it to the loading screen. We did insert a custom load screen logo (but I don't think that is our issue....)

    I believe our file is something close to 20MB

  • How much memory does it use? What device are you trying to run it on?

  • Well, unzipped , the file was around the 22MB mark, we've been testing it on the iphone5/5c . An earlier build (which was under 5MB) works just fine.

    The only other 'memory-eater' in our game is our high-score board, which uses local storage.

  • Do you have an image bigger than 0.5 MB?

  • Hmm, ok. iPhone 5 should definitely be enough. You could try to remove objects one at a time and see what's really causing the freeze as you have managed to get it working earlier. Hope you get it running soon!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's not the file size but the memory usage.

    Compressed PNG 8bit or JPG don't use much filesize, but once they load into memory as a texture, they become massive. A blank 1280 x 720p sprite for example, is probably a 1kb JPG, but its actually a 16MB texture in memory due to being placed into 2048 x 2048 texture.

    My Ninja game is only 17mb exported but CocoonJS loading all the assets into memory = 450MB into ram on start, crashing devices with 768MB or less ram.

  • Are you using any 3rd party plugins?

  • We are not using any 3rd party plugins. In construct, the memory use in the status bar says our game is using 382.3mb. If this gets multiplied by 4 when exporting using Cocoon and played on the phone, I can clearly see why the game is crashing. Is there any way to lower the amount of memory used by the game?

  • It's not the file size but the memory usage.

    Compressed PNG 8bit or JPG don't use much filesize, but once they load into memory as a texture, they become massive. A blank 1280 x 720p sprite for example, is probably a 1kb JPG, but its actually a 16MB texture in memory due to being placed into 2048 x 2048 texture.

    My Ninja game is only 17mb exported but CocoonJS loading all the assets into memory = 450MB into ram on start, crashing devices with 768MB or less ram.

    Are there any decent methods to cut down on the memory usage of pngs? That's what all of our images are.

  • We are not using any 3rd party plugins. In construct, the memory use in the status bar says our game is using 382.3mb. If this gets multiplied by 4 when exporting using Cocoon and played on the phone, I can clearly see why the game is crashing. Is there any way to lower the amount of memory used by the game?

    Holy crap, Construct is saying you use 382MB?!!! Mother of god... how big are your background and sprite images?!

    The only way to lower the memory use is to use smaller sprites, instead of 512 x 512 or 256 x 256, consider using 128 x 128 pixels. Also do not have the background as one large image file, it's insane to do that for many different backgrounds.

    If your game is 1280 x 720, each background image of that size is 16MB into memory as a texture 2048 x 2048, because it will not fit in a 1024 x 1024 texture as its width is too large, it has to go up to the next power of 2 texture.

    READ THIS: https://www.scirra.com/blog/112/remembe ... our-memory

    And read it again and again til you understand.

    When you design for mobiles, target a device and aim to have less than half its total ram taken by your game, because mobiles have a lot of junk running in the background it consumes nearly half a device's ram. ie. a 1GB phone typically only have 500MB free for apps. If you want your game to run good on 512MB devices, don't let it consume more than 256MB ram etc.

  • i have same error with just 2 sprites on 1 layer !?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)