I'm a beginner in Godot but have some experience using scripting languages and no knowlegde about compiled ones.

I just created an app with 2 scenes, 3 pictures and exported it to a windows executable. The exe itself is about 35MB and the .pck file 8 MB. I think thats quite a lot for such a small programm.

Checking https://docs.godotengine.org/de/stable/development/compiling/optimizing_for_size.html and

gives a solution but as beginner thats a lot effort to just reduce the file size. Additionally if you have different projects requiring different module set, you need to build a seperate template forall of them.

Now i'm wondering why those modules aren't seperated into dll files. So one dll for every module. On build settings then you only need to choose which one to include (ether in the exe or the pck file). So you basically have always the same exe containing a godot core and everything else is loaded like a plugin depending on the included dlls. Even better: The build process should be able to automatically decide which ones to include as it can see in the GD script which functions are used and so which dlls are required.

Welcome to the forums @bitboy85!

I think the biggest reason why there isn't module separation into separate files is to make the executable more portable and cross platform. Each operating system has different files for dynamically linked libraries (dll for Windows, .a or .so for Linux, .a or .dylib for MacOS, etc) and I believe there are different methods needed for linking them.

I think there are plans to split some of the modules into GDExtensions in Godot 4.0, which should make it possible to just not import modules you do not need, which will reduce the file size. I'm not sure how many of the modules will be able to be split like this though, but it should help a bit moving forward.

The issue with using dynamic linking instead of static linking is that it results in a lot of files being scattered around for little practical benefit. The executable will also no longer work if you move the executable without moving the shared libraries alongside it.

Dynamic linking is a good fit for development builds as it makes link times shorter, but for production builds, static linking is more reliable, especially if you distribute your project within a ZIP archive (where users can easily access and modify the file structure).

The executable Godot produces for your game is basically a pre-compiled version of the whole engine. The game itself and the assets are stored in the pck file. 35MB for a 2D/3D engine with physics and sound and everything is actually quite good. While for a simple test project, it might seem like a lot, on any real game with lots of high-resolution images, 3D assets and textures, music and sound effects, etc. 35MB is super small in the grand scheme of things, and the rest of your assets will likely be much more. So I don't see this as a problem.

The questions came to my mind because i used Autoit a lot in the past which has the ability to store files inside the "compiled" exe and to unpack them at runtime. So its impossible to lose files during distribution because its only one file. Without any ressources included, the interpreter and script are about 1 or 2 MB.

In case of practical benefit, my thoughts are this way: To build your optimized template you need to download the source, download or install dependencies, compile it with your selected modules, add it to the projects settings and build. If you add features to your project you might need to add a module, and build and add it again. If, for whatever reason, modules will change in the future, the templates needs to be build again. And finally, if a developer has many projects with different templates he needs to maintain all of them. I think this is a lot of work and steps compared to downloading and including a handful of dlls.

@cybereality i agree, thats a lot of functionality within those 35MB but on the other hand most projects doesn't require all of it.

Last point: obviously not a recommend way, but maybe sometimes handy. Sending it by Mail, messenger or similar. Here you often have to deal with file size restrictions. (Discord 8 MB, Mail often around 50MB)