Help With Cocoon Performance Issues

0 favourites
  • 11 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Our game is pretty basic. Not a whole lot goes on necessarily and its pretty low resolution and little sprites.

    Yet from the start, the game runs at 10 FPS with CocoonJS.

    I started out with Intel XDK. But its broken. Every attempt with projects in XDK results in failure. So I wanted to try CocoonJS with this little LudumDare game.

    Here is the capx - dropbox.com/s/7nr388isl2xe3c8/shark2%20-%20Copy.capx

    Any help would be appreciated.

  • Have you tried changing the cocoonjs physics engine ? (dunno if you use it)

    Click the cocoon object in your project windows under objects, set physics engine on your left to web based ....

    Makes a heap of difference if your using anything physics related in cocoonjs.

  • You should test on mobile from the very start. Then you would have a rough idea at what point things got slow, which would imply whatever you added recently has a performance impact.

  • You should test on mobile from the very start. Then you would have a rough idea at what point things got slow, which would imply whatever you added recently has a performance impact.

    Issue is there really isn't an easy way of accomplishing this. If only cocoonJS and/or Intel XDK really had native testing support in that you can just click and test. But in reality, Intel XDK takes forever to test and appLab is a mess. CocoonJS is a lot easier but to export, upload, open their app, download, and have no way to actually "test" and find what is an issue is a little obnoxious.

    But I don't know or think there is anything on Construct 2's side of things that can help with that anyway.

  • You should use their custom launcher, from ludei

    it replaces the app your making on your phone, and boot your coocoonjs zip from an url or sd card .

    Steps would be:

    Aquire custom launcher from ludei, install on your phone (remove original app)

    my way: have wamp server installed on your windows box, place exported cocoon JS file in your webserver directory.

    with your phone, hooked to wifi network on which your computer with wamp resides, start custom launcher, enter the IP / url of your wamp server with the cocoon zip file .. and voila .. instant testing with debugger :D

  • AnthonyB28

    Tried your game. It makes my FX8350 8-core processor jump to a 40% occupation (almost all draw calls) and it's pretty obvious that cocoonjs can't handle such an hungry game.

    You're making an extended use of text objects changing them every tick.

    Take a look to this post.

    You can try 2 solutions.

    1) Turn WebGL off

    2) Replace text objects with spritefonts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AnthonyB28

    Tried your game. It makes my FX8350 8-core processor jump to a 40% occupation (almost all draw calls) and it's pretty obvious that cocoonjs can't handle such an hungry game.

    You're making an extended use of text objects changing them every tick.

    Take a look to this post.

    You can try 2 solutions.

    1) Turn WebGL off

    2) Replace text objects with spritefonts.

    Thanks for your time!

    I turned off WebGL and replaced with just spritefonts, I got it up to 20FPS. I also made the every tick stuff to "every 0.5 seconds" or such.

    Its odd because I don't have much else on the screen at once till later in the game and the CPU usage isn't huge on my end.

    Here is a link to the newest capx

    dropbox.com/s/cc7yqsnxfiqchr8/shark-cacoon.capx

  • AnthonyB28

    Tried your game. It makes my FX8350 8-core processor jump to a 40% occupation (almost all draw calls) and it's pretty obvious that cocoonjs can't handle such an hungry game.

    You're making an extended use of text objects changing them every tick.

    Take a look to this post.

    You can try 2 solutions.

    1) Turn WebGL off

    2) Replace text objects with spritefonts.

    I fixed it! 60FPS

    I removed the SWAG and YOLOSWAG text objects offscreen that only appear onscreen when you do specials.

    That is weird. Why do these kill performance? They're text. I mean, I can see why changing them every second and such does. But in this case I made it so they weren't.

  • That is weird. Why do these kill performance? They're text. I mean, I can see why changing them every second and such does. But in this case I made it so they weren't.

    Because you were changing them every tick (Event 46 of the older capx -> random color) forcing a wasteful rerender.

  • >

    > That is weird. Why do these kill performance? They're text. I mean, I can see why changing them every second and such does. But in this case I made it so they weren't.

    Because you were changing them every tick (Event 46 of the older capx -> random color) forcing a wasteful rerender.

    No even without that.

    If I just had the text, and didn't have the colors changing, it would still be weird. But now that I use the spritefont, its all better.

    Is there anyway around the changing colors thing do you know? I still would like that. As silly as it is, it makes it all the more fun haha

  • If I just had the text, and didn't have the colors changing, it would still be weird. But now that I use the spritefont, its all better.

    Maybe it was the easetween behaviour that for some obscure reason interfered with the rendering... It's hard to say.

    All I know is that CocoonJS + Text objects is a no-no combination. <img src="smileys/smiley1.gif" border="0" align="middle" />

    Is there anyway around the changing colors thing do you know?

    Now that you got rid of text objects you may re enable WebGL and play with the tint shader.

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