• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Screen image freezes but game keeps playing

Dustin

Member
The memory isn't suddenly maxed out and neither the step or draw loops are going over their allotted time. Still about 16ms between frames and game seems to be running as normal based on sounds and debug messages. The only major change from previous version is adding of large background images for a new level. The texture page size was already increased to 4096 which is larger than any of the new images (just checked). There IS some code used for pausing which takes a screenshot and displays it (for bringing up menu) but this still happens when it was commented out.
Has anyone seen anything like this?
 
I've only seen something similar when I accidentally added a background but its layer was accidentally set in front of other items in the game, so I couldn't see anything except the black background.

If you've made some major changes, clearing the cache sometimes helps if you haven't tried that already.

When exactly does this happen?

You could try using the debug mode and use a break point so you can then step through the code line by line, and also check out the general state of your game instances and what they are doing.
 

NightFrost

Member
You have a suspicion of the problem but it seems you haven't tested it out. So: what happens when you remove those large backgrounds from game? Actually, what do you mean with freeze? A short hitch, or a total freeze that requires killing the program? If its the latter there's probably an infinite loop somewhere in your code.
 

Dustin

Member
Update: when I removed the background assets for the new level the problem went away
You have a suspicion of the problem but it seems you haven't tested it out. So: what happens when you remove those large backgrounds from game? Actually, what do you mean with freeze? A short hitch, or a total freeze that requires killing the program? If its the latter there's probably an infinite loop somewhere in your code.
I just tested with the new backgrounds removed (no other changes) and the problem went away. I also tried (only) removing the new ground sprites (a bunch of small images) and there were slight pauses a few times but then it worked fine.

By "freeze" I mean that just the display freezes, usually after a few seconds into a level (usually takes a little longer if there are fewer objects in the level). The code continues to run as normal in the background. Debug messages don't show anything wrong, I can hear the expected sounds, and I can bring up the menu and (by counting key presses) exit the game.
 

Dustin

Member
It looks like this is what happens when you have too many textures in one group (organizing into various groups, which you can do with the pro version, fixed the issue).
 
Top