0
\$\begingroup\$

I am developing a simple 2D game. I have multiple sprites. Each sprite has around 80 png/frames of 265* 256. I used LibGdx's Texture packer to package the atlas. Am enabling mimap using following code to pac

    TexturePacker.Settings settings = new TexturePacker.Settings();
    settings.combineSubdirectories = true;
    settings.filterMin = Texture.TextureFilter.MipMapNearestLinear;
    settings.filterMag = Texture.TextureFilter.Linear;

    TexturePacker.process(settings, f.getPath(), outputFolderName, atlasFileName);

Questions:

  1. Are 80 images/frames for single sprite too much?
  2. Is 0.5 GB memory usage too much for a simple game like Fruit ninja?
  3. How can i reduce my memory usage?
  4. Any other things i should try?
\$\endgroup\$
6
  • \$\begingroup\$ You are aware the fruits in Fruit Ninja are 3D, right? \$\endgroup\$ – Theraot Mar 31 '20 at 18:22
  • \$\begingroup\$ dint know that. Good to know. But irrespective of of that 0.5 gb memory for simple 2d game looks too much for me. \$\endgroup\$ – user93796 Mar 31 '20 at 19:18
  • \$\begingroup\$ 256 x 256 x 80 at 4 bytes per pixel is 21 MB, or one twenty-fifth of 0.5 GB. A Samsung Galaxy S5 from 2014 has 2GB of memory, so if you were targeting that 0.5 GB might be a bit much. Note that you can load and unload data from the hard drive into or out of memory, which is how AAA games can use 40 GB on your hard drive while playing smoothly on a computer with an 8 GB memory card. \$\endgroup\$ – Foxwarrior Mar 31 '20 at 21:15
  • \$\begingroup\$ Your calculation is correct. But i have around 25 sprites. So 25* 20 MB around 0.5 GB. Am trying if am doing something wrong. Like 80 images for sprite is too much?? \$\endgroup\$ – user93796 Apr 1 '20 at 1:49
  • \$\begingroup\$ 256x256 may also be too much - you could reduce to 128x128 which would quarter your memory requirement. \$\endgroup\$ – Maximus Minimus Apr 1 '20 at 2:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.