Phoenixbowman's Forum Posts

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

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

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

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

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

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

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

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

  • Did you try the debug mode and see whether any object count is rising or falling onto abnormal levels?

    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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had over two dozen If Overlapping an object, put the object that's being overlapped behind the one overlapping it. I got rid of all of those and replaced it with While on Screen, move object in front of the background and that really really knocked down the CPU a lot from what I can see in the debugger.

  • I guess you can't use too many overlapping things else cause its always checking to see if they're overlapping?

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

  • I don't know how to understand that sorry. I see a bunch of percentages? none of them are really high though.

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

  • Nope, it's still lagging, and now it lags sooner. I made it so now running into stationary sprites sets off a wait, after waiting x seconds it generates another sprite, etc. in a loop.

    Could it be the movement? As simple as that? i have on touching R, L, U, D, simulate 8 directions. Could it be that? I have four arrow keys, for moving in four different directions.

    For testing I have default controls are set to Yes. Could that be what's messing it up?