Replies: 37 comments 173 replies
-
Can a project setting be added to disable this feature? I would assume turning UIDs on at a later time when the feature is actually needed by a project would be possible, otherwise, turning it on with 4.4 would break everyone in the first place. What are the pros and cons of such a project setting? |
Beta Was this translation helpful? Give feedback.
-
feature as implemented currently, it's present in Godot 4.4-dev5 and later dev snapshots here (current as of this writing): https://godotengine.org/article/dev-snapshot-godot-4-4-beta-1/#downloads alternate/complimentary issues and proposals: a pull request that offered some reference implementation: the PR that implements the changes discussed in the article on 4.4-snapshots: separate but related/affected issues: |
Beta Was this translation helpful? Give feedback.
-
I think it's important for everyone to voice their concerns but it's equally important to say that some of us think the current implementation is a clear improvement. uids are a pragmatic, relatively simple solution to a widespread problem with resources (they cannot be moved outside of the editor). It's already the case that users must move There is value in a simple solution in term of maintenance. As everybody knows, godot is maintained mainly by volunteers so any over-engineered solution should raise some eyebrows. Most people complain about the file system being cluttered but some users already have pointed out solutions to alleviate the problem in external editors:
|
Beta Was this translation helpful? Give feedback.
-
For newcomers: If you want to see the feature in action, it's present in Godot 4.4-dev5 and later releases. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Don't discard that right away! Will explain later.
Have to disagree with that. I prefer a way more a comment on my files with the "magic" number than thousands of uid files cluttering my repository. The only way to know what most people agree on would be some sort of poll.
This is an interesting idea, it could checksum files that are not already annotated an centralizad file (the monolitic approach) and check if it matches with missing files. It also would checksum files modified in the editor, and store on the centralized file. The only way it wouldn't work was if the file was externally moved and changed at the same time. Edit: Internally (in .godot folder) it could store the time each file was created, and when opening Godot only checksum the files with changed date, so it wouldn't checksum everything everytime. |
Beta Was this translation helpful? Give feedback.
-
Another alternative that i think would be much better than breathing hopium that Godot manages to track and update dependencies correctly would be to let the user fix the dependencies manually via a pop-up. This would give maximum control and transparency that the current and likely most other solution(s) lack. |
Beta Was this translation helpful? Give feedback.
-
Without trying to argue for one solution in particular, I just want to add this to put the downsides of the current solution in perspective: Millions of Unity users have been dealing with basically the same system (in the form of .meta files) for well over a decade and it's not been a big deal. Most game devs nowadays know how to handle metadata files, know to commit them, move them along the source file, etc. Lots of tooling has been made around them (like git pre-commit checks to ensure the user doesn't forget a meta file), which can be adapted to work for Godot. I have a feeling we're making a bit of a mountain over a molehill here.
|
Beta Was this translation helpful? Give feedback.
-
Firstly, I believe everyone agrees that UID is useful, and there is no need to discuss this further. Like UID fallback to path, I think we can use similar way to handle different types of UID. for example, GDScript, by handling All solutions are have cost, but we should try our best to avoid leaving burden on users. I wound prefer to add a simple comment to represent the UID of GDScript. By using comment style UID, just ignore an UID line in script, it not change anything (for users). By the way, like python, it usually have comments like |
Beta Was this translation helpful? Give feedback.
-
And add UID to all resources will bring a compatibility issue to plugins, please refer to this proposal. |
Beta Was this translation helpful? Give feedback.
-
I have a proposal, although I'm not qualified to implement it. But I hope Godot devs discuss these ideas if they think they're viable. The drawbacks of the current implementation:
I think this approach focuses only on devs using another IDE, the very well-known ones, and disregards other workflows. Storing the UIDs in the scripts as text has drawbacks too, but I think they are easier to solve, the results would be more robust and can meet the demands of more users. These are the drawbacks of embedded UIDs and the solutions I propose:
The implementation I propose is an hybrid of the UID files and embedded UIDs. I don't know much about how the Godot editor works internally, so I might miss something. Specially, the "Godot plugins having to parse the file" issue, I don't understand fully. I guess Godot builds a dictionary of files and UIDs when it opens a project. That dictionary could be available to Godot plugins so they don't have to open UID files or parse scripts. |
Beta Was this translation helpful? Give feedback.
-
i think a temp fix for now is to include the filename and the hash like "uid://some_file-fkjlqx8er2sg" , also regenerate uid after every rename |
Beta Was this translation helpful? Give feedback.
-
It seems like most against uid's focus on the upside of being able to move files outside the editor not being useful to them. Now it would be great if one of the engine devs could confirm this, but I thought that was only one of the benefits to the changes? I was under the impression that the full scope of the change that this improves was:
Some of these are crucial in bigger games. I definitely agree that it would be nice if there was some solution that didn't require extra files, but it also feels to me like a tradeoff I would willingly make/have been used to anyways. As well as some of the drawbacks being fixable with different methods eventually. (Like the text editor automatically displaying the path next to uid's) I don't have a clue if it would be viable to allow uid's to be disabled if its planned to be improved/extended upon in future versions. |
Beta Was this translation helpful? Give feedback.
-
I just want to give a pretty big disclaimer here that I am fairly new to Godot. I've been working with software for a long while now, but Godot is a relatively new tool to me. I have done my best to understand Godot's concepts and the thinking behind them, but if I get something just plain wrong, please feel free to correct me. If I am straight up not absorbing some fundamental concept and am getting this whole thing wrong, then whoops! At least maybe I'll learn something new, then. 😊 Is perhaps the issue here a result of that code is being treated as just another resource? As far as I know, we don't have any kind of built-in package or namespace system to organize scripts. I actually think UID files make perfect sense for traditional resources like scenes, textures, audio, etc. But something about using the same approach for code files feels like a band-aid for deeper problems with project organization.
As I mentioned, all things said, I'm pretty new to Godot. But from what I can gather, could it be perhaps that the real friction here is not that UIDs exist, but that code is still being forced to behave like an asset, instead of adopting the packaging/namespace semantics we see in typical programming environments? Ìf so, then UIDs (when used for scripts) are addressing the symptom (broken references after moves) rather than the root cause (lack of a proper code module system). As far as I can tell, Godot doesn't even have a way to package libraries for downstream use, people are just chucking 3rd-party code wholesale into their project folders. Maybe adding deeper language or project-organization features might help solve the problem at its source, rather than relying on sidecar files to keep code references stable. Edit: GDScript that is a resource has its benefits. But having the ability to perhaps use GDScript in a non-resource context with proper encapsulation (modules, and so on), could strip away limitations that are being run into that result in these usability issues. This could even open the door to 3rd party libraries being properly packaged (and potentially even a proper package registry. Give me |
Beta Was this translation helpful? Give feedback.
-
I really hope this feature can be reconsidered. Totally agree that refactoring issues should be addressed, but current implementation feels so far from optimal.
In summary, the pros and cons of uid files feels very underdiscussed, there are absolutely no necessary to release the feature in its current state. |
Beta Was this translation helpful? Give feedback.
-
Would somebody be able to say has there been any update on this topic (UIDs in Godot 4.4)? By update I mean will there be mayby something like #11571 or other solution. Hidden TextIf it comes I can always add .UID files to .gitignore right ?Edit: If there wasn't solution found till time for 4.4 could .UID files be postponed till next release(4.5, 4.6, etc.)? |
Beta Was this translation helpful? Give feedback.
-
As a user, I see new |
Beta Was this translation helpful? Give feedback.
-
So if I am not mistaken with release of 4.4 today best way for now to make sure that UID files won't clutter git repo is to just add them to If somebody also wants to avoid commiting
|
Beta Was this translation helpful? Give feedback.
-
I'm not sure how I missed this thread when searching the web directory for "UID" before making my discussion on ways they may be re parented in cases where the .uid files are orphaned. I'm thinking it was as simple as the search being strict enough to see "UID" and "UIDs" as entirely different terms. Anyway, I'll just leave the simple version here. I think there should be some kind of popup much like the existing one for missing resource references to prompt the user to re parent .uid files before they forget what they did and where they might be, but im also not all that sure that orphaned .uid files will turn out to be an issue for users depending on how often they end up moving and editing files outside of the editor. |
Beta Was this translation helpful? Give feedback.
-
Maybe we can add a voting system in godot editor for collecting feedback from users directly, instead of partial users only. |
Beta Was this translation helpful? Give feedback.
-
How about this: If I give a class name to an script, Godot will reference it by class name with path as fallback, and it will have no uid. |
Beta Was this translation helpful? Give feedback.
-
Resource UIDs and .import files in Godot: Odds and Dead EndsI previously raised concerns about UIDs in their current implementation, which unfortunately have materialized exactly as feared. While UIDs represent an important improvement to Godot overall, their current implementation creates several technical challenges and workflow issues that need addressing. .uid and .import files, as they exist now, present both a cognitive and accessibility challenge when working with Godot. This proposal aims to be constructive by identifying the core problems and offering potential solutions. Current Problems1. Evil Twin Conflicts (ETCs)Problem: ETCs occur when resources (but not their ancillary .uid or .import meta files) are committed to version control and shared between different editor instances. For example, when an artist exports a new sheet of sprites and commits them without allowing the Godot editor to scan and generate UIDs and .import files first. (or a developer unpacks a set of source files, etc.) Team members unknowingly generate different UIDs for the same files, leading to merge conflicts that can destroy subsequent work or break dependencies. New files are particularly likely to be instantly taken and "used" for something, so breakage due to ETCs happens on a regular basis. Mitigation: 90% of these conflicts could be avoided by implementing deterministic UID generation based on file content or file path. 2. Invisible Critical FilesProblem: .uid files are invisible to users but crucial for project integrity. Some resources require .uid files while others don't, and some systems (like .tscn) appear to handle UIDs differently. Resources with similar name "stems" can exist side by side, putting the onus on the user which of these can be moved alone, and which of those will break the project in a heartbeat if a .uid file is moved just 1 editor tick later. Mitigation: Either make .uid files visible in the file system tab or implement reconciliation strategies when files are moved. Alternatively, combine UIDs with their resources. 3. Evil Clone ConflictsProblem: When a file is moved without its UID, Godot destroys the orphaned UID and creates an entirely different one in the new location. This is particularly problematic for teams that organize files by type or use external tools to move files. The issue is also triggered when switching branches or using certain version control operations while the Godot editor is running, often leaving projects in unpredictable states. Mitigation: Remove the requirement for .uid files to be in the same location as their resources. This is challenging but solvable (a solution is discussed below). 4. Poor Human ReadabilityProblem: UIDs are not human-readable, making it difficult to resolve conflicts or identify missing resources during VCS merges ("What was uid://zuodsghup4ik?"). Mitigation: Always prioritize paths over UIDs in the interface and GDScript, as paths better represent user intent. Use UIDs only to resolve unknown paths at export time, replacing them with final paths. 5. Procedural Generation ObstaclesProblem: Procedurally loading resources (e.g., levels 1-37 for a puzzle game) is more difficult with UIDs than with path-based approaches. "Paths" are essentially URIs, so they are already uniform and identifying), their only problem is they aren't immutable at project edit time. Mitigation: Prefer paths for resource access, using UIDs only to resolve unknown or modified paths at edit/build time. 6. Untyped Resource FilesProblem: The combination of untyped .tres files and untyped .uid files creates confusion when multiple files share the same base name but have different extensions. Your teammate finds a warrior.tscn, warrior.glb, warrior.import, warrior.gd, warrior.png, warrior.tres, warrior.json and warrior.uid in a folder they wish to reorganize. It's up to them to know which pairs belong together. Together with the effects no.2, they may not even know some of these existed / were created. Mitigation: Use .import files to specify UIDs, and ensure all resources, from script to text to scene, have .import files (not .uid files). The import filename should in all cases include the resource's extension for clarity. 7. Premature Resource ManagementProblem: Godot often makes changes (destroying/recreating .uid files) before fully evaluating the state of the entire project. Mitigation: Build a complete list of observed filesystem changes before acting on them. Never act in multiple passes. Proposed Solution: Per-Project Centralized Resource DatabasePerhaps we should not chase after layers upon layers of mitigations, though. Instead of multiple ancillary files (.uid, .import, etc.), I propose to banish any non-user generated file into a single database (using either a memory-mapped file or SQLite, the latter preferable as a reliable and performant solution where recovery and repair functionality also exists, just in case). For version control, it can be dumped into a single text file. Primary Resource Table
This database would track every file Godot has ever seen in this respective project, with an option for users to perform garbage collection via Project Settings. When files are moved, Godot can query this database to determine if a file with the same content, name, or type was previously known, and reconcile dependencies and restore import settings accordingly. This process could be configurable, allowing automatic reconciliation based on matching criteria (e.g., same name, hash, and type but different path). A editor or project setting could look like "4 matches: Auto", "3 matches: Auto", "2 Matches: Manual", "1 Match: Never" (defaults to Manual) These database operations would be efficient, and the content hashing would only need to be performed once per file move (or optionally, every change). The history maintained in the database would also help with accidental deletions or external tool operations, allowing automatic restoration of settings when files reappear. It is important that all "known" columns for each file are regularly updated, but they don't need to be updated all the time (but likely they could - I'm working on a PoC for an Engine project that does exactly this and it looks promising so far) Reconciliation through the "history" of this table will also remove most of the impact temporary deletions have, or partial moves of more complex assets (e.g. .obj files and their accompanying .mtl and textures) Layered, Reversible Dependency Reconciliation (optional, later!)To address limitations with the current "fix dependencies" dialog, I propose a secondary alias table:
This table would:
Users could "apply" the alias table (making all operations permanent and clearing the table) or "garbage collect" the primary table (removing entries no longer in the project) through Project Settings. TLDR;.uid files are 💯 percent a dead end and will keep adding technological baggage and painful corner cases to engine maintainers and users alike. The current UID system in Godot, while an improvement in some respects, represents a technologically obsolete bad practice, that causes significant issues for teams and complex projects. The proposed centralized database approach would not only solve the immediate problems but provide a foundation for more robust resource management in the future. I welcome feedback and discussion on these ideas. |
Beta Was this translation helpful? Give feedback.
-
Question: Would somebody be able to say were there any new issues/PRs/discussions regarding UIDs that should be checked ? Like is there any solution to a problem being worked or discussed that might be or was merged ? |
Beta Was this translation helpful? Give feedback.
-
I share my idea of notating the uid within the comments of the code. Translated with DeepL.com (free version) |
Beta Was this translation helpful? Give feedback.
-
Can we get a solution/alternative ways to store UIDs instead of UID files before 4.5 launches? |
Beta Was this translation helpful? Give feedback.
-
A file name with a path is itself a human readable unique identifier. Adding a non-human readable unique identifier right next to it as a separate file to identify the file is not needed. It solves nothing. It can't solve anything because to generate the UID file Godot needs to know about the file and in that point the developer has already added a reference to the file to the project by using the file name. It is just a duplicate id in a separate file which makes no sense. Another way to look at it is the fact that almost all the software ever created (including for example Godot engine, games made with previous Godot versions and so on) is working just fine without such UID file system. That's the proof that UID files are not needed. Correct way to fix the issue is to get rid of UID files. They are a mistake. |
Beta Was this translation helpful? Give feedback.
-
Most of the many downsides of UIDs for scripts have already been mentioned elsewhere so I don't have much to add in that regard without repeating them, but I'd like to leave my two cents regarding this. The mandatory addition of UIDs for scripts is in my opinion a big mistake that worsens the experience for many if not most developers, for no tangible benefits. To make things worse, it seems the maintainers are reluctant to even add an option to disable it, despite overwhelming negative feedback from the community regarding the feature. This feature is the only reason why I haven't updated to v4.4 yet. For my current game I'll stay on 4.3 until we're able to officially disable this feature, or if that never happens, maintain a fork if there are important bugfixes missing from future versions. For future games/games in early stage I'd have to move away from Godot altogether -- IMO the project as a whole needs to prioritize stability, onboarding more contributors, improving documentation and bug triaging instead of merging more problematic features to "stable" versions. One last thing I'd like to make clear: None of the proposed "solutions" completely fix the many problems introduced by this feature. They're just attempts at alleviating the symptoms of a harmful feature. But also, nobody wants to fight their tools and deal with workarounds and hacks for an unnecessary feature introduced to a minor version bump on a stable release. For me personally, the only solutions are: either remove the feature, or add an official option to disable it on a per-project basis. It is specifically .uid files for scripts that I find problematic. For assets, not so much. Code and assets are completely different beasts. |
Beta Was this translation helpful? Give feedback.
-
I think 4.5 will be another version without this issue solved... |
Beta Was this translation helpful? Give feedback.
-
I found that it might be possible to DISABLE UIDs by setting UIDs one wants to disable to This doesn't fix .UID files problem, but if I am not mistaken this allows to shutdown UIDs... Note I did not test this...So this might be a way for plugin devs to have no UID conflicts when shipping their plugins. |
Beta Was this translation helpful? Give feedback.
-
I have yet another idea... One that seams good. It might even be as the Also it could be expanded as whole version without UIDs, but that might be a stretch. I am speaking of separate available build since at least for me it is hard to know when to update custom fork to have it as stable version. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As we announced in UID changes coming to Godot 4.4, to be able to better handle refactoring of files within projects, both in the editor and externally, we generalized the UID system to all resources, including scenes and scripts.
That has a number of implications which are naturally tradeoffs, and we are aware some of the decisions made are unpopular with some users, notably the addition of separate
.uid
files for.gd
,.gdshader
, and a few other file types (custom resources notably).We'd like to centralize user feedback in this discussion, which unlike PR or issue comments, has the advantage of supporting threaded replies. This makes it easier for users to make separate arguments and to discuss them in a focused manner.
Please read the blog post we published, notably the FAQ, which addresses a number of feedback points we already got before announcing this change. Of course you are welcome to bring up some of those FAQ items here too for further discussion.
We'll redirect discussions from other issues/PRs to this discussion, and evaluate that feedback while finalizing the 4.4 release.
Since this is a bit of a "hot" topic, I would like to remind everyone to be constructive and courteous, even if you disagree with points made by other users.
Beta Was this translation helpful? Give feedback.
All reactions