Graphical glitches on iOS when resuming after game has been put into the background

0 favourites
  • 5 posts
From the Asset Store
Tweakable and easy to use effects for your projects.
  • Hi,

    I've noticed an intermittent bug where several graphic issues are present when switching to my game after it's been put into the background using task switching then resuming it after a while.

    Three issues specifically:

    1. One sprite whose top edge is anchored to "Viewport top" on a 0% parallax layer is shown enlarged maybe 10x so covering most of the screen - fortunately it's transparent so I can see and access controls beneath.
    2. Drawing canvas is not being displayed.
    3. A spritefont sprite sheet is showing - stretched vertically.

    Restarting the layout clears the issues, but that means the player restarting their game and losing progress.

    Problem has happened on both an iPad 6th Gen and and iPhone SE 2020 - both running iOS 17.4.1.

    I'm aware of this issue:

    github.com/Scirra/Construct-bugs/issues/7626

    And wondering whether it's related (as both that and my issue fall under the broad "graphical issues when resuming app" category).

    I don't think I'd seen the issue until a few weeks ago, so not sure whether C3 version dependent or not - or it could just be that my testing has been more intensive recently. I did wonder whether it was related to the recent update the HTML layers.

    Unfortunately, it's intermittent, and I'd have to create iOS builds each time to test.

    I will try some older versions of my game and of C3 to see if I can get any more clues.

  • I built my current project using C3 v368.2 - the stable version before HTML layers were introduced. I had to save as a project folder then edit the version number in project.c3proj so it would open - I know that's unsafe, but it was just for a test.

    I still saw the error (specifically the one with the enlarged sprite - no. 1 in my original post), so I can rule out my theory that it might have been the new HTML layers introduced in r379.

    Next step is to see if I can reproduce the issue using a really old version of my project in the current c3 version.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Opened a version of my game (created late December last year) in v368.2 and reproduced the issue.

    I guess the next step is to dismantle the game to get a minimum project with the issue reproducible.

  • Deconstructing the project's going be too much work for the moment, so I tried a different approach.

    On resume, I loop through all the layers to check whether they're visible and if so, write that state to an array, make the layer invisible, then on the next tick, loop through the array and make any layers that were visible on resume visible again.

    This fixed issues 1 & 2 above, but I'm still getting this issue:

    If I flip the image vertically and squeeze it, it's clear that it's the first row from one of my sprite fonts:

    This is the sprite font in question:

    Anyone any ideas why this might be happening? (It's on resume on iOS after the game's been in the background for a while and always at the same "game over" stage of my game)? Any workarounds?

  • I've just implemented an obvious workaround - if the game over screen's visible on resume, I just simulate the user clicking the arrow button which restarts the whole layout and clears the graphical glitch. Impact to the UX is minimal.

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