Hello! I need some help from someone who maybe had to deal with something similar before and found a good way to achieve this. I can’t give specifics since I signed an NDA, but artists being artists, I was given about 9 different spritesheets, each one with a 60 FPS animation, with each frame being around 2,060 x 2,200 pixels in size, and a SINGLE spritesheet being 13,600 x 12,600 in total… what would be the best way to show and play these animations during the game, if said game will run in a browser with the compatibility mode? Luckily only ONE of these will be shown to the player at any given time, but that still means somehow loading and playing back that huge spritesheet at 60 frames a second.
Also small edit: The spritesheets all have an alpha channel, and that’s required.
Near 4K full-screen 2d animations are going to be very expensive for bandwidth, you may have a better time streaming video. Are you sure you can’t reduce that frame size dramatically? Seems like a wild target sprite size.
Godot doesn’t support texture streaming at the moment, don’t think it would do you much good but that’s the best I could think of. Do you have threads enabled on web? Maybe you could use the load_threaded_request function if so, but I know enabling threads on web significantly reduces the platforms your game can run on.
The assets will be inside the game for the most part luckily, but I’m not sure if just using a simple Sprite2D with an animation player will be enough for this one. I’ll give it a try as soon as I have the actual files, but something tells me it’ll just make most browsers slow down to a crawl, especially on older hardware.
Streaming in this context is still totally local, smoothly streaming from disk into memory becomes a challenge with larger files. A simple Sprite2D with the attached texture will pause as the texture loads, and every time a new texture is loaded. If Godot implemented texture streaming, depending on how it’s implemented, you could show some frames of animation before the others are loaded; depending on how the asset is set up. It would become a question of how fast the disk/web storage can load a portion of the animation instead of loading the entire thing.
Another technique used for 3D textures, first loading quick lower-resolution textures while the high res 4K dirt/metal/wood loads in the background and replaces the low resolutions. But this means more textures for your game, and I’m not sure 60FPS animations will load quick enough before they are over, so only the low resolution will play; following that logical thread it may be best to just lower the resolution, or accept a really big loading screen.
Both these techniques would require threads. The former is purely theoretical in Godot, you would have to implement your own image decompressing/streaming algorithm.
You’ll need to split those big textures somehow as their sizes may not be supported on certain devices. Ideally to something like 2048x2048 so they are supported on pretty much any device (specially if the game is going to be on the web) but your frames are bigger so I’d say 4096x4096 at maximum. 3D rendering limitations — Godot Engine (stable) documentation in English
You could probably import them as VRAM compressed they may lose quality but you’ll save on VRAM. The 13kx12k texture in memory uncompressed is ~685mb that by 9 is like 6gb so… Here’s a table with the different advantages and disadvantages of each compression format Importing images — Godot Engine (stable) documentation in English.
Try and see if it’s possible to play them at a lower framerate like 30fps and try to remove identical frames.
How are the animations authored? Could they be converted to smaller animations and composited in game? We had a similar issue with Dicey Dungeons (not a Godot game) and the animations were authored with After Effects. I used Lottie to export the animations as JSON and wrote an importer that played those files (it was a pain in the butt ) It didn’t support everything so I asked the artist to only use certain effects.