- Atlast image (Using texture packer you did)
- Commenting physics engine, particles, 3D libraries(I think not of any use as during release build, they’re automatically removed. @slackmoehrle Can you please confirm? )
This one is Android specific: (I don’t know what do we do for iOS)
3. Try, building only for 1 arch at a time… eg- armeabi-v7a only and not armeabi or x86 mixed.
It nearly doubles(if used 2) and triples(if used all 3 arch) the size of the final build(debug build atleast).
I am not sure if you should build for mips arch. I think that’s already commented in your code.
Check on play store, if you can put app based on architecture of device downloading it.
4. In my currently being developed game, I’m having 3 assets folder. Where I am planning to deploy, HD graphics version app separately. Note “planning”. I’ll check the final build size though once the game is completed. If it won’t be more than 5MB extra, I think I would be fine to include all 3 in one.
5. For every resolution, I’m using higher end graphics for crisper look. For example,
for res. 480-960px(consider only width wise as an example), I am using graphic of 960px, for res. 960-1280px, I am using 1280px. All games doesn’t need to have crisp looking graphics. Then pack, <960px for 480-960px, and so on…
6. Use code to draw rectangles wherever possible instead of using sprites. Using 9scale sprite helped me a lot as my game have a lot of similar looking sprites.
I’ve not published any app. May be more experienced guy can help.
I requested this topic earlier(reducing release build size), if could be listed in Programmer’s guide. May be whatever people will list here, good things can be shifted to PG by @slackmoehrle
Read the last 2 sections.
http://www.cocos2d-x.org/docs/programmers-guide/advanced_topics/index.html
Hey @slackmoehrle
Can you please, tell how to ensure which is mentioned in Golden Rules section
We should use batch draw as much as possible. Cocos2d-x 3.x has auto batch support, but it needs some effort to make it work.
The link give in PG has
Which talks about polygon trimming.
This thing can be easily achieve using SpritePolygon
. And it will automatically give you polygon shape of sprite instead of rectangular once. [May be you don’t wish to purchase Texture packer.]
Over optimisation is not good. For example, my game has over 85% of rectangular kind of sprites. So, for me using this would be unnecessary.