So I recently got an android phone for the first time and one thing I’ve always been interested in being a learning developer is how I would optimise a game I made for a mobile phone. Now that I’ve looked into a it a bit more I’m surprised by how easy the programming generally seems to be ( Good job Unity, points for you again ) as the interaction revolves around just putting in programmable buttons. However one particular issue that seems to stand out is file size and I wonder if this is a problem for anybody else?
I’m primarily developing games for the PC, however I might dabble a bit in mobile gaming just as an experiment but since I develop my games for the PC originally I’ve realised looking at all of this just how much you will have to downsize your game and nerf it for a mobile version if you’re porting over from the PC.
It seems to me the best way to deal with this would be to only import needed assets over and start off from scratch on the specific platform and make sure the code and size of everything is optimised as possible instead of just simply importing a few levels and hoping that does the job.
File size is mainly textures and models. The lower the quality of your textures, the smaller the file.
I wouldn’t say you need to start from scratch. Just try to get rid of unnecessary Update functions and look in the Profiler what’s eating resources. Try to bake as much lighting as possible, and use occlusion culling to render less of the scene.
Well it’s only sprites, so I don’t have to worry about lighting thankfully, but thanks, at least I know what to look for now, the game I’m thinking of trying an android port for is around 300mb which is obviously way too big for an android phone and I think it’s just because I have 20 or so levels ready to go on that game.
I may unfortunately need to do a stripped down version of it if I want it ported decently which Is why I’m thinking if I’m going to do an android game I may as well make one specifically for android rather than just doing a lazy port.
Will just add sound clips and music files play a big factor as well. Make sure your music loops are as small as possible. Also quality/compression can play a big factor in the size.
Thanks, I guess the thing to do is to do what I did with the platformer on PC and see what a standard sort of size for an android game of what I’m thinking is and match it to that, that would seem sensible.
Well you mentioned it’s mostly sprites, so probably most of the size-diminishing will be reducing resolution of the sprites and tiling them. You can look in the Build log to see exactly what is taking so much space.