godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Remove obsolete/undefined Editor and Project settings #4444

Open KoBeWi opened 2 years ago

KoBeWi commented 2 years ago

Describe the project you are working on

Godot, games etc (not really relevant)

Describe the problem or limitation you are having in your project

Original proposal:

Currently when we rename editor or project settings in a given version, users upgrading from the previous version will still see those obsolete properties in their editor/project settings if they were saved in their editor_settings-3.tres/project.godot. This is confusing as users may expect those to still do what their name says, even though they have actually no impact on their project whatsoever. The same issue arises when using a non-Mono build after using a Mono build, where Mono-specific properties will be exposed in the editor settings. Such properties are not identified as obsolete nor custom for now, the only hint you have is that there is a revert button and that reverting them makes them disappear (!). I suggest to identify them visually, maybe by having them in italics, and/or with a warning popup (similar to node configuration warnings) that tells that they are either no more applicable settings from an other version of Godot, or user-defined settings.

However the proposal didn't gain too much support and my comment about adding a button to remove such properties (instead of graying out or whatever) gained almost as much upvotes.

It was suggested in https://github.com/godotengine/godot-proposals/issues/3526#issuecomment-1096962148 to open a counter-proposal, so here it is.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Whenever Godot encounters some unknown project or editor setting upon startup, yeet it. There is no reason to keep them and they cause problems, as described above.

The only usage for custom project settings would be making a setting and then adding overrides based on platform. But this can be done in code as well.

Alternative option to removing is to hide such settings from the settings dialog. This could be useful for settings dependent on current editor build, but idk if we have such settings (maybe for mono?).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

When project loads, Godot would check all saved project settings and editor settings and compare them with some table of defined, known settings. Not sure if making such table is possible right now, as the settings are actually defined all over the code with EDITOR_SET and GLOBAL_SET. We might need to centralize it first.

If a setting is not in the table, yeet. (or hide, without modifying the settings file)

If this enhancement will not be used often, can it be worked around with a few lines of script?

Technically doable with a plugin, but this should be in editor.

Is there a reason why this should be core and not an add-on in the asset library?

Editor and project settings are part of editor.

Mickeon commented 2 years ago

I think this would especially make sense between the transition from 3.x to 4.0. I have a feel this may be unexpected behaviour if completely automatic on startup, however.

Flavelius commented 2 years ago

While it's not directly related a similar issue with obsolete/leftover entries also exists in tscn/tres files (https://github.com/godotengine/godot/issues/47253), so i think it's worth rethinking how the engine deals with this in general.

RedMser commented 3 months ago

Whenever Godot encounters some unknown project or editor setting upon startup, yeet it.

This would also remove settings created by a GDExtension which failed to load. I'm more in favor of hiding or visually highlighting unknown settings, and having an explicit list of deprecated settings in the editor which are automatically migrated (and/or just delete them without touching anything else).