Help With Cocoon Performance Issues

Get help using Construct 2

Post » Mon Nov 04, 2013 1:16 am

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 - https://www.dropbox.com/s/7nr388isl2xe3c8/shark2%20-%20Copy.capx

Any help would be appreciated.
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Nov 04, 2013 10:28 am

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.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Mon Nov 04, 2013 3:15 pm

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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,543
Reputation: 195,430

Post » Mon Nov 04, 2013 6:31 pm

[QUOTE=Ashley] 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.[/QUOTE]

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.
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Nov 04, 2013 7:28 pm

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 :Dlennaert2013-11-04 19:29:53
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Mon Nov 04, 2013 7:38 pm

@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.Knifegrinder2013-11-04 19:39:44
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Mon Nov 04, 2013 9:11 pm

[QUOTE=Knifegrinder] @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.[/QUOTE]

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
https://www.dropbox.com/s/cc7yqsnxfiqchr8/shark-cacoon.capx
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Nov 04, 2013 9:15 pm

[QUOTE=Knifegrinder] @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.[/QUOTE]

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.
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Post » Mon Nov 04, 2013 10:00 pm

[QUOTE=AnthonyB28]
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.[/QUOTE]

Because you were changing them every tick (Event 46 of the older capx -> random color) forcing a wasteful rerender.Knifegrinder2013-11-04 22:02:51
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Mon Nov 04, 2013 10:09 pm

[QUOTE=Knifegrinder] [QUOTE=AnthonyB28]
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.[/QUOTE]

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

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
B
10
S
3
G
3
Posts: 47
Reputation: 2,666

Next

Return to How do I....?

Who is online

Users browsing this forum: Cubeeo and 17 guests