Facebook Instant Gaming - 6 Megabyte Limit & Babylon

Hello!

I’m seeing online that Facebook specifically mentions compatibility with Babylon for its instant gaming platform. However, they have a 6 megabyte limit on initial data. Babylon.js is as a text file 6 megabytes alone…so how is this possible?

Any ideas / advice? Is there a way to possibly only load specific subsections of the library / framework? How would one go about filtering the code to only be what they need?

I assume this is solved / possible because facebook specifically mentions compatibility.

Thanks!

Hi @Nicolas_Bulgarides and welcome to the community!

You can use ES6 packages and tree shaking, along with a JS minimiser and you should be able to get the built Babylon code down to something manageable, leaving more space for models, textures and sounds.

https://doc.babylonjs.com/setup/frameworkPackages/es6Support

Thank you so much!

1 Like