What may cause C2 games to crash on Android?

Get help using Construct 2

Post » Fri Jun 20, 2014 4:08 pm

It crashes occasionally (certainly not on every launch) It just quits. No errors. No Message. Nothing. It just dissapears. I experience this on signed APK file exported using CocoonJS's latest version and C2 latest stable. The game is downloaded from Play Store's beta testing mode.
My phone has quad core processor, 1 GB RAM and HD Display.

What can cause this?

Also, my friends told me my game takes up too much of their RAM and drains their battery. Is there a way to prevent this?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Fri Jun 20, 2014 4:25 pm

Sounds like there are many objects that could be destroyed.

You should try the Debug-Mode on WIndows to find out which Event or Object causes these issues.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sat Jun 21, 2014 3:22 pm

xeed wrote:Sounds like there are many objects that could be destroyed.

You should try the Debug-Mode on WIndows to find out which Event or Object causes these issues.


But it doens't crash on windows. How will I know which object causes it?

Also, will it help if for example I destroy all menu objects when going to the Gameplay layout and when the player goes back to the main menu, use System action to recreate the destroyed menu objects?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Tue Jul 15, 2014 3:16 pm

bump
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Tue Jul 15, 2014 3:29 pm

You need to optimize, reduce processor and memory use if you want your game to work well on mobile devices.. running in debug mode helps you see what uses the most memory and processor time..

best of luck,
-Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,071

Post » Tue Jul 15, 2014 3:31 pm

Using the Debug-mode you can see what takes the most amount of processing time and memory etcetera..
You could (read should) use that to find out what the bottleneck is..
You should be glad it doesn't crash on windows, for that will give you enough time to figure it out..
First thing I would look at is if there aren't objects being created all the time and if the collisionchecks aren't too high.
It could also just be a part of your programming (events) that is taking up a lot of your cpu time.
This is exactly what the debugger is for, debugging..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 15, 2014 3:51 pm

LittleStain wrote:Using the Debug-mode you can see what takes the most amount of processing time and memory etcetera..
You could (read should) use that to find out what the bottleneck is..
You should be glad it doesn't crash on windows, for that will give you enough time to figure it out..
First thing I would look at is if there aren't objects being created all the time and if the collisionchecks aren't too high.
It could also just be a part of your programming (events) that is taking up a lot of your cpu time.
This is exactly what the debugger is for, debugging..


The problem is using C2's debugger is that when using the debuger to run the game, the game experiences EXTREME lag. The kind of lag which is worse than on a mobile. On mobile the game has about 50-60 FPS, on normal windows its 60 FPS and in dubug mode its 7 FPS!!

Is this normal with all C2 projects or is it just because of my CAPX?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Tue Jul 15, 2014 3:53 pm

It's probably running out of memory, or a CocoonJS bug. It is almost impossible to comment further without seeing your project.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471

Post » Tue Jul 15, 2014 3:55 pm

There are (probably) some issues with your capx..
Even with 7 FPS you should be able to have a look at the debuggers info to see where that is coming from..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 15, 2014 4:15 pm

LittleStain wrote:There are (probably) some issues with your capx..
Even with 7 FPS you should be able to have a look at the debuggers info to see where that is coming from..

@Ashley It'll probably be a problem with my project as there are several good performance games wrapped using CocoonJS.

@LittleStain
It says Collision detection: 227 (avg)
Object count: 35 (avg)

Is this the problem?

I read somewhere on the forums that doing something every tick is bad for performance on mobile.
I am doing these things every tick:

Every Tick:
1. Simulate Platform pressing right
2. Scroll to player
3. Add time spent to variable TotalDistance
4. Add time spent to variable CurrentDistance
5. Set text "Score" to variable "TotalDistance"

All these "every tick" actions are vital to the game's basic gameplay and I can't seem to find a way to avoid using Every Tick.
B
10
S
2
Posts: 79
Reputation: 1,122


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests