[SOLVED] Super Lag Game in Android, How to Fix?

Get help using Construct 2

Post » Sat Jun 07, 2014 7:21 pm

This is a 3 match game I got from some tutorial on the net
Scale it up so it fit 16:9 on portrait and convert to APK using cocoon Js canvas mode, the result? Lags like hell!

How to fix this thing up?
Convert the movement to dt?


Just figured out the cpu usage hit 70-80% :oops:
You do not have the required permissions to view the files attached to this post.
Last edited by ijoin on Sun Jun 08, 2014 1:47 pm, edited 1 time in total.
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Sat Jun 07, 2014 8:38 pm

Try using a Sprite font instead of text. It works better with android.
B
20
S
3
Posts: 67
Reputation: 1,074

Post » Sat Jun 07, 2014 9:37 pm

i have the same problem
B
23
S
5
G
2
Posts: 30
Reputation: 1,618

Post » Sun Jun 08, 2014 6:18 am

Knight05 wrote:Try using a Sprite font instead of text. It works better with android.


Changed to that one, still, it lags , only 15 fps
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Sun Jun 08, 2014 9:58 am

Guillermo wrote:i have the same problem

lol, welcome on board
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Sun Jun 08, 2014 12:33 pm

I think I found the culprit

The main problem is the "match finder function" which is called whenever another block is destroyed and fall, it's called to recheck the match again

Look at the highlighted part, the else event to recall the findmatch function
Image

And this is the function

Image

I'm seriously desperate to make it smoother :x


________________________________________________________

I've ported it to cocoonjs without the else -> call find match function and it performs noticeably far far smoother
Now, if only someone can help to optimize the code :lol:
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Sun Jun 08, 2014 1:47 pm

Problem Solved!
B
8
S
2
Posts: 203
Reputation: 1,169

Post » Sun Jun 08, 2014 6:24 pm

Any info you can provide as to how you solved would be a huge help for the community :D
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Sun Jun 08, 2014 6:24 pm

Oops nevermind, I noticed you had more info at the bottom, i mistook it for your signature haha. Thanks!
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Jun 10, 2014 10:28 am

80bit wrote:Oops nevermind, I noticed you had more info at the bottom, i mistook it for your signature haha. Thanks!

lol, it's exactly looks like a siggy

I'm gonna post the capx, it's not finished yet but it runs smoothly on android now
B
8
S
2
Posts: 203
Reputation: 1,169


Return to How do I....?

Who is online

Users browsing this forum: David181 and 19 guests