UE4 Reducing APK Package size
来源:互联网 发布:博威软件 编辑:程序博客网 时间:2024/04/29 03:51
No matter what type of Android device your UE4 project is targeting reducing the size of the Android application package or APK to be under the 50MB limit for the Google Play store can be challenging. In the following tutorial we will cover steps you can take to help reduce your projects final APK package size to be as small as possible using nothing but the tools provided to you in the UE4 Editor.
ETC1 Texture Considerations
When packing your project for Android using the ETC1 Texture format you need to be aware that ETC1 will not compress Textures that have embedded Alpha information in them and instead treat them as fully uncompressed Textures. While this will not greatly affect your projects run time performance, it will increase the size of your projects APK. If your project does require Textures that use Alpha's it is better to use two separate Textures, one for the Diffuse and one for the Alpha, instead of a single Texture with the Alpha embedded inside of it as this will ensure that the Textures will be compressed when your project is cooked and packaged.
Creating a new empty project
When you first start working on your Android based mobile project you might be tempted to use an existing project as a base to work from or create a new project that has the Starter Content enabled. DO NOT do this and instead create a completely new, empty C++ or Blueprint based project and then use the Migration Tool to bring over the content that you want to use. This way you ensure that the only content in your project is content that you need to be there.
Compressing Cooked Content
The easiest and quickest way to reduce your APK package size is to tell UE4 to compress the APK packages during the packing process. To turn on package compression you need to do the following in the UE4 Editor.
First open up the projects settings by going to the Main Toolbar and selecting the Edit option then selecting Project Settings.
Under the Project section click on the Packaging section to show the options for how the project will be packaged.
Click on the small white triangle that is at the bottom of the Packaging settings to expose the Advanced Project settings.
Look for the option labeled Create compressed cooked packages and enable it if not already enabled.
If you have not packaged your game with the Create compressed cooked packages checkmark box enabled you should see a huge difference in size when your project is re-packaged with it enabled. In fact it is not uncommon for some projects APK packages to be reduced in size by up to 50% when create compressed cooked packages is enabled.
Setting up a Project's Levels
One overlooked area that can lead to a bloating of APK package sizes is failing to properly setup your projects options like which levels should be loaded by default or which levels should be used between level transitions. To set which level or levels should be used for this type of interaction you can do the following.
First on the Main Toolbar go to Edit > Project Settings.
Then under Project in the Maps & Modes section, set the map in the Default Maps to a map that is specific to your project.
Checking what Content will be Cooked
To ensure that only the content that is related to your project is added to your APK file, you can check which content is being added to your projects APK by looking in the Cooked folder in your project. You can find the Cooked folder by going to (ProjectName)\Saved\Cooked and then choosing the folder with the format you cooked your project for.
The image below shows the Texture folder from the Match 3 sample game. The content in the folder has been sorted by size so it is easier to see what assets are the biggest. Once the biggest assets have been established you can then examine the assets inside of UE4 to see if in fact they can be reduced in size without sacrificing the integrity of the asset.
Development VS Shipping Build Size
When trying to figure out the final size your project will be keep in mind that the Development version of your project will be slightly larger than your Shipping build size. On the Medieval Match example game the difference in size between a Development and Shipping build was around 14 percent. However since each project has different requirements, the saving between the two different builds types for your project could be more or less than a 14 percent savings.
Per-Device Texture LOD's
With the release of Unreal Engine 4.8 you can now specify which size Texture should be used on which devices. You can read more about this in the Texture Guidelines for Mobile Platforms section.
Removing Unused Content
When your project is finally ready to be packaged up for the store make sure to first remove any unused or testing content by selecting it in the Content Browser and deleting it. You can delete content by first selecting the content you want to delete and then either press the Delete key on the keyboard or use the Delete option in the Right - Click menu. When you do try and delete something from your project the Delete Assetsmenu will be displayed like in the following image.
The Delete Assets menu will inform you if the asset you are trying to delete is referenced by another asset or not. If it is not referenced you can simply delete it, however if it is referenced by other assets you can use the Replace References option to replace the reference to that asset to another asset that is supposed to be packaged in your project.
Removing Unused Plug-ins
Disabling any unused plug-in's inside of the UE4 Editor is another way to ensure that un-need content and code do not make it into your projects final APK package file. This is because some Plug-in's require a certain set of base assets and code to work correctly. If the Plug-in is not disabled the assets and code that are required to make the plug-in work will not be removed from your project. While this might not reduce your projects size as much as reducing or removing a large Texture would, every little bit can help when trying to slim your project down to the 50MB size. To disable a plug-in inside of UE4 you need to do the following.
First open up the Plug-ins Manager by going to the Main Toolbar and clicking on the Window option and then selecting the Plug-inoption.
From the Plug-in Browser select the different sections and disable any plug-in's you are not using by un-checking the check mark box next to Enabled. When you have disabled all the Plug-ins you will need to re-start the UE4 Editor and then make sure to re-package your project.
- UE4 Reducing APK Package size
- Android官方资料--Reducing OTA Size
- less-Reducing CSS Size(减少css)
- purpose of package size
- UE4-Android-APK大小
- UE4 iOS Packaged Game Size
- Android Apk size瘦身
- Android-Reduce APK Size
- 使用PACKAGE SIZE读取数据
- apk与package名对应
- OPEN CURSOR PACKAGE SIZE AND WORK AREA
- pkg: cached package *:size mismatch, cannot continue
- Redis无法启动You may fix this problem by either reducing the size of the Redis heap with the --maxheap
- About the size of APK file
- Android APK size压缩(瘦身)
- 查PACKAGE多应APK路径
- 查PACKAGE多应APK路径
- 通过apktool获取apk package name
- Linux后台传输screen
- mysql存储过程 游标 查询结果循环
- 优化数据页面(28)——不打印颜色和底纹
- 22. jQuery 遍历 - 同胞
- MFC中App,Doc,MainFrame,View各指针的互相获取
- UE4 Reducing APK Package size
- 程序员面试金典2.4:给定值x为基准将链表分割成两部分
- Handler 机制学习之Handler、Looper、MessageQueue、Message之间的关系
- table 删除某行
- FreeMarker的简单使用
- 在myeclipse中java @override 报错处理
- Javascript
- 查询ORACLE表空间或者数据文件每次扩展大小
- dojod自定义属性