-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Proposal for renaming nodes for Godot 4.0 #30736
Comments
I use Godot professionally for more than a year. I agree with everything you said, except for:
If we have this golden opportunity, let's just rename everything. That includes Sprite2D and MeshInstance3D. It's always better a full painful refactor, that many partial painful refactors. |
Speaking of renaming: #16863 |
@jahd2602 I don't mind either way personally, we can poll that in the worst case. I definitely can see people bothered with that simply for the fact that it's an inconsistency, but we can at least see if they are majority or minority. |
@Zylann I know, if we decide something here, we'll move this over there. |
I think the stance against namespaces is short-sighted. It makes sense from perspective of the engine workflow in general but it ignores the perspective from toolmakers. Godot Unit Testing (GUT) by bitwes for example broke due to a naming conflict in one of its updates. There is a likelihood this could have been avoided with a dedicated GUT namespace. I would also like namespaces for Waiting And Testing (WAT) so I can I can use class names like Test (accessed via WAT.Test) while not running over other frameworks (like GUT if it were to use GUT.Test) or just the user's script. I've tried a number of times using a WAT class that contained all of the scripts used as subclasses but that's just a cyclic reference hell. If we are to be encouraged to build tools from within the engine, then we need the tools to make those tools in the Engine even if they aren't absolutely necessary for the engine workflow itself. In summary, a dedicated namespace system which can be both accessed as well as defined from the engine (or at the very least the plugin script) so tool makers don't end up walking over each other or their uses would be a godsend. |
@CodeDarigan I understand it has benefits and I'm not denying them, but I sincerely believe that the costs outweighs them. Add to this that pretty much we had no significant complains from GDScript users, who prefer the current approach, so it would force them to an unwanted worfklow and type more code in a language that is intended to just write quick and dirty stuff fast. (C# users seems to do want them, though). This is why I mean that they can exist as metadata for script language bindings, and we could even add them for GDNative C++. Just not add them for core C++ engine. |
Navigation -> Nagivagion3D |
@nitodico indeed |
I'm still getting started with Godot and the proposed changes sound sensible to me -- using subtly different names for the 2D or 3D variant of a node is something that's caused me a bit of confusion while learning which end is up and moving to Thing2D/Thing3D or Thing/Thing3D feels like a significant improvement to clarity and comprehensibility. |
Please do it. |
Tbh this change would come anyway, so better to do it now and stick with it. For 3d there are not that many tuts so now the change will do less damage than in one, two years later. |
Regarding materials it would be nice to have some kind of Legacy Material that only uses minimum resources, like diffuse and specular, this would be useful for 3D mobile games. |
I'm also in favour of renaming things to be explicitly 3D or 2D. Wouldn't it be possible to have the original names still exist as aliases to the new ones? They would be hidden from the editor so the old names wouldn't be usable (or placed under a "deprecated" heading). That way old code would still work, without changes and without needing additional logic to convert anything. A warning could be added for code using the deprecated node names and then in 4.1 or 4.2 they could be removed. |
If there are two versions of a node I would always append 2D/3D suffix. |
Also, I would be happy if Label -> TextLabel. I go to add a node so I can show some text, so I type text in the search bar and of course only RichTextLabel shows up which reminds me that the standard text node doesn't actually have Text in the name. |
@Janders1800 that's how it works now, the less features you use in SpatialMaterial, the smaller the shader it creates. |
I'm a 2d person, so for nodes with mainly 2d application, keeping the node names without a suffix if it doesn't already have one seems fine to me. This seems like a more painful refactor for 3D users, but it does make a lot of sense where certain nodes have only a 2d or 3D application for the most part that they retain the shorter name for their intended domain and have a suffix elsewhere. Anything else that can be unified would be nice to see unified, specifically |
I'm in favor of unconditionally using While it's true that for some nodes it seems like a lost opportunity to have more "natural" names, consistency wins. What I don't quite like is that the But I can't yet suggest a better naming. Maybe this is also an opportunity to do something about 'canvas'. I found that concept a bit confusing at times. I know it's difficult, because is has no 3D counterpart: 3D scenes live in However, it would be great if we could define some naming that allowed renaming |
I'm not necessarily against the rename, but the original names make sense to me, maybe because of my background. |
for future compatiblility, in gdscript a gdscript file...extends Spatial And so on. |
Have you thought about renaming |
@BeayemX I think that translation is a common term for 3D space, and position is common for 2D developers 🤔 I do not know if 4.0 will be the best for node name changes, there will be a lot of things to deal with and there were many changes from 2 to 3, it means deprecating books, videos, courses. |
I'm in favour of renaming 3D nodes as suggested here. I don't know how much of a problem it will be for tutorial makers though. At the very least, it should be trivial to refactor existing code bases. In C# we could even abuse the I hope we add namespaces/categories as discussed in #18711. I want to separate the C# API into namespaces and perhaps assemblies as well to make it possible for users to pick only what they need. |
@eon-s I don't think it is... while |
BTW, why are we planning to break as little as possible? I understand why people don't want more compatibility breakages, specially those making tutorials; but if we won't take 4.0 as an opportunity to break compatibility, when are we going to? #16863 is already accumulating a lot of suggestions. |
@neikeq can't wait for 5.0? since no new or big features are planned, otherwise people will stop making things and buying courses for an engine that changes important parts every 1 or 2 years (for video tutorial makers this mean redo all their work) and with a few months of warning time... |
@xxmatxx I would prefer if the rename happened with a short transistion period to stop dragging the 'what would be' old names along. |
I agree, the longer it takes, the longer it will have a chance to confuse people. Tutorials and docs won't be immediately outdated if, like @AtomaFajrovulpo suggested, for a period of time the editor still allows the deprecated stuff but shoots out a warning. Something along these lines I suppose:
and
|
I found yesterday that constants don't all follow the same case. For instance there is |
@BenjaminNavarro Changing Color constants to uppercase was also discussed at the bottom of #14704. Also, method/signal/constant renaming should be discussed in #16863, as this issue is specifically about node names. |
@Calinou Thanks, I was pretty sure there was other issues but couldn't find them. |
I'd rather have the rename in 4.0 and be over with it then knowing it will come later after the project i'm working on has grown more. if a major release isn't the time to do it, what is. SemVer: Given a version number MAJOR.MINOR.PATCH, increment the: |
How far will you go with this? Will GridMap then become TileMap3D, and Tilemap Tilemap2D for example ? Also, node2D and node3D seem a bit generic, why not have Spatial2D and Spatial3D then ? I think a big UX difference too would be to have control, node2D and spatial, whatever they will be named, directly accessible beneath node in the new node dialog, although node2D and control inherit from CanvasItem. You can't add a CanvasItem directly to a tree anyway, so maybe it should not be visible in that dialog. And as far as methods go, i guess there is no need to add a 2D or 3D postfix on those, since you know what you call them on right ? |
This comment has been minimized.
This comment has been minimized.
@qq715152910 Please don't comment on long threads with completely unrelated information. Everyone who has commented on this issue will receive a ping and your comment has nothing to do with the proposal for renaming nodes. As a result, I will be hiding your comment. |
I'll give our opinion about some renaming that would be usefull for us (We use C# mainly) The renaming that we strongly suggest:
(Making the access to a transform property lowercase) Why?
For the rest of the proposing renaming we look forward to what the community think is better. |
It's named AtlasTexture because it follows the usual |
This what shows up when I type "Atlas". This is what happens when we type Texture: Edit: We understand why that convention. In the 2nd screenshot, |
@bigmonte The EDIT: #38430
I'm the one that proposed that in the first place, and I strongly disagree. It's better to keep them separate, since it increases discoverability of By the way, I think you were looking for #16863. |
"a tool in Godot 4.0 that basically converts a script from 3.0 to 4.0"Lol, I was just beginning to write a python script that would do this for all .gd files in the project folder from which it was run. How set are you on making this tool a thing IE should I give up on this haha. |
Breaking compatibility
I know I promised to break as minimum as possible to compatibility for Godot 4.0, but I' ve been thinking this over for a while and based on feedback, and I think it's worth it. It should not break compatibility with existing scenes (we can add internal renames), but it will with code...
So maybe what we could do is a tool in Godot 4.0 that basically converts a script from 3.0 to 4.0 doing symbol renaming or just re-tokening.. this way no manual work has to be done by the user (so no huge amounts of pain like when we moved from 2.0 to 3.0).
For reusing existing tutorials (that I think won't really be affeced much anyway), we can put up an doc article showing what was renamed.
What I would change
Despite that many say that Godot was originally a 2D engine, that is false. Originally, it was a 3D engine and the only things supported as 2d where the canvas (UI) nodes. The 2D nodes came later.
So, this makes it quite confusing that for 3D nodes, the "Spatial" term is used and for 2D nodes, there is "Node2D".
For users starting to use Godot (and even for advanced users), this is pretty confusing in general (only aided by the node colors, but if you make a mistake in code, it can be confusing to realize you are using the right version 3D instead of 2D)).
My proposal is to simply make explicit, in case nodes exist both as 2D and 3D form, that they should be named the same, but add a 3D or 2D at the end (save for some exceptions).
So, typical renames would be:
and so on.
For some, I think we could keep the current way, because the use case is mainly for 2D or 3D, and the opposite version, such as:
But then again, feel free to suggest if you would prefer something more explicit and make everything 2D/3D always.
Namespaces
I'm not that too keen on namespaces within Godot for a few reasons
But nothing should avoid us from defining them using the ClassDB API, so languages that are heavily namespace based, and where users are very used to it (like C#) can make use of them.
As an example:
Below a GDCLASS("Node2D") definition, an optional
GDNAMESPACE("Nodes2D")
It will also make browsing help and documentation probably easier too.
Other things I would like to change
SpatialMaterial is confusing as hell to new users (and existing too). I think we should rename to StandardMaterial3D. I would probably also want to make two different versions, one similar to the existing one, and another that instead uses ORM style textures (setting them up in Godot right now is a huge hassle using Spatial Material and assigning channels manually). This way we could have something like:
or similar..
The 3D scene import process is still quite a hassle because you can't set options to individual meshes and materials while importing them, so I want to add an option in the import dock to have import windows with settings for some types of resources (in this case for imported scenes).
The 3D scene import would show you a tree with all the data and then you can choose a lot of nice stuff in there for every node/material such as:
Feedback welcome!
The text was updated successfully, but these errors were encountered: