How to dynamically load png for Spine 2D?

Hello everyone! I finally got around to the topic of project optimization and came across an interesting point that I don’t know how to solve yet.

My personal project, which I wrote about here, is a visual novel with a lot of backgrounds animated in Spine 2D. Now they are all downloaded from the server as resources and weigh quite a lot, one episode is 50 to 70 mb, which players with slow internet complain about. :pensive:

To reduce the weight of the downloaded content, I wanted to upload all the art as png files and add it to the atlas dynamically. As far as I know, it is now possible to create an atlas dynamically, as well as modify an existing atlas. And all this would work fine if my backgrounds were just sprites.

For the Spine scene, it is imperative to specify an atlas with images involved in the animation. The idea of loading 1px images into the atlas and then replacing them with normal images didn’t work because you can’t change the size of the atlas at runtime.

Dynamic creation of spine models and scenes is also impossible as far as I know.

Art in png weighs 2-3 times less and would be an ideal solution, but how to add it to Spine I have no idea.

That’s why I would like to ask for help and advice from the Defold community :pray:

How can I optimize the size of the uploaded content in my case study?

Any help or advice would be greatly appreciated :slightly_smiling_face:

This is using the Live Update feature? And with texture compression enabled?

Correct this is possible. But it is currently not possible to replace the atlas used by a spine model. We do have a concept of skins though but I don’t think it helps in your case either.

Yes, using Live Update I download resources for a proxy that contains 10-12 Spine models. Each Spine model contains an atlas of size from 2048x2048 to 4096x4096.

Texture compression is enabled when building the project, here are my texture_profiles:

Webp is no longer supported and I’m not really sure what it is falling back to. @AGulev did a cleanup recently of values which will be available in 1.7.0:

I’m not sure what happens if you chose Webp. It may use a valid value or it may not compress at all. What does a build report show you (feel free to share it here)?

1 Like

I’m using version 1.6.2 in production, but I’m going to upgrade to the latest version. What is the best compression type instead of Webp for ios/android platforms?

Here is my build report on ios:
build_report.zip (605.7 KB)

I built a project with different types of compression and here are the results:
Webp - 428 MB
Basis uastc - 296 MB
Basis etc1s - 161 MB

I don’t remember why I chose webp at the beginning of the project development :pensive:

I read in this forum thread that etc1s is no longer relevant, will it also be removed or did I misunderstand?

The compression size with etc1s is impressive!

1 Like