Random freeze when changing Layout

0 favourites
  • 8 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I am facing a random issue where "go to layout" freezes the game. I have put some actions on "end of layout" (without any loops). I have tried to destroy some objects before changing layout and I have even put a wait 0 sec to ensure the freeze doent happen. The problem still occurs and is random. It happend 2/10 times.

    After checking the browser for any error it gives me these:

    c3runtime.js:412 Uncaught (in promise) TypeError: Cannot read property 'Update' of null

    at C3.WorldInfo._RemoveFromRenderCells (c3runtime.js:412)

    at C3.Runtime._FlushInstancesPendingDestroyForObjectClass (c3runtime.js:445)

    at C3.Runtime._FlushInstancesPendingDestroy (c3runtime.js:445)

    at C3.Runtime.FlushPendingInstances (c3runtime.js:445)

    at C3.EventSheet.Run (c3runtime.js:292)

    at C3.EventSheetManager.RunEvents (c3runtime.js:289)

    at C3.Runtime.Step (c3runtime.js:445)

    at async C3.Runtime.Tick (c3runtime.js:445)

    Any idea what is causing this?

  • I have put some actions on "end of layout" (without any loops). I have tried to destroy some objects before changing layout and I have even put a wait 0 sec to ensure the freeze doent happen.

    You don't need to delete objects (unless they are set as Global), and you definitely should not use Wait in "On end of layout" event.

    Does it always happen with the same two layouts? Try adding "Browser log" at the end of layout1 and at the start of layout2, this will tell you when the problem happens exactly.

    Also try disabling "On end of layout" and "On start of layout" events, see if the problem goes away. If it does, there must be something in these events.

    Check if you have any global objects that don't need to be global, fix them..

    If nothing helps, please share your project file.

  • Tried to change some parts and now I get even worse results. Layout doesnt even change. It gets stuck on a radom point on my event sheet.

    The new message I get is:

    c3runtime.js:154 Uncaught (in promise) TypeError: Cannot read property '_GetLastCachedZIndex' of null

    at a (c3runtime.js:154)

    at Array.sort (<anonymous>)

    at C3.RenderCell._EnsureSorted (c3runtime.js:154)

    at C3.RenderCell.Dump (c3runtime.js:154)

    at C3.RenderGrid.QueryRange (c3runtime.js:157)

    at C3.Layer._GetRenderCellInstancesToDraw (c3runtime.js:160)

    at C3.Layer._DrawInstances_RenderCells (c3runtime.js:160)

    at C3.Layer.Draw (c3runtime.js:160)

    at C3.Layout.Draw (c3runtime.js:163)

    at C3.Runtime.Render (c3runtime.js:445)

    at C3.Runtime.Tick (c3runtime.js:445)

    Any ideas on that?

  • It's a bug. Please file it following all the guidelines if you can so we can fix it.

  • I have a similar problem, too (it's freeze on android / apk). But i don't get any error message. Its hard to isolate the bug..

    For me, it comes when i have many textures/sprites in the game and load the layout like this : layout "mainscreen" -> layout "loading screen" (simple ajax call) (loading-screen Freeze without error message!) -> layout "game"

    EDIT: its only on android apk!

  • I would try disabling big chunks of code and try to find the exact event that's causing this error. I vaguely remember seeing this error before (edit: found it), I think it had something to do with layers, z-sorting..

  • If you don't get the same error, it's probably a completely different problem which would need to be tracked separately.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ahh I had a bug like this a while ago. It happened at complete random, so I couldn't file a bug report because I had no idea what was causing it

    I still don't know exactly what it was, but it went away when I removed some code that automatically disabled groups when related objects were all destroyed

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