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

Project setting changes aren't always saved to project.godot when pressing Ctrl + S #55145

Open
Calinou opened this issue Nov 19, 2021 · 6 comments

Comments

@Calinou
Copy link
Member

Calinou commented Nov 19, 2021

Godot version

3.4.stable, 4.0.dev (84f59c6), 4.3.stable, 4.4.dev 84dcdde

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

Project setting changes aren't always saved to project.godot. If I change a setting, close the Project Settings dialog, press Ctrl + S then run the project, the new project setting's value isn't always taken into account by the running project. This seems to happen sporadically, but I've had it happen dozens of times by now. Pressing Ctrl + S multiple times in a row can sometimes ensure the value is saved correctly, but pressing it twice isn't always enough.

This occurs both on 3.4-stable and master. I've seen this happen as far back as 3.3 and may be linked to #31747.

So far, I've only reproduced this on Linux, but I don't use the editor on Windows often enough to notice the issue there.

Steps to reproduce

  • Open Project > Project Settings.
  • Change any setting's value (for instance, Fullscreen or Print Fps). It doesn't matter whether the editor needs to be restarted after the setting is changed.
  • Close the editor settings.
  • Run the project.

Minimal reproduction project

N/A

@Calinou Calinou added this to the 3.5 milestone Nov 19, 2021
@Calinou Calinou changed the title Project setting changes aren't always saved to project.godot Project setting changes aren't always saved to project.godot when pressing Ctrl + S Nov 19, 2021
@akien-mga
Copy link
Member

Isn't it just that at the times it didn't work, you didn't have any scene open? Ctrl+S saves the scene, not the project, and it's the former which also happens to save project.godot. If there's no scene opened, it might refuse saving.

@Calinou
Copy link
Member Author

Calinou commented Jul 19, 2022

Isn't it just that at the times it didn't work, you didn't have any scene open?

This occurs even with a scene currently open in the editor. I can still reproduce the issue as of 4.0.alpha12.

@Calinou
Copy link
Member Author

Calinou commented Oct 23, 2022

Sometimes, I actually have to run the project 3 times to be able to see a change (only seen in 4.0.beta so far).

@Kluskey
Copy link

Kluskey commented Jan 30, 2023

I'm running into this too when trying to get/set ProjectSettings via a tool. I see the validly-updated setting when I navigate to Project Settings in the GUI, but when I run the app, it reads an old project setting that I had previously manually inputted via the GUI (and doesn't show the new Project Setting that I set via ProjectSettings.set_setting)

Version: 4.0.beta
System: macOS 12.4 Monterey, M1 Max

(Not sure if my use case is this same since @Calinou's issue is in the context of pressing Ctrl + S, but it might be related?)

@ellenhp
Copy link
Contributor

ellenhp commented May 26, 2023

I encountered this issue in a C++ module. I found that the settings I wanted to save were being filtered out by the initial value check in ProjectSettings::save_custom. A workaround for me was to call ProjectSettings::get_singleton()->set_initial_value(setting_key, Variant()). I was also able to fix this by moving GLOBAL_DEF to a later point in the startup process, which feels a bit less like a hack. I'm not sure how much of this would transfer to a tool script, but both options worked for me and set_initial_value is exposed to script so that would be my first guess at a workaround.

@Calinou
Copy link
Member Author

Calinou commented May 24, 2024

I can still reproduce this on 4.2.2.stable and 4.3.dev6 (Linux).

It might be worth using strace to debug whether files are being written too early (or written twice when they don't need to), leading to project.godot getting unexpectedly overwritten.

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

No branches or pull requests

5 participants