Here are some methods you can use to reduce the size of sound files. If you don't consider the format of the sound file, whether it is in terms of memory usage or the size of the program, it is a great waste.
Of course, after removing resources, you must fully test your game. Therefore, you need to pay extra attention to remove them from the project, at least from the target of the program.Įspecially when you use multiple targets (for example, you maintain both ipad and mac versions), you will most likely add some wrong resources to a target. Therefore, you may forget to remove some unused image resources for some reasons. In the process of developing games, you will often add, remove, and replace game resources. When the build is successful, Xcode's Organizer window will open, and then you will see an "Estimate Size" button, which can be used to estimate your application size:
In Xcode, run Archive build (select Product-> Archive in the menu). Because, you may use some png images that have not been optimized by TP.Ĭheck the size of your program in the App Store Therefore, make sure that this option is turned off again!īut even if you do not disable this option, your program size will be reduced. Therefore, it is possible that the png image that we have previously optimized using TP will be expanded again. If this png compression option is activated, xcode will run its own png optimization program when the png file is packaged into the program. You can set it in xcode's build settings as follows: You need to turn off the "Compress PNG files" switch, because this option may cause your png images to expand. Note that there is a setting in xcode that you may ignore. Perhaps the amount of reduction of a single file is not very much, but when the total size of your png image is 18MB, it can be reduced to 16MB. The smaller texture was reduced from 180kb to 130kb. My largest png image was reduced from 2.4MB to 2.2MB. The question is, how much file size can it reduce? Of course, you only need to take advantage of this optimization feature when you actually release the application. Since the optimization process uses a multi-threaded approach, if you have a machine with four cores, the speed should be faster. For a 27-inch iMac released in 2009, it takes 10-20 hours to process a slightly larger texture. However, it has a disadvantage that it is very time-consuming. If you have some reasons to insist on using the PNG file format instead of the pvr.ccz file format I strongly recommended to you, then TexturePacker has an option called "Png Opt Level" (Png optimization level) that can help We reduce the size of the png file (note: this does not affect the image loading time)įrom my current understanding, the largest optimization level can produce the smallest file size. However, we have other ways to further reduce the size of the program. Reducing the color bit depth of the texture to 16 bits can not only reduce memory pressure, but also effectively reduce the size of the program.
The full text is as follows: Reduce the size of your program
This article is a continuation of the previous blog post and aims to teach you how to reduce the size of the cocos2d program. Foreword: Judging from the Weibo response of the tutorial released last week, cocos2ders are still very concerned about the memory problem of the game.