- Home /
Question encourages long discussion. Question answered and unattended
Is there a better way of using 2D PNG Sequence Animations?
I have been making a game with the same idea of using 2D monsters as like in Pokemon, however the monsters are made in flash and exported as a png sequence. This however has run the project high in space. The meta folder is insane with gigs. Is there a better way of doing this?
Also this runs up the ram while Unity is running and i can no longer use my desktop as it constantly crashes.
Thanks, Brandon
How are you displaying your monsters? Are you using an atlas to store images, or are you using the individual frames?
There may be something on the asset store that will play flash animations for you. A png for each frame is going to be massive, if the frames have any detail to them (one reason Pokemon's are so simple)
Another trick you could use to lower the filesize (to 25% or so maybe) is limiting the colors. I'm guessing you already tried compressing the textures?
However, finding something that will play flash-style animations will have a much bigger effect on memory usage (down to ~5% or so). I know SpriteStudio does this, but I don't know if theres an English version.
As for unity loading too much, you might want to consider breaking things down into asset bundles, which you can load asynchronously as need and unload when done with them (SpriteStudio I know does this for you automatically).
Answer by whydoidoit · Mar 19, 2013 at 05:55 AM
If your PNGs are not a power of 2 size and you are not using an atlas (and you are not using Unity 4.1) they will be a total memory hog. Use NGUI/2D Toolkit/Othello etc to draw atlased sprites and you'll find a massive performance improvement and a lower memory footprint.
Be aware that a PNG file is a compressed file on disk - when it is loaded it turns into an uncompressed set of bytes in memory (probably 4 * number of pixels). Worse than that, if it isn't a power of 2 size (NPOT) then it eats lots of buffers as Unity tries to fix it so that it is (unless you are using 4.1).
You can have then tiniest PNG or JPEG eat many MB of memory due to this effect.