0
votes

Background

Hello everybody, I am a beginner in Unity and I am planning on building a small mobile game. Because size is such a critical factor in small hand held devices, I have searched for ways to reduce the resulting APK/IPA file.

One solution I have encountered is to use proprietary compression algorithms by providers like https://kraken.io/.

I was wondering if it was possible to replace Unity's built-in image compression solution with API calls to https://kraken.io/

enter image description here

Question

Is it possible to write custom build scripts that loop over the resulting build and replace the respective image files with the ones outputted by kraken?

Could anyone point me in the right direction on how one would achieve this? Any suggestions or help will be much appreciated.

1

1 Answers

1
votes

You can reduce the disk space by enabling Use Crunch Compression on your textures. This will behave similarly to what Kraken does. One limitation is that textures must be power of 2.

Warning message

Here's a screenshot of a texture from Kraken with similar results when it comes to file size.

Chunch Time

Note that the pixel counts is lower in Unity due to PoT conversion.

Although file size is important, there are other aspects to keep in mind when building your game: keeping draw calls down by using automatic or manual batching and loading assets on demand.

Addressable Assets is a way to externalize and manage game assets to handle dependencies for on-demand loading and content updates.

For batching, it depends on the type of game you are creating. For 2D you can use sprite atlassing. Also Texture Packer is a good solution I have used in the past.

hth.