* CRITICAL ERROR * Game Crashing after few min.

0 favourites
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • 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.

  • 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.

  • 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.

  • 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.

  • 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

    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.

  • Could it be I'm using Cordova cranberry and Cocoon plugins in the same game?

  • 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.

  • 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.

  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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.

  • 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.

  • 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

  • * 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)