Loader getting stuck regularly on 99%

Hi Everyone,

I’m almost done with my first ever game in Phaser, but am running in to an issue where my loading screen crashes, usually around the 99% complete mark. Sometimes it works fine or sometimes completes after a few minutes.

I am loading a lot of images/video and audio for a point and click style adventure game - around 300MB - is this simply too much data to be loading or is there something else going on here?

If there’s anything I can try or if anyone has any ideas about how to debug this further I’d be hugely grateful!

David

:wave:

Try one of the plugins in phaser-plugin-loader (Logger or Text) to see what’s happening.

Thankyou! I’ll give this a try.

I’m finding the issues happen after I’ve refreshed the page a few times. Almost like it runs out of memory . It will work the first 5 times and then fail. Is it possible the game object caches are not being reset on a page refresh. Is there a way to force them to reset?

This plugin is excellent - thank you @samme!

When the game hangs it is always on a video file that remains pending and never starts loading. So that’s the issue.

Closing the browser tab and reloading often seems to fix it.

Any suggestions welcome - I could just ditch the fancy ending video I guess . . .

Thanks for all these.

So it seems like sadly this is a known bug - I’m unfortunately not skilled enough to dig in further. Is there any difference between. using this.load.video and calling the videoUrl function? What is the function actually doing the loading? I wondered if I could add some debug lines to see where it gets stuck.

Research today suggests that webm format loads a lot more consistently than mp4 - but that rules out playing the game on iOS which is a shame.

I did start looking in to turning the videos in to pngs frame by frame and creating animations, if there’s anything else I can investigate or try before doing all that I’d be really keen to do so and its quite a daunting task!

You can try changing the loadEvent argument in load.video() to 'canplay' or 'canplaythrough' (that would take longer though).

Sadly that doesn’t seem to make the videos load consistently.

I’ve done some digging - they’re getting stuck in the inflight set and never making it to queue. So I’m wondering if I could some how make the files start reloading if they fail for whatever reason? Does that seems like a good approach? Looking at the stuck objects in the queue, they don’t start loading at all and just sit there.

If they’re stuck in inflight (loading) then the loadEvent hasn’t been received, I guess. If they’re stuck in queue (processing) I’m not sure what’s going on. :slight_smile:

What do you see in the browser’s network pane? In Safari I think I would see 2 partial content requests that appeared complete.