Monday, October 6, 2014
Start Animations and Memory Management in Construct 2
Things are slowing down and I've been able to add some more animation to my Superhero Game. Namely, the the top half of the "start" animations in flight. Granted, I was really just using the full "start" animation from flying to the right or left. The cape fully extends so I can just pull out a few frames and it works pretty good. The animations for flying down will be trickier because I'll actually have to hand draw the cape flapping upwards and over the head. I ran into a little trouble with overlapping animations stuttering, but got that ironed out quick.
My newest consideration is the memory management in the game. I've noticed that the download size (only 4 megs) is a far stretch from the memory used (118 megs). I couldn't figure it out until today when Scirra posted about memory management. Turns out, it doesn't matter how much memory your image file uses, the file gets converted to a 32 bit format that needs 4kb for every pixel when the game is started. So even though a single frame of my animation is only about 3.7kb as a PNG file, it doesn't matter because the file is converted. My player animation has at least 200 frames already. The images are cropped, but start at 160 x 160px. So that's a lot.
We'll see how drastically this affects me the in the future. I might need to get smarter about my memory use.