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

ProjectSettings.load_resource_pack is completely useless / broken and DESPERATELY needs a rewrite / multiple fixes #96298

Closed
JHDev2006 opened this issue Aug 29, 2024 · 6 comments

Comments

@JHDev2006
Copy link

Tested versions

  • reproducible in all godot 4 versions, unsure about godot 3

System information

Godot v4.4.dev1 - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 3070 Ti (NVIDIA; 31.0.15.4592) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)

Issue description

Using ProjectSettings.load_resource_pack() to achieve any kind of mod / addon support is totally useless. When using ProjectSettings.load_resource_pack() in the editor builds, all res:// files and folders that were previously there are now completely vanished, when using DirAccess.get_directories_at() or DirAccess.get_files_at(), meaning that testing mods or custom assets cannot be tested at all in the editor, In addition, adding files on export also seems to just, not work? files cannot be read by DirAccess, however, assets can be loaded in when the files in the pck are hardcoded in? While atleast that works, its means that any kind of dynamic file scanning, is basically impossible, meaning things like custom levels, etc are not possible. In addition, replacing files also doesnt work, as it seems to be because some files are loaded in before the pck can replace them, meaning they cannot be replaced at all? this means that things such as autoloaded or scenes that are preloaded cannot be replaced, alongside all instantiated scenes and scripts in there too, and so on. which can be incredibly frustrating and limiting for modders. This is even more confusing considering that the ResourceLoader has a flag, which allows it to basically replace what is already loaded in, using the REFRESH flag. So hopefully being able to allow for resources which are already loaded into to be replaced, would be incredibly helpful as well. However so long as the DirAccess issue is fixed, then id be more than happy already! Since myself and many others seem to almost be mislead by how the function works and its many limitations, it makes me wonder why there hasnt been a note in the documentation, at least explaining or making users aware of its current limitations and problems, or even marking the function as experimental or deprecated would be appriciated. Sorry that was a bit too long of a rant, but ive tried various different methods to try and allow for the function to work, but even then it still doesnt work as advertised, and ive lost all hope.****

Steps to reproduce

  • make any file to be exported as a pck, using the standard pck only export method, with only the file being selected in the resources tab, can be a png, tres, tscn, whatever

  • load the file using ProjectSettings.load_resource_pack()

  • try to find the file in the res://, where the original file now in the pck was placed using DirAccess, and notice how its no longer there. Alongside the fact that various other files are also just missing aswell?

  • cry

Minimal reproduction project (MRP)

resource_pack_test.zip

@scgm0
Copy link
Contributor

scgm0 commented Aug 29, 2024

Try #90425?
This is a known issue with the pck implementation, after loading the pck it will not be possible to access the local res directory using DirAccess, FileAccess does not have this issue.
This issue currently only exists in the editor and Android exports, as they both have native res directories, while the other exports have their res directories already packaged into the main pck, which is automatically loaded at game startup.

@JHDev2006
Copy link
Author

image

@scgm0
Copy link
Contributor

scgm0 commented Aug 29, 2024

Well here is another solution #93170

@scgm0
Copy link
Contributor

scgm0 commented Aug 29, 2024

android: #89412 (comment)

@JHDev2006
Copy link
Author

JHDev2006 commented Aug 29, 2024

thanks for linking those, hadnt seen them! seeing those pull requests have the 4.4 milestone makes me pray that they get implemented in one of the 4.4 dev builds! my current project and its mod support sorta relies on the idea of what the function aims to do, so seeing it be fixed or reworked would be amazing, thanks for the input!

@AThousandShips
Copy link
Member

Thank you for reporting, consolidating in:

And similar issues, see the PRs linked above for more related issues

@AThousandShips AThousandShips closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants