Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
0

Tips for reducing the size of your build Sticky

A topic by leafo created May 28, 2023 Views: 4,383 Replies: 6
Viewing posts 1 to 7
Admin (9 edits)

If you’ve ever tried to upload a larger game to itch.io, you may have noticed that we have a default file size limit, and you need to get approval to upload larger files. Larger files bring about many costs - not only do they entail higher bandwidth and storage expenses, but they can also make your game less accessible to players due to extended download times.

Before we grant an increased upload size for your game, we ask that you share how you’ve used best practices to ensure that you’ve optimized the build and assets appropriately.

This guide includes some things to look out for. If you have any tips to add, please leave a reply below, and we’ll update the guide accordingly.

Identify and Review Largest Assets

Often, a handful of assets contribute disproportionately to the build size.

  • Identify large assets: Some game engines include a profiler tool to identify the largest assets in your build. Otherwise, use your file manager and sort by size.
  • Review usage: Check whether these large assets are vital for your game. If an asset is not essential or is used infrequently, consider removing it or replacing it with a smaller asset. For example, a model of a rock that appears in the background of a cutscene should not be larger than your main player’s model.
  • Optimize assets: If the large assets are necessary, ensure they are optimized and compressed
  • Be weary of Asset Store resources: Files obtained from Asset Stores may include substantially more details than you need. Review assets you’ve imported individually to ensure they meet your size requirements

Use Compressed Formats Always, Use “Lossy” Formats When Possible

Lossless file formats, while providing high-quality assets, can significantly increase your game’s build size. Lossy compression formats can substantially decrease the size while maintaining a high level of quality. Unless explicitly needed for your application, avoid using lossless formats.

  • Images: Use JPEG, WebP or PNG for images instead of formats like BMP. Vector image formats, like SVG, typically compress well, but ensure that they do not have too many details for the resolution they are rendered at. Ensure that you don’t have raster data embedded into vector formats that is not compressed.
    • Resolution: Avoid overly large images. Consider the resolution the image will be displayed at. For example, including an 8k backgrop image for a game that targets a 1080p resolution could be a waste of resources.
  • Audio: Formats like MP3 or Ogg Vorbis can greatly reduce file sizes compared to WAV or FLAC.
  • Video: Use codecs like H.264 or H.265 for video files. Ensure you’ve selected an appropriate bit rate or encoding quality to balance both size and visual quality.

Always balance quality and size. Over-compression can result in a poor experience due to noticeably lower quality assets.

3D projects

Optimizing Textures

  • Compression: Use compressed texture formats. For instance, DXT (DirectX Texture Compression) formats can significantly reduce file size. Keep in mind that the appropriate compression format depends on the target platform of the game.
  • Resolution: Scale down the resolution of textures, especially for mobile or web games. A high-resolution texture on a small screen doesn’t significantly improve visual quality.
  • Reuse and Recycle: Try to use texture atlases and UV mapping to make the most out of a single texture. Instead of using unique textures for each model, see if you can reuse existing textures creatively.

Reducing 3D Model Sizes

3D models can be large, especially when they are highly detailed.

  • Polygon Reduction: Use tools to reduce the polygon count of your models. Many 3D modeling tools like Blender or 3ds Max have built-in decimation tools. Consider creating LODs for highly detailed models, especially if they are rendered only in the distance.

Other Optimizations

  • Dead Code and Unused Assets: Over time, your game might accumulate code and assets that are no longer in use. Regularly review and clean up your project to remove these.
  • Duplicate Assets: Ensure code and data that use the same image or model reference a single copy of it, instead of a duplicate for each object or class you have defined.
  • Procedural Generation: If it fits your game, consider using procedural generation for some assets. This can massively reduce the size of your game, but it also has some unique challenges. As a simple example, instead of having copies of the same image in different colors, perform the color manipulation in code with a shader. More advanced examples could include generating entire levels, models, images, and audio files at runtime within the game’s code

PNG is a lossless format. It is compressed and heaps better than BMP, but it has its uses for small or exact assets like ui elements and not for photorealistic renders or actual photos. If you transform a png of a rendered master image  into jpg you can go down orders of magnitude in file size. While you can go down like x3 or x4 from BMP to PNG, you can go down another x5 to x20 from PNG to JPG.

For jpg specifically, just try it out. Make a row of sample pictures of your content and since the compression in jpg is given as a number up to 100, just make a 100, a 95, a 90 ... and so on. Then mix in your original and see for yourself how small you can go, until you notice and how far you can go even further till you care. jpg is *very* good at compressing natural looking stuff or stuff that was made to look like it might be natural. Pixelart and comics/anime are unnatural in this context. (note, 100 is not lossless, but even this placebo setting can be half as big as a png)

WebP is available in lossless and lossy, so depending on the content of the image, the same rules applay. Pixel heroes -> lossless. Photorealistically rendered heroes -> lossy.

In other words, there do be reasons, why your digital camera stores those ZillionMegalPixel Pictures in jpg. That is the format you want for stuff that looks like real things. For stuff that looks like my little pony animation with big same color areas and sharp lines you might get away with lossless compression, as this compresses fantastical and you do not want to be fuzzy around the sharp edges, and for pixel graphics, you want to keep the pixels intact, so lossy is bad for those.

Just try out with different samples of your images what is efficient.

Thank You

thanks for the tips!

Quero 2gb pra upar meus jogos

Limite 2gb please

ok,i will try the best