* 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.
  • This is the crash thing I got.

    ANR Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 18. Wait queue head age: 5580.8ms.)

    I have variables going up and at 1, 4, 7, 10, and 13 they each do random 1-5 wait 4 sec. random 1-5. For all of them. Could that be whats causing the game to lag and eventually crash?

  • Try adding a "Trigger once" condition when setting the variables. I suspect that the game is setting those variables each tick to random 1-5...

  • So Trigger once Variable = 1, random 1 - 5 wait 4 seconds random 1 -5 ? Could that also be why when the game is paused (timescale = 0) for awhile and unpaused (timescale = 1) the lag gets worse? Cause Timescale is supposed to stop Every 1 second. Every 1 second I add 1 to the Variable. That gets around the Every x seconds starts when the game starts. Cause at the start of the Layout the Variable is set back to 0.

    I'll try that, thank you

  • Phoenixbowman No problem, let me know if it doesn't work. =D

  • Can trigger once while true be put after variable = x and have the same effect? I put it before in, in the same event area

    trigger once while true

    variable = x

    but it wasn't working. Nothing was being generated.

    I switched it to

    variable = x

    trigger once while true

    Will it have the same effect of only generating once and never every tick? I haven't tried it on the phone yet, but will putting trigger once while true after variable = x stop it from doing a random number every second?

  • It's still lagging bad if its played for too long.

    I tried

    trigger once while true

    variable = x

    but it wouldn't run at all. Then I did

    variable = x

    trigger once while true

    but it still lags

  • Are you sure the variable are the ones causing the lag? I suggest running in debug move and in the event tab see what takes the most memory from the system.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This may be resolved much quicker by providing a .capx for us to investigate, rather than relying on guesswork.

  • I dont feel comfortable sending the .capx sorry. My friends and I are small group and it took us awhile to come up with this game, the characters, and graphics, sound, and music.

    Everything is in the .capx. I'd rather not give out the .capx sorry. Also I've completey redone how the sprites made. I got rid of the Variables that make the sprites. Now I have invisible stationary sprites that when they collide with them, more sprties get made.

    I'm trying something where sprites hitting stationary invisible sprites generate more sprites. I was looking at the debug but dont know how to read it.

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

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

  • 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 don't know how to understand that sorry. I see a bunch of percentages? none of them are really high though.

  • 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 guess you can't use too many overlapping things else cause its always checking to see if they're overlapping?

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