* CRITICAL ERROR * Game Crashing after few min.

Get help using Construct 2

Post » Mon May 22, 2017 9:49 pm

Could it be I'm using Cordova cranberry and Cocoon plugins in the same game?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 10:49 pm

The only thing it might be could be saving to local storage. Every x seconds it saves cause their are achievements involving total time played. I've done everything else. If the code gets any more condensed the game will break. Nothing is using a lot of CPU, either. Everything it using less than 1% CPU. I even turned off certain groups when they aren't being used.

I've messed around with the variables, that didn't work.
I condensed some code, that didn't work.
Randomly advised I cut down the extra objects, that may have helped some but it's still lagging. These are extra objects that all others are created from.
I off-loaded the game over screen to another layout. That didn't work either.

I am out of ideas, I literally have no idea what to do now.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Mon May 22, 2017 11:07 pm

Without any capx this is a serious nut to crack.
Is it crashing on desktop or just the phone (If it's just the phone, have you tried streaming the game from the PC? Intel XKD?) ?
Have you tried re-making key game mechs in a separate smaller capx to see if the problem persists in that project?
Can you screen capture (video) your debugging so people can see what's happening?
In that order.
B
60
S
36
G
23
Posts: 342
Reputation: 17,159

Post » Tue May 23, 2017 12:23 am

This was crashing on the phone. Nothing is using a lot of CPU. Everything is using less than 1%, and the highest it goes in terms of overall CPU is 10%, sometimes it goes lower.

Good news! I did all of this stuff and it didnt help, but that meant the only thing left was the Local storage. I was trying to keep track of total time the game was played, like over multiple games. I had it so every x seconds set Local Storage.

This is everything I did:

I've messed around with the variables.
I condensed some code.
Randomly, someone whose on these forums, advised I cut down the extra objects, that may have helped some but it's still lagging. These are extra objects that all others are created from.
I off-loaded the game over screen to another layout.

It is still lagging some though. But it lags, then goes back to normal. Like it lags, then goes back to running okay. Might it be because Fullscreen scaling is set to High Quality?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue May 23, 2017 12:36 am

Frak! it still lags and crashes...... but it lasted longer than before. I haven't tried Linear and Low Quality yet, but i'm about to try. Randomly recommended trying Linear, and im also going to try Low Quality too. To see if that helps.

As in Low Quality for Fullscreen Scaling and Linear for Sampling.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue May 23, 2017 1:15 am

My friend's phone is different from mine. He doesn't experience a lot of lag, some but not a lot. It might be High-Dpi display! Randomly, a person whose on these forums, mentioned Project Properties. I put it back on High Quality for Fullscreen Scaling. But along with Linear im going to try it with High DPI display turned off, so its set to No.

Cause what if its a matter of the screen? His phone isnt as new as mine in terms of what it came out. What if that's the difference? On mine too much is going on and because my phone can handle it, the game is using High-DPi display?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue May 23, 2017 4:54 am

Nope, still lagging after awhile. I did all this. As well as setting Sampling to Linear and Fullscreen Scaling to Low Quality. Setting Dpi didn't work cause the game screen ended up in the corner of my phone's screen.


I've messed around with the variables.
I condensed some code.
Randomly, someone whose on these forums, advised I cut down the extra objects, that may have helped some but it's still lagging. These are extra objects that all others are created from.
I off-loaded the game over screen to another layout.


Could it be how I'm "catchIng" objects? I have four sprites that "catch" the sprites that give points. they run into them and get destroyed, so objects dont pile up.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue May 23, 2017 5:24 am

While I'd love to help, I honestly have no idea how to help without seeing the project - since I don't really know anything about the game and a mere description doesn't indicate how you've gone about creating the mechanic. That's part of why I was wondering about recreating the mechanics in a smaller project. That way you can better pinpoint what is causing the slowdown. As mechanics are added, you can test the game on your phone and when the problem is reproduced you've found your answer about where the issue is. Additionally, that would allow you to share the capx with the community for support.
B
60
S
36
G
23
Posts: 342
Reputation: 17,159

Post » Tue May 23, 2017 3:00 pm

It could be i have a bunch of achievements that are if x => then unlock this achievement. I'm going to put Trigger once while true in to see if that works. Because its always trying to unlock them. that could be it.

My friend doesn't want me giving out the .capx, sorry :(
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue May 23, 2017 4:06 pm

* FIXED IT!!!!!!!!!!!!!!!!!!!!!! *

I think the other stuff helped, all of the other stuff I did, and the stuff other people recommended that i try. But the main problem, besides the Local Storage, was if something was the same as more than a number, unlock achievement. It kept "unlocking". that could only be done once, getting it once, cause google only does one time for each achievement, you can't get the same one multiple times for one account, its unlocked once and you have it.

But the code kept unlocking cause the numbers were still greater than the numbers in the event. I did that so if the score went over the amount instead of being exact, they would still get the achievment.

I solved it by putting in, at the bottom below variable => x Trigger Once While true. that stopped it from trying to "unlock" the achievements constantly. It worked once, the achievement unlocked like it was supposed to, but because of trigger once while true, it didn't keep trying to unlock it.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Previous

Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], FacuLNF and 69 guests