-
-
Notifications
You must be signed in to change notification settings - Fork 22.2k
Add options to control if ".uid" files are generated #100973
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
base: master
Are you sure you want to change the base?
Add options to control if ".uid" files are generated #100973
Conversation
|
I think Godot should commit one way or the other. Leaving this as an optional feature greatly limits it's potential in the future. All future features that build up from the uid system (or the metadata-companion-file concept in general) will be impossible to implement fully if some users don't have uids available. |
|
@JoNax97 What features? You should provide specific situation to make your viewpoint convincing and solve the problem that I mentioned about (".uid" in "res://addons"). If you want to talk about future, to make plugins' detail files outside the version control system is a good future, too. |
|
I agree with you that add-ons should be handled via some package management system. But until then, we cannot guarantee that a plugin does or does not rely on uids and so it's not safe to disable them for all addons. My main concern is not with add-ons specifically but in general. Fundamental mechanisms that the engine uses to manage its internals should not be up for disabling IMO. |
|
I think I grab the point that you focus about. We should make a decision before 4.4 release. |
|
I don't think making UID files optional makes sense, it'd just be disabling an important and helpful feature and solves issues that people have been frustrated at for years, having them be optional just resets that and creates additional sources of bugs and frustration Now there should be a proposal discussing how to handle UID files in addons, but regardless this PR needs a proposal, this shouldn't be discussed here as per the workflow guidelines, PRs are for discussing the implementation, proposals for discussing the idea |
|
This pr can be superseded by #100994 now. Here just talk about make the generate behavior become optional. There have many remonstrances in #97352, even though it is merged, because not all people have spare time to focus each proposal and pr, they just pull and compile by themselves, and discovery the problem at this time. I very agree this comment. Anyway, I know this pr can't solve all problems and satisfy everyone, just provide a possible option to make godot reach to a good future. |
I don't think that PR is a sufficient replacement for this PR. It only contains the "disable for addons" part of this PR, and leaves out the "disable for project" part, which is core to the proposal this PR aims to address. |
Although the change of “disable for project” part seems more significant, the main purpose of this pr is to temporary avoid compatibility issue of plugins by disabling generate ".uid" files in "res://addons/". |
ef314ca to
bfc87aa
Compare
I believe that's the purpose of the PR you nominated as a replacement, #100994. This PR is linked to godotengine/godot-proposals#11571, which says "Add an option to disable generation of UID files" (i.e. disable it in general, not just for addons). |
Asking cause I want to know what to expect for 4.4 regarding UID files. Basically will I be able to switch UID files off for my project. |
|
Would somebody be able to tell how long review of this PR might take? |
|
This is a new feature and we are in feature freeze until after 4.4 is released, so this can't be merged until then, but this idea itself is being discussed, see the comments on that for alternative solutions |
|
Is this rl a new feature? To be able to disable another feature? |
|
It might just me being stupid, but I believe Option for switching off |
|
One could argue it would be part of the same feature, like the UID upgrade tool added recently, but this is not something that's clearly decided to be wanted or clear that it is a good solution I don't know what the production team thinks in this case, but I'd say it'd at least require a consensus before this can be considered for 4.4, and there isn't a strong consensus if you check the reactions on this PR (15 positive, and 10 negative) But the production team can take a look and see what they think |
|
How could production team be asked to check this topic?
I am worried that UID files will be trashing my filesystem - I have a lot of script and txt type files (txt for things such as dialogues and items)
Also I had experienced a situation in the past where godot would self change uids when saving open resource.
|
That's something to report as a bug, not something that should be solved by not using |
I seen it already beeing reported, I added that as just a way of saying uids never been working for me, also I belive path is easier to read than uid |
"Somebody else's problem is solved by this. We think that that problem is more important than the problems this solution introduced."
"Besides, 4.4 just released and we're trying to hot fix as much issues that we introduced as possible without actually changing course. We first want to see if there's enough complaining to warrant rethinking our approach." (This would normally be an okay strategy. However, in this case the feedback discussion thread alone has TONS of feedback already given to you, most of which is not addressed by all the band-aids the project implemented to try and alleviate pain. It's already day clear what this solution fixes well and what problems it causes.)
In the meantime, just try using it. I'm sure at some point you will have been coping with the issues for so long that you will begin to accept this as a normal part of your workflow, just like with We also have some work going on to try to fix the aforementioned issues. This work so far didn't focus on the core issue, but should help ease some of the coping. (This is essentially a re-hash of the above paragraph.)
If you have "actual" (..sorry, what?) problems with |
It souds like bug, you can try this in a new project and create a minimum reproduce project to submit issue. |
This comment has been minimized.
This comment has been minimized.
As @akien-mga said, we didn't just implement this system on a whim. We were in fact listening to users complaining about numerous issues linked the lack of file tracking, especially when moving files outside of Godot (which can happen a lot, even if you're cautious about it). We recognize that it sucks, yes, but I reject the ideas we don't listen to users, which is you're suggesting.
A centralized file defeats the purpose of tracking files, as Godot cannot recognize that a file moved outside. Hashing the file doesn't work, because multiple files can share the same hash (when they are identical). Embedding the UID was considered, but it's super difficult to implement on text files, as adding it can mess up the parsing of that file. It also changes the hash of the file. |
I think it was happening in 4.0 dev or beta... so some time ago, I didn't look did it happen since |
|
Also I have spoken to few people that I don't think will look into this thread even after I gave them, link, but they also have issues with UID files and prefer to stay 4.3 |
It is good news to hear that the Godot team is hearing users' voice and recognized it sucks. I just hope this issue can be solved as soon as possible since it's so confusing. I have another question about hash or checksum. As long as the content of the script is the same, they will work the same way ideally. It doesn't matter to refer to which one of them, and they could be seen as the same script as well. It is ok to refer to the first one or the newest one on behalf of those duplicated scripts, isn't it? When one of these duplicated scripts is removed or changed, another file will replace it since they have the same hash or checksum, and the reference doesn't change either. Why is the checksum still the wrong tool, as the Godot team mentioned in the blog:
Or in the case that the hash or checksum can not identify some files, then generate UID files to separate them. Is that possible? |
|
What about if there is warning near disabling UID files, like If not why is there need for enable alt space menu, something like auto accept quit or Main Loop type, low processor mode and many other project settings one could consider unneeded. What I want to say by this is, some people do not want to have UID files and consider them unnecessary as it is just a file with 1 line of text and this method just disables generation of NEW UID files and the ones already generated do work. So please just let us select which way we want to go in our projects. Whenever we want to use UID files or whenever we want to disable their generation within our projects. Let us have this choice like you already did for many other things via Project Settings. |
"This is not recommended but still supported" is a strange position to take, i think.
Besides extensibility, they force the code to work within reasonable constraints by explicitly defining an API. So, it has benefits for the codebase, even if it doesn't end up being used much in the wild. I remember a good blog post about this but sadly can't find it anymore :( |
|
@elenakrittik that all meant to just say please let us do this... Also please remember you can disable part of godot when making stuff, I have in mind In it you can remove most if not all editor features, even the stuff that could be considered core and needed for making stuff. |
@akien-mga i personally agree with you and the rest of the devs, however there's a usecase i am not sure is already considered. This proposal was trying to prevent that by disabling generation of uid files in the addons folder, because that is the main folder that is shared using the AssetLib (still not the only one) But i believe a better solution (that i dont know if it is already implemented) is when adding files from the asset lib, to skip the uid files from the library that you are importing, and the addon maker should simply know to not rely in uids. This can still have consequences, because tscn (and scn, tres/res) files will reference sub resources using uid, they will fix themselves on first save, but in the unlikely case that the uid already existed in the project, this file will now try to point to an unrelated file in the project. I myself, can live with this, i want the .uid files, i think they are for the better |
|
I wonder could disabling files UID allow for file paths like I find myself duplicating full directory via godot and having files from another directory be used cause UID points to it. |
when you duplicate a tscn file, internally subresources are mapped using first uid, then file path as fallback. the proces of duplicating he scene may not understand you also want to duplicate the subresource (because it doesn't see what other files are in the queue of files to duplicate) so it simply keeps using the old one. This is normal and was happening before, the only difference is now it happens also for scripts and not only for other resources like textures and sounds. |
|
Can we just get this feature? The option to disable files UID generation? Preety Please. I realize there are reasons why it was implemented, but just please let me chose do I want them or not. |
|
@pietru2004 Please stop spamming this PR. I already explained the current status in #100973 (comment). There is no intention to merge this feature for the time being. To reiterate:
So even if you personally accept the limitation, this will make it a problem for engine maintainers and prevent further improving the editor handling of files and dependencies. You are welcome to merge it in your own build if it's critical for your use case. |
|
Ok |
I think collisions are pretty unlikely in this specific use case, but we can ensure that if such a collision happens, the editor can resolve it gracefully. Collisions can actually happen easily when duplicating files from outside Godot and that's already something we need to solve properly. If we find that UID collisions with addons are actually happening, there are also options to make UIDs more deterministic based on the file paths, so addon UIDs wouldn't clash as they would be seeded from their I don't think disabling UIDs for addons specifically is a good option. Addons are one of the most relevant uses of UIDs to ensure that code can be reused independently of the filesystem structure IMO. |
|
Yes, i also believe disabling uids is not the right way to go. Acceptable solutions i think of are:
|
The purpose of disabling ".uid" in "res://addons/" is to temporary avoid UID conflict and generate different UID in different devices if reference plugins without details. Like I said in #11464, we can remove this limitation if we can solve these issues in future. But it's already too late, 4.4 already release, even if we solve these problems in the future, at least plugins created by 4.4 stable are have potential UID conflict risks. I don't care anymore, I am powerless to change anything about it. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
So many days later, maybe I should take back my words that the Godot team is hearing the voice from users. These days, I always get such errors after I upgraded my project to Godot 4.4. Godot 4.4 says my resource is not found, but it actually dose exist and it's referred by the scene. And when I click fix Godot 4.4 says there is nothing that should be fixed If this pr won't be approved, can the Godot team just fix these errors? |
|
@949886 Please file a bug report with steps to reproduce. |
|
Too tired and disappointed to rewrite an issue and care about this. |
|
@949886 your problem is not new, and doesn't seem related to uids, this happens from time to time sadly. |
Thank you for your reply! I'm just a little frastuated by this problem. In my case. The reference is not broken; every reference is fine. |
|
Well, i am glad you found a ray of light to, at least, try to workaround the issue. Indeed circular dependencies between resources are bad, one way to prevent it is using |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
This is going in circles and not constructive, so I'm locking this discussion. We've heard the feedback, if we decide that we want to make UIDs optional, we'll revisit this PR. Until then it's available for people who want to make this decision for themselves, that's the power of open source. |




The main purpose of this pr is to allow not generate ".uid" files for "res://addons/", by setting "editor/resource/generate_uid_files_for_addons" to false in project settings.
Sometimes plugins are not included in version control system( for example, using gd-plug to reference plugins by single script), generate ".uid" for plugin's scripts and reference them by using uid are not reasonable.
Additionally, I add "editor/resource/generate_uid_files" to allow not generate ".uid" for the project, but default is true.
Generate ".uid" for each script make the file resource manager become ugly, and we should manipulate 2 files now.
There are some personal preferences here, I believe some people also have this feeling.
For old users, they should used drag files in editor's file system dock, it should not breaks the reference relationship by using this way, and uid is unreadable, we don't use them for coding directly.
In other words, ".uid" files are not necessary for some users.