Terrible performance on mobile...

Discussion and feedback on Construct 2

Post » Tue Jun 10, 2014 12:29 pm

Hi!

I've developed a small prototype that works fine on PC (60fps etc.):

http://www.manaforge.net/test/captainfoot/ (arrow or touch to move and jump)

I just tried it on mobile (iPhone 4, chrome)... and it runs at 30-35fps before the game starts... How is it possible? 8 objects (3 squares and 5 text boxes) and it's laggy? I can't describe what's happening when the enemies start spawning. It's so... slow... and unplayable... There is no physics in the game, it looks pretty simple and clean... What's happening?


Please rassure me: if I export the game to mobile with crosswalk, will it be fluent like any simple 2D game? If it can't run smoothly with 8 objects, I just can't make a mobile game with C2.

Help :? :mrgreen:

Rag
Last edited by Ragtime on Tue Jun 10, 2014 1:30 pm, edited 1 time in total.
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Tue Jun 10, 2014 1:05 pm

The iPhone 4 was released 4 years ago and its hardware is very weak compared to modern devices. Even the iPhone 4S is a big step up, and you can buy devices today for $99 that can get double the performance of an iPhone 4. Unfortunately it's probably only practical to target the 4S and newer.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Tue Jun 10, 2014 1:18 pm

@ragtime
Sorry but this lags also on android high end devices and a game like this should really run smooth even on an old iphone.
Here are some tips.
1) (Most important and probably the real cause of your lags) NEVER use text objects updated every tick with WEBGL turned on. Remove them and let me know if you're gaining some performance.
2) If you want to test on iOS don't use chrome. Chrome for iOs is a skinned version of safari. Try the CocoonJS launcher instead or an exported ejecta build.
3) If you're targeting iOs, even if you're using CocoonJS or Ejecta use Canvas2D instead of WebGL. I've never seen a game run better with WebGL turned on on iOs. The situation will revert only when iOs8 will be out since this update will contain (finally) a proper native WebGL support and a modern JS interpreter.
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Tue Jun 10, 2014 1:45 pm

Your game even before it starts is using 6% of my i5 3570K CPU. That's very high for nothing on the screen.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Tue Jun 10, 2014 1:51 pm

disable webgl
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Tue Jun 10, 2014 2:39 pm

- WebGL disabled
- 6 objects on screen (no changes when disabling the text boxes)

An iPhone 4 should be able to handle that, shouldn't it?
Image

I'll use the CocoonJS launcher but still... this is crazy. I may try with an empty scene, just for fun...
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Tue Jun 10, 2014 3:09 pm

The CPU usage is incredibly high even on my desktop machine.
Probably there's something wrong in your event sheets causing this cpu drain. Can you share your capx?
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Tue Jun 10, 2014 3:30 pm

Here is the capx:

https://www.dropbox.com/s/se1hgpmolywsi ... 3-005.capx

Hope you'll find what is depressing me! :oops:
Last edited by Ragtime on Wed Jun 11, 2014 6:03 am, edited 2 times in total.
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Tue Jun 10, 2014 4:28 pm

How can I disable WEBGL on ejecta?
it is sufficient to disable it from C2 project setting?

thank's
B
6
S
1
Posts: 62
Reputation: 578

Post » Wed Jun 11, 2014 12:39 am

I was going to look at the capx. But uses a SpriteFont that isn't official. I will pass on installing a plugin I won't use. Good luck. When sharing CAPXs the less thirdparty plugins the more likely someone will take a look.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Next

Return to Construct 2 General

Who is online

Users browsing this forum: takamoto and 3 guests