1

I'm a 17 year old trying to start developing some android games. I've used LibGDX once before and found it a pretty effective tool, so I'm using it again now.

The game I'm making is a choice based, interactive game where you make a choice and then the next scenario happens based on your choice, and it goes on and on until your character dies or you win. I'm expected to have around 200 scenarios by the time I'm done, and currently have around 160.

The problem I'm having is that each of these scenarios is basically a "card," with a picture, scenario description and 2 options below it. Each of these images is pretty big, and if I scale the card images down they start looking pixelated on the phone screen. I'm worried that in just images, my game will reach 100mb, and then with sound effects and everything else it might be like 200mb. This seems pretty inefficient and I don't want potential players to shy away from the game just because of it's size, if they don't have enough room on their phone...

Am I doing something wrong? I apologize for this inexperienced question, I'm really new to Android development.

aglassman
  • 2,643
  • 1
  • 17
  • 30
Uzair
  • 21
  • 1
  • 1
    Depending on the detail of your images, you could consider using svg graphics which support multiple densities. Look here: https://developer.android.com/studio/write/vector-asset-studio.html. Not sure it will be the right choice for your issue but is something to consider when using large amounts of images in an app to reduce size. – CodexNZ Aug 15 '17 at 22:14
  • 1
    I think you're overestimating how much space audio will take up. If your images are photographic, you can store them as jpg format with some compression to get some huge space savings. Jpg looks bad for images that have thin lines, like drawings. In that case, maybe you could host your images online, and only download the ones you need when a scenario begins. Or just put the second half of them online to be downloaded when the player reaches that far (in which case they must like the game and probably won't mind a second download). – Tenfour04 Aug 16 '17 at 00:18

2 Answers2

0

That isn't too big for modern games but you will need to not include the assets in the apk and either download that when needed or use what Google already thought of for this problem.

https://developer.android.com/google/play/expansion-files.html

draksia
  • 2,371
  • 2
  • 20
  • 25
0

These are some steps that can help you reduce your apk size:

  1. Use only specific drawable
    Add only specific image size for each drawable directory for drawable-mdpi, drawable-xhdpi, drawable-xxhdpi, etc. You can try removing a drawable directory that could potentially unused by the user, like drawable-mdpi and drawable-xhdpi, and use only the hi-res one like drawable-xxhdpi. Or, you can try using only drawable directory for all the images, so your app will only use one image for all devices type.

  2. Resize your images

  3. Compress your images
    If your images are PNG files, You can compress the images without a noticeable change using pngquant. In fact, it can reduce your images sizes significantly (often as much as 70%) and preserves full alpha transparency. Or you can try using pngcrush (I'm rarely using this)

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
  • Hmm if you don't mind can you clarify what you mean by compressing the images? So I compress the PNG Image and put it in my assets folder for my game, and then how do decompress? Is there a way to do it automatically? Thanks so much! – Uzair Aug 16 '17 at 04:08
  • you can use the pngquant utility, install it in your OS. Then you can use it in your command line with something like `pngquant yourimage.png` . There is no automatic way, but you can call it with `pngquant *.png` in your images folder. – ישו אוהב אותך Aug 16 '17 at 04:14
  • You can also create a zip file of all your images and extract them as needed. See this answer: https://stackoverflow.com/a/15629798/2979092 – WLGfx Aug 16 '17 at 09:50