godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Don't export project's custom boot splash image in a PCK file or make its export optional #9115

Open moldovanedy opened 8 months ago

moldovanedy commented 8 months ago

Describe the project you are working on

Any game that uses PCK files.

Describe the problem or limitation you are having in your project

In the current implementation (as of Godot 4.2.0), the project's boot splash image gets exported with the PCK (to test this, export a PCK without a project splash image, get its size from the file explorer, then add a project splash image, export again; the second time, the PCK should have its size increased by exactly the size of the splash image).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I don't know if this is an oversee or the intended behavior, but if this is intended, please provide an option to avoid exporting the splash image in the PCK or just don't export it at all as it is useless and only consumes space; the splash image should only be present in the main PCK.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A simple toggle to set whether to include the splash image or not.

If this enhancement will not be used often, can it be worked around with a few lines of script?

You can, of course, just unset the splash image, export the PCK, and then enable it again, but this is annoying and you can easily forget to do this.

Is there a reason why this should be core and not an add-on in the asset library?

It is the engine's core exporting.

RedMser commented 8 months ago

I don't know if this is an oversee or the intended behavior

It seems to be intended, as it's part of the list of "force-exported" files: https://github.com/godotengine/godot/blob/8ff821670561466a5ff72044ad574dcb955b66c2/editor/export/editor_export_platform.cpp#L871-L871

As a more automated workaround, you could try giving your PCK export target a custom feature tag and override the boot splash image project setting to an empty string only for this custom feature.

KoBeWi commented 8 months ago

Why did you set splash image if you don't want to use it? If you want it in editor only, make the path empty and add setting override for editor.

moldovanedy commented 8 months ago

Why did you set splash image if you don't want to use it?

The whole point was about exporting secondary PCKs like explained in Exporting packs, patches and mods, not about the main PCK. You already have it in the main PCK of the export; if you export other PCK files with additional content that you want to load at runtime, it makes no sense to have the splash image there as it was already shown to the user from the main PCK. In the current implementation, the splash image is just duplicated across all PCK files for no reason. Like I said, the solution is pretty simple (just unset the splash image before exporting secondary PCKs), and the solution proposed above by @RedMser is even better, but beginners will not know that exporting the secondary PCK will duplicate the splash image and (if the splash image is big) then they complain about the PCK size. Plus, it's easy to forget the fact that you have to unset the splash image before a PCK export.

In my opinion, a simple option to chose whether to include the splash image or not in the secondary PCKs will be very helpful.

RedMser commented 7 months ago

Is this fixed now that https://github.com/godotengine/godot/pull/82084 is merged? You can test it in Godot 4.3 dev 4

moldovanedy commented 7 months ago

Is this fixed now that https://github.com/godotengine/godot/pull/82084 is merged?

Yes, it is fixed. I will close this issue as completed.

moldovanedy commented 3 months ago

Regression in Godot 4.3 beta-2.