Game Development Community

(Resolved) Is there better way to save ram on Animation?

by Eliezer Cardona · in iTorque 2D · 02/16/2012 (7:34 am) · 4 replies

I have use source rect for regular sprite and saw performance. I am using animation in the game and have put it to be smaller. So Now I have animation sheet size 512x1024. When in a cell it 256x256 for the animation I have optimised on for this. When I put my animation in the scene I waste about 3 1/2 mb on one animation. I have and animation sheet of 1024x1024. I have calculated that I will use 70mb from my 512x1024 and waste 20mb on my 1024x1024. So in total I have wasted 110mb when I have everything loaded in the level. Is there some method to save some more ram on the animation. I can't make it smaller because I would loose quality on my player. Does anyone know of any methods? I tested in my ipod touch 4gen and it work but there must be a way to save more ram. Thank for any one that helps me.

#1
02/16/2012 (8:24 am)
I think PVR images is the way to go with large animations. To my knowledge a PVR image only uses as much memory as they are big in filesize. A 2048x2048 PVR image takes up 2.1 MB for me.
#2
02/16/2012 (8:33 am)
Hi Simon I did try to use PVR in the animation but the problem I found is that when I play my animation all I got is a white space in the screen. I also notice in the preview screen when I convert in the preview screen there is some blurriness in the player or any image I convert. Is there something I can do to keep same quality and also to play it in the game. Like I said i Just get a black section where the animation is.
#3
02/17/2012 (12:57 am)
Yes, PVR images does degrade the quality of the image, but if you need the memory savings it provides I say it's worth it. The actual PVR-images can only be seen when playing on an device or the simulator, but never in the torque editor. So I keep a png-version with the same name located in the same folder as the pvr-image. iTorque automatically chooses the pvr-image when playing on the device and automatically chooses the png-image when using the editor. When putting toghether the final release build of the game I will then remove then png-versions, to reduce the size of the build, but until then I keep the pngs.

Also you might need to change the "optimised" setting for each datablock from "0" to "1". Check your levelName_datablocks.cs file and you will find a "optimised" line for each datablock in there. Make sure it is set to "1" for each datablock that you want to use a pvr image with.

Let me know if it works.
#4
02/17/2012 (7:39 am)
I Simon I did what you told me I did see better performance. With PVR I may only be able to use this only In big object. I saw it did mess up a little my sprite But only so much. Can this be use also be use on animation? I try it didn't go to well. Or this can only be used in sprites only. I see that when I downloaded the GUItexttool from IMG website there it says photoshop. Is that a plug in for window or mac do you know