Members - Reputation: 103
Posted 15 June 2012 - 07:22 PM
I have several HD sprite sheets (512 by 512 frames) in a 4096 x 4096 sprite sheet, and I'm having a real heck of a time regarding memory, loading in even one of them to use. The game I am making itself runs at about 16,000 memory usage, according to Windows Task Manager. Loading in one single Character sprite sheet pushes the memory usage of the program to 100K+ memory usage.
I'm aware the size of these is utterly ridiculous but I want to keep things HD, without taking up a whole lot of memory. Are there any techniques anyone here can suggest that'll help me keep the overall quality of the image, but reduce it's impact on memory.
Members - Reputation: 957
Posted 15 June 2012 - 10:26 PM
But yeah, this situation you describe is pretty much the reason why I refuse to use sprites in HD, especially since increasing the screen resolution can easily make their texels big enough to cover over a pixel (with very low resolutions you can at least give an excuse to not provide more detail since it's so low you could argue it's the art style and not just a technical limitation).
You could try splitting them into smaller sprites and combine them when drawing the objects (i.e. make objects out of multiple sprites instead of one). This also has the advantage of potentially being able to get smoother animation out of less sprites, albeit it's hard to do it without it looking robotic (some serious effort will be needed). Alternatively, switching to 2D vector graphics (with texturing, etc.) takes up much less memory as well, and scales up regardless of resolution too. Requires a completely different skillset for the artist, though.
If texture compression doesn't do for you then you'll have to look into alternatives like those two.
Members - Reputation: 1589
Posted 16 June 2012 - 04:20 AM
Another potential way to optimize animations is to subdivide them down into multiple sprites to avoid having to store full animation frames for parts that don't change. E.g. a sprite of a building with a flashing neon sign "Open" could only store the rectangle around the Open sign in the animations, and not the full building, if the other parts of the building sprite don't animate.
Members - Reputation: 957
Posted 16 June 2012 - 10:34 AM
Members - Reputation: 1238
Posted 18 June 2012 - 09:26 AM
In general, you could assemble your sprites from an arbitrary number of pieces that are shared within the same frame and across different animation frames; they don't even need to match a regular tile grid, and you can also assemble semi-transparent pieces on top of each other.
Another potential way to optimize animations is to subdivide them down into multiple sprites to avoid having to store full animation frames for parts that don't change.
An ideal job for an automated search, but you should take care to avoid using too many colours.