typescriptwebpackpixi.jstexturepacker

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


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.

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

Thanks for any help.


Solution

  • 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.