Godot Version
v4.6.2.stable.mono.official [71f334935]
Question
This post is more of a “I need some advice on how to do a certain thing”.
I’m currently working on a mobile game that will have to run on both Android and iOS devices, and needs to be finished within a few weeks.
Without going into too much details, since most of it is under NDA, I’m faced with a challenge that I’m not entirely sure how to approach.
The game has 3 “areas”, and each area contains a massive background animation which the player can / is encouraged to explore by “pinch to zoom” and “dragging” the camera around, and each area also has 3 different stages of animation.
Now, the main challenge is that when I got ONE stage of ONE animation, I noticed that it contains a total of 239 Frames, and a single frame is 4,000 x 8,889 in resolution, and around 32MB in size. (It should run at 60 FPS so this one animation is roughly 4 to 5 seconds long)
Obviously, there’s no way I can just display this as a single Sprite2D and animate it on even most modern phones without issues, and on older phones I already confirmed that it will just refuse to load the texture into video memory.
Now I’m trying to figure out how to best approach this problem.
Here are the few ideas I had, but why I think they might not work:
Idea 1:
Instead of using PNG sequences, I’d try and convert the entire PNG sequence into a video file, and try to play that back. The issue with this approach is that I’d still like to keep the quality nice, especially when the player zoomed in. Another issue is that as far as I know, Godot can only do software playback, it cannot use hardware acceleration for videos at all.
Idea 2:
I’d try to take each PNG into smaller pieces, and have several small Sprite2Ds that I would have to keep in sync and update their frames multiple times each second. The problem with this approach is that I really don’t think this would be efficient. And I also can’t see how older devices would be able to decode PNG files fast enough. Even if I tried to implement a streaming solution where I replace the art with higher resolution versions as the player zooms in more, I don’t see it being fast enough.
All in all, I’d like to find a balance between efficiency and still keeping a high resolution version of the artwork for players to look at, even on older devides. (even if it means on older hardware, I’d have to pause the animation entirely). But I’m not even sure how to get started with this.
Thank you for any tips in advance!