Load the .pck file in the background of the game at runtime

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Isccb

Hi, I need to export my project to HTML5, but when I export, the .pck file becomes very large, which means that it takes a long time to load when integrated into a website.

Is there any way to split the .pck file and load the parts in the background of the game at runtime?


I also tried to export the scenes separately, getting several HTML pages and several small .pck files, but then I don’t know how to connect them again at runtime. In this case it would also be necessary to load the several .pck on the background during the execution of the game. Is there any way to reconnect the scenes when they are in different exports and load the various .pck runtimes?

Thank you

:bust_in_silhouette: Reply From: Calinou

You can load PCK files at run-time using ProjectSettings.load_resource_pack(), but I don’t think this can be integrated into an HTML5 build that would download a PCK file at runtime. See Exporting packs, patches, and mods for more information.

To make PCK loading faster, you can configure the web server to compress PCK files using gzip or Brotli on-the-fly (just like the .wasm file).