Final size of exe, zip

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By VanBandama

Hi.
One thing is bothering me and I hope you can explain it to me plain and simple.
Why final exe must be so damn big? I mean, I toy around with just one scene, one sprite (boss from: https://opengameart.org/content/gameboy-platformer-art.) , no additional coding. I set display to 800x600 and yet my sprite seems to be microscopic but final size of exe is 29. How’s that possible. When I change export format to zip/pck then it has 10-12 kb.

I try to aim at 5-10 mb of final size of my project zipped or exe. With gameboy like color palette. Is it possible to achieve that with downloaded not compiled from source godot?

Unfortunately, it’d be very difficult to get the size of your executable down, since as another answerer mentioned, it’s the engine itself. The executable will always be the same size for a given platform, no matter how large or small your project is.

Dunoid | 2018-08-08 19:55

:bust_in_silhouette: Reply From: Kotep

Exporting to ZIP/PCK gives you a package of all the data files for your game, but not the Godot engine itself. If you gave someone the ZIP/PCK, they would have to go and download Godot themselves to run it. (If you’ve ever played old Doom levels, the ZIP/PCK is like a WAD file, while Godot is the program itself.)

The EXE is so large because it’s got the whole Godot engine in it. You can make it slightly smaller by toggling off the option to include debugging when you export it, but it doesn’t change the size by much. I don’t think compiling Godot yourself would change the size of the exported EXE, as that’s how it’s coded.

Unfortunately I don’t think you can make a game in Godot that’s smaller than 10 MB.

The methods mentioned in this article can help to reduce the engine’s executable size to around 40% of the normal size.

Optimizing a build for size — Godot Engine (latest) documentation in English

eons | 2018-08-08 10:54

:bust_in_silhouette: Reply From: Calinou

In addition to following the advice in Optimizing a build for size, creating a Windows installer that uses a stronger compression algorithm can also help bring down file sizes. It’s also possible to use a more optimized (but DEFLATE-compatible) compression algorithm to create slightly smaller ZIP archives.

I’ve tested this with the Platformer 2D demo, here are the file sizes I got for reference when I exported it to 64-bit Windows in release mode:

  • Uncompressed: 28.3 MB
  • ZIP compressed with zip -9: 12.4 MB
  • ZIP compressed with advzip -4 -i 100: 12.1 MB
  • Inno Setup installer with LZMA compression: 9.0 MB

If you plan on creating an installer using Inno Setup, feel free to use the .iss file I use for Escape Space as a template.

Thanks for answer. Just start my journey with programming so I might sound like purist, 'coz I want my project to be best in every aspect.
Sometimes I forget that better is the enemy of correct :slight_smile:

VanBandama | 2018-08-09 01:29

Don’t you think the developer can do like if you export a 2D game than only include 2D components and UI components otherwise include the whole engine? Shouldn’t we make a proposal for that?

adib003 | 2021-12-09 17:44