Screen image freezes but game keeps playing

Discussion in 'Programming' started by Dustin, Sep 14, 2019.

  1. Dustin

    Dustin Member

    Joined:
    Jan 19, 2017
    Posts:
    20
    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?
     
  2. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    2,180
    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.
     
  3. NightFrost

    NightFrost Member

    Joined:
    Jun 24, 2016
    Posts:
    1,926
    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.
     
  4. Dustin

    Dustin Member

    Joined:
    Jan 19, 2017
    Posts:
    20
    Update: when I removed the background assets for the new level the problem went away
    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.
     
  5. Dustin

    Dustin Member

    Joined:
    Jan 19, 2017
    Posts:
    20
    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).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice