Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
717 stars 81 forks source link

Resolution Changing when saving options when starting fresh on save data #120

Closed ac-arcana closed 4 months ago

ac-arcana commented 4 months ago

On the latest version, when I delete my save data, the resolution is reset to 1280x720. The result is that once I change any setting my view changes to a small viewport as the resolution is not my screen resolution.

See the following video demonstrating the issue:

https://youtu.be/uzcj04vnZ8g

Phazorknight commented 4 months ago

I looked into this a bit and I don't think it has much todo with the save data (despite of course the cfg itself, but that's not really an issue)

I see you run this on Window mode Fullscreen. When the resolution gets changed, in order for the game window to cover the screen, the window mode needs to be reapplied. If you change the resolution first and then change the window mode (windowed and then back to fullscreen) you should be able to get back to fullscreen in the desired resolution (and not have those black areas).

I'll look into maybe triggering re-applying the window mode on resolution change to see if this fixes it as that's what I'd expect to happen too.

FailSpy commented 4 months ago

Yeah, seeing this now, can confirm. Whenever you close the pause menu, regardless of whether or not you made resolution changes via the options menu, it will "reapply" whatever settings are saved. This is to clear any potentially unapplied settings when the player returns.

So when you alter the window size, closing the pause menu will reconfigure your layout -- even if you just opened and closed the pause menu and that's it.

ac-arcana commented 4 months ago

With the latest version now, when I delete my data, my settings are defaulting to fullscreen and 1280x720 resolution. This is resulting in the same black boxing behavior when the game starts.

Phazorknight commented 4 months ago

If there's no config file, the window mode and resolution defaults to the first available setting AFAIK. What scene are you experiencing this behaviour (game scene or main menu scene?)

Currently the options in the main scene aren't applied the same way as in the pause. I'll probably tinker a bit more with it to make the behavior match more.

ac-arcana commented 4 months ago

The game scene, basically as soon as I start the main game scene (by picking a new game)

Phazorknight commented 4 months ago

Just a mini update: With this commit https://github.com/Phazorknight/Cogito/commit/b872a285b6336c777d3013edacafb868a6c6b6be, I've centralized how the option menu is handled via a single packaged scene that is included in both the main menu and the pause menu.

I haven't changed how the options config gets loaded/applied yet.

As this might be a bit tricky to reproduce, here's just me laying out how the options menu works in terms of saving/loading settings.

ac-arcana commented 4 months ago

This still isn't what I would think is expected behavior. Here is the latest behavior for me:

https://youtu.be/yH9yx84Fubk

Phazorknight commented 4 months ago

Thanks for this video, that was helpful in getting to the bottom of this.

Please give the latest commit a try: https://github.com/Phazorknight/Cogito/commit/10befee1207ecc7f134d115fdbab173c41289141

This basically forces to apply the window mode whenever the options are loaded, which should reduce the amount of times the black bars appear. Unfortunately, this also creates a bit of a window flashing whenever the window mode is applied. Will see if I can find a way to reduce this in the future.

ac-arcana commented 4 months ago

This behaved way better now. I'd say that's resolved