I was wondering if spritesheets are worth it. I am making a game with pixi.js and was thinking about optimization, beginning with asset loading. I currently have an arraya of all files and use PIXI.loader, but I know this is not good because it will make a web request for all files which takes long, so I should figure out a way to load them in one web request. The first thing I thought of was a spritesheet but then I thought "what if I just zipped everything and loaded it with something like JSZip?" I knew it was possible already (from this project that loads pixi textures from a zip) and listed what I think are potentials good and bad things:
Zip good points:
- Compression meaning faster loading of assets
- Compression meaning smaller build size when making a build with electron
Zip bad points:
- Requires loading a separate library meaning increased loading time and using more RAM
- Requires decompressing in-memory meaning increased loading time
Spritesheet good points:
- Doesn't has the headers of all individual image files
- Is much used so it is a proven technique
Spritesheet bad points:
- No compression (or at least not comparable to zipping)
- More than one network call due to phone limitations preventing sometimes files over 2024x2024px making it necessary to split spritesheets
- Empty holes as all images are not the same size and there is almost always a bit of space left in the spritesheet, meaning useless pixels that are still transfered over the network
I am not a very experienced developper, so I have a few questions:
- Did I miss a point above?
- Are spritesheets generally worth it?
- Which technique of both is more worth it? I could do both but I want to focus on one first and leave the other in a nice to have list.