Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project.godot converted to project.binary on export when ProjectSettings.editor/export/convert_text_resources_to_binary is set to false #90981

Closed
ShroudedMuridian opened this issue Apr 21, 2024 · 3 comments · Fixed by #91300

Comments

@ShroudedMuridian
Copy link

ShroudedMuridian commented Apr 21, 2024

Tested versions

  • Reproducible in: 4.0-stable, 4.2.1-stable, 4.3-dev5

System information

Godot v4.2.1 - Windows 10.0.22631 - Vulkan (Mobile)

Issue description

The documentation for ProjectSettings.editor/export/convert_text_resources_to_binary states the following:

Note: If Editor > Export > Convert Text Resources to Binary is true, @GDScript.load() will not be able to return the converted files in an exported project. Some file paths within the exported PCK will also change, such as project.godot becoming project.binary. If you rely on run-time loading of files present within the PCK, set Editor > Export > Convert Text Resources to Binary to false.

This setting works as expected for all other text-format files; however, project.godot is always converted to project.binary on export, regardless of this setting, which does not match the documentation.

Note that it is still possible to export project.godot to the .pck using Export Filter options during the export process; however, project.binary will always be included, regardless of filters, and takes priority over project.godot during initialization.

Steps to reproduce

  • Create a project
  • In Project Settings, turn on Advanced Options
  • Under Editor>Export, uncheck the box for "Convert Text Resources to Binary"
  • Export the project
  • Inspect the exported .pck using debug code or with any available .pck unpacking tool

Minimal reproduction project (MRP)

For convenience, this project includes a script to print all files in "res://" to the debug console.
PCK_Test.zip

@ShroudedMuridian ShroudedMuridian changed the title Exported project contains project.binary even when export/convert_text_resources_to_binary is set to false project.godot converted to project.binary on export when editor/export/convert_text_resources_to_binary is set to false Apr 21, 2024
@ShroudedMuridian ShroudedMuridian changed the title project.godot converted to project.binary on export when editor/export/convert_text_resources_to_binary is set to false project.godot converted to project.binary on export when ProjectSettings.editor/export/convert_text_resources_to_binary is set to false Apr 21, 2024
@jsjtxietian
Copy link
Contributor

Seems like a bug to me:

String config_file = "project.binary";
String engine_cfb = EditorPaths::get_singleton()->get_cache_dir().path_join("tmp" + config_file);
ProjectSettings::get_singleton()->save_custom(engine_cfb, custom_map, custom_list);
Vector<uint8_t> data = FileAccess::get_file_as_bytes(engine_cfb);
DirAccess::remove_file_or_error(engine_cfb);

@timothyqiu
Copy link
Member

Project settings is technically not a "resource" :P

@AThousandShips
Copy link
Member

I'd say it's only an issue because it's mentioned in the docs explicitly, the intention seems to not have been to respect it but always convert it, but wouldn't hurt to make it respect the option as long as the rest of the engine handles it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment