* CRITICAL ERROR * Game Crashing after few min.

Get help using Construct 2

Post » Sun May 21, 2017 4:58 pm

Something is running even when it's Paused, timescale = 0. I left it paused for awhile, then unpaused it (timescale = 1) and the lag was much much worse. Eventually it crashed. Nothing was moving or doing anything when the timescale was 0. Something was running though but how could that be when timescale = 0 when its paused?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sun May 21, 2017 5:08 pm

You have to do some debugging, start the game in debug mode on the right side click profile, and see what events take the most CPU time, then you will know what is making the lag.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Sun May 21, 2017 5:25 pm

I don't know how to understand that sorry. I see a bunch of percentages? none of them are really high though.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sun May 21, 2017 5:44 pm

Oooh, i think I know what it was, I hope. I had a couple of dozen events, at least, for different sprites saying If Overlap a certain object then move that object behind the object its overlapping. I thought it only got triggered when it happened, but the cpu usage was 1.1% or higher as the game was running, even when it was paused. I guess the game was constantly checking to see if those objects were overlapping the other object, even when paused. It was constantly checking all those events.

I put in for each of them Trigger Once While True and the cpu usage dropped to around 0.2%.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Sun May 21, 2017 8:59 pm

I guess you can't use too many overlapping things else cause its always checking to see if they're overlapping?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 12:36 am

It's still lagging after playing for a while, also pausing for a while then unpausing.

I looked at Debug mode, the object count is not rising or falling to extreme levels. Nothing is using up a lot of CPU but it's still lagging like crazy. The phone isn't that warm either. I don't know whats going on. I do have Set Local Storage but in the debugger its not using a lot of CPU. nothing is using a lot of CPU. i simplified stuff. I cant get rid of the collision stuff, because the game relies on that. and i make sure objects that are created get destroyed.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 12:57 am

Nothing is using a lot of CPU and the amount of objects doens't keep going up. Like up and up without going back down. I am completely stumped. I've simplified the code as much as I can. The On collisions are absolutley critical. That's the whole point of this game.

I have no idea whatsoever what could be causing all this. I kid you not i've tested at least a dozen different things, various things here and there but nothing has worked. I've tried. It's still lagging after playing for awhile.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 1:04 am

hm that is weird, once I had serious lag because my collision detection was bad, the game was checking between 15k-25k collisions per second if remember correctly but that thing showed up in the debugger and CPU usage was between 80-100% all the time.

Maybe you have the time scale lowered then 1, so it seems like the game is lagging but its Actually not. You should check that just incase.

I cannot think anything else that can be the problem, another think you can do is try Disabling event by event, and check performance difference.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon May 22, 2017 1:05 am

imhotep22 wrote:You have to do some debugging, start the game in debug mode on the right side click profile, and see what events take the most CPU time, then you will know what is making the lag.


I did that. I did something so something wasn't using as much CPU, but it's still lagging after playing for awhile. Nothing is using a lot of CPU, and the number of objects doesn't keep going up without dropping.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 9:45 pm

Randomly said something about getting rid of those starting objects when the layout first starts. The ones that are needed to do create Object. that's so cool, i thought they had to always be around on the layout. but i guess Construct 2 "saves" them somehow so the objects can be created later, that's awesome :) That actually cut the object amount in about half! that's so cool :)

I also off-loaded the game over-screen to a different layout. If those two things don't work i don't know what to do next. I haven't tried it yet! but i will soon. Basically knocking down the number of objects, the extra ones that all of the others are created from, and off-loading the game over screen to whole other Layout.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, valefor and 23 guests