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

override.cfg gets pulled into project.godot #30912

Closed
supagu opened this issue Jul 29, 2019 · 25 comments · Fixed by #55230
Closed

override.cfg gets pulled into project.godot #30912

supagu opened this issue Jul 29, 2019 · 25 comments · Fixed by #55230

Comments

@supagu
Copy link
Contributor

supagu commented Jul 29, 2019

Godot version:
Master branch (3.2)

Issue description:
I add values to override.cfg - such things as video/render settings or what not when the user changes some options and hits apply.
These values will eventually get pulled into the project.godot settings during development.

I would expect there a separation to be maintained between whats in the override.cfg and whats in the project.godot settings.

Steps to reproduce:
Create an override.cfg, add in a value. Run the editor and make a change to something in your project. Quit the editor.

@Calinou
Copy link
Member

Calinou commented Jul 29, 2019

I can confirm this on commit 5d172d5. This issue has been around for a while; I could reproduce this while developing godot-settings-manager which recommends defining a project settings override.

@KoBeWi
Copy link
Member

KoBeWi commented Sep 23, 2020

Still valid in 3.2.3

@jitspoe
Copy link
Contributor

jitspoe commented Feb 17, 2021

Yeah, this has been a bit of a struggle for me, as my fullscreen setting keeps getting unset, and I couldn't figure out why at first.

My case:
Project settings (project.godot) has fullscreen enabled, as I want this to be the default behavior when the game first launches.

I have an options menu that can enable/disable fullscreen and writes to a "Project Settings Override" config file. I turn fullscreen off in the game, which modifies the config file.

Launching the editor while this config file exists disables the fullscreen value in the project.godot file.

What I'd like:
Fullscreen setting stays set how I set it in the project and determines the first-launch behavior of the game. Override config file only applies to the game (either standalone or when launched from the editor).

@Calinou
Copy link
Member

Calinou commented Feb 17, 2021

@jitspoe As a workaround, you can configure the project settings override to be used only in exported projects by defining its value for the standalone feature tag and leaving it unset otherwise.

@jitspoe
Copy link
Contributor

jitspoe commented Feb 17, 2021

@jitspoe As a workaround, you can configure the project settings override to be used only in exported projects by defining its value for the standalone feature tag and leaving it unset otherwise.

That would mean it would always launch in fullscreen while developing, right? That's not what I want, either. Or are you saying I override the setting to enable fullscreen for standalone, and when the override config file gets loaded, it only applies to general setting and not the standalone one?

@Calinou
Copy link
Member

Calinou commented Feb 17, 2021

That would mean it would always launch in fullscreen while developing, right?

Yes, although you can override this in the Editor Settings (in the Window Placement section). You could also load the project settings override as a regular ConfigFile and apply the setting by setting OS.window_fullscreen in a script (although this will cause the default window state to appear for a split second).

Or are you saying I override the setting to enable fullscreen for standalone, and when the override config file gets loaded, it only applies to general setting and not the standalone one?

You can do that too 🙂 Any project setting can be overridden using feature tags.

@jitspoe
Copy link
Contributor

jitspoe commented Feb 25, 2021

This doesn't seem like it would be a viable approach. If I have the override config set what should be in the shipping version of the game, the project config would still have that set on project load, right? So when I went to export it, it would use what was in project file as the default setting when the game first launches.

@2shady4u
Copy link
Contributor

Some additional information/issue that is related, when using a custom override.cfg or user://custom_settings.cfg on exported projects, Godot attempts to modify the project.godot file on game launch but this results in following error:

image

I would expect some kind of feature tag check that properly checks if the Godot instance is an exported build or not?

@Calinou
Copy link
Member

Calinou commented Jul 30, 2021

Some additional information/issue that is related, when using a custom override.cfg or user://custom_settings.cfg on exported projects, Godot attempts to modify the project.godot file on game launch but this results in following error:

image

I would expect some kind of feature tag check that properly checks if the Godot instance is an exported build or not?

Please open a new issue with a minimal reproduction project attached, as this is an unrelated bug.

@jitspoe
Copy link
Contributor

jitspoe commented Nov 22, 2021

I've just noticed another issue with this: I decided to consolidate the settings all in one file for one of my projects, and it brought completely unrelated settings (like settings I added specifically to my game) into the project.godot file.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 22, 2021

Would it be ok if override.cfg was functional only at runtime and not in editor? That would fix the issue.

@Calinou
Copy link
Member

Calinou commented Nov 22, 2021

Would it be ok if override.cfg was functional only at runtime and not in editor? That would fix the issue.

That sounds good to me. I don't see any reason to have override.cfg be effective within the editor.

@jitspoe
Copy link
Contributor

jitspoe commented Nov 23, 2021

Depends on what you mean by "only at runtime". I'd like to be able to test my game when running from the editor and have the settings work so I can test/debug things without having to export a build every time. I just don't want them loading when the editor launches (not running the game).

@KoBeWi
Copy link
Member

KoBeWi commented Nov 23, 2021

I'd like to be able to test my game when running from the editor and have the settings work so I can test/debug things without having to export a build every time.

This is still possible.

@dreadpon
Copy link

dreadpon commented Dec 9, 2022

I cannot describe just how utterly frustrating it was to deal with project.godot that constantly reverted itself.
Is this still supposed to happen when launching an editor? Because it does.

However, my override.cfg has a different name (defined in ProjectSettings as user://project_settings_override.cfg), and it totally overrides project.godot whenever I launch my project.

It kind of makes sense, but still I expected this file to be used for runtime-only, not while in editor.
The workaround I used is to not save it via ProjectSettings.save_custom(), but write it to a separate ConfigFile. That way only a small subset of settings gets overriden in project.godot file.

It's manageable now for graphics settings, but might not be sufficient if I'd like to write something more substantial in the override file.

@juliohq
Copy link

juliohq commented Jul 3, 2023

Still happening in 4.0.3 stable.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 3, 2023

Try in 4.1 rc.
Also a minimal reproduction project would be useful.

@AlfishSoftware
Copy link

AlfishSoftware commented Aug 7, 2023

Would it be ok if override.cfg was functional only at runtime and not in editor? That would fix the issue.

That sounds good to me. I don't see any reason to have override.cfg be effective within the editor.

So, it's not possible to have an editor plugin/addon that I don't want checked into git?
I thought I could have a file separate from project.godot for project settings that I can exclude from git, and I hoped this override.cfg would be the feature for this, so I could set editor_plugins/enabled and autoload/MyEditorOnlyTool outside of version control.

If only there was a way to set/add those from editor settings as well, instead of having to use project settings, that would be much better.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 7, 2023

You can use get_editor_interface().get_editor_settings() and use set()/get() to modify custom settings (or set_meta()/get_meta() if it doesn't work).

@AlfishSoftware
Copy link

But will that be excluded from project.godot even after I save?

@AlfishSoftware
Copy link

AlfishSoftware commented Aug 7, 2023

Wait, editor_plugins and autoload are project settings. Is there a way to set them or their equivalent as editor settings?
Do I just use the same path in editor settings and that just works in project settings?

@KoBeWi
Copy link
Member

KoBeWi commented Aug 7, 2023

No, currently they are stored in project settings.
Maybe I misunderstood your comment. EditorSettings can be used for plugin settings that you don't want in project, but not the plugin list itself. I think what you want is global addons, which are not implemented yet: godotengine/godot-proposals#831

@AlfishSoftware
Copy link

Yes, this is exactly what I want.
I thought I could use this workaround while it's not yet implemented, but I guess not.

@ace24713
Copy link

I'm still getting this issue in 3.5, specifically when project.godot is reloaded i.e. if external modifications were detected... usually happens when I leave godot open and do a git pull on my project

@Calinou
Copy link
Member

Calinou commented May 30, 2024

@ace24713 Please open a new issue with a minimal reproduction project attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants