PIXI.js 7 + Webpack - Seems to give up loading Game Manifests

139 views Asked by At

I'm working on something for my job so any examples of what exactly I am doing will be difficult as I can't just point to the repo for security reasons but I will do my best if required.

My issue is that PIXI's Asset Class just appears to give up if I give it too many bundles to load at once. I load the bundle manifest as data (using the .init function and then telling it to background load all the assets) and it seems to find and load the images just fine but then the process never ends.

I load all my manifests and initiate but I need to stagger the assets so that those used for a 'loading screen' get pulled in first. So, that manifest is loaded, displayed to screen and then we load the rest of the game assets, hopefully with the Loading screen showing the progress.

The issue is that it's simply seeming to stop. The loadBundle promise seems to never resolve itself. I'm not starting the game until the loading is done so I need the promise to resolve so we can continue with the game's assets. There's no error, it doesn't appear to resolve or reject or give any response. It simply vanishes into the aether never to complete.

There are around 14 bundles with about 110 atlases of various sizes I'm asking PIXI to load here. This seems odd when the old loader could handle this just fine. I'm not certain what I'm doing wrong.

  • Running PIXI.js version 7.3.2 and bundling the game through Webpack. I am using custom libraries that contain the in-house engine that drives the majority of the game. As far as I can tell, I am supplying the assets correctly as they appear in the Network tab on Chrome, Firefox and Edge.

  • Using Texture Packer to create texture atlases that I read in via their .json files. Texture Packer is set to PIXI.js mode.

  • Trying to load all 14 bundles causes the Asset class to just load forever, coming to a halt after finding all the assets and loading them into the cache. It seems like it gets stuck on something, no longer calling the progress callback.

  • Trying to reduce the number of items in a bundle to 3 per bundle doesn't help

  • Reducing the number of assets loaded in to just 5 items of various sizes in 1 bundle does help and will complete. No idea why. Am I overloading my laptop?

Are there limits or performance tweaks I should be making to get round this? Has anyone observed this behaviour before?

Thanks for any help.

1

There are 1 answers

0
Tyro Kitsune On BEST ANSWER

Fixed it. Turns out that PIXI.js does allow for Multipacking and I had missed that until recently. According to the Texture Packer docs, which I didn't realise contained this information, it not only supports it but expects you to only load in the first asset manifest as it then looks for and finds the rest. If you do load in everything else, it appears to slow to an absolute crawl, causing this loading issue.