godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.99k stars 21.16k forks source link

Engine uses wrong directory for appdata on Windows #84324

Open rpahut opened 1 year ago

rpahut commented 1 year ago

Godot version

not version specific

System information

Windows 10

Issue description

According to the documentation engine uses the %appdata% location to store application data. This location points to ..user/AppData/Roaming/ directory, intended specifically for the data that supposed to be synchronizable between multiple user PCs (that share Microsoft account). For Godot using this directory makes no immediate sense, and looks more like a mistake. In fact with no synchronization strategy in place it would only work correctly so long as there is no synchronization taking place.

The appropriate location for the local-only application data is %LocalAppData% .

Steps to reproduce

n/a

Minimal reproduction project

n/a

smix8 commented 1 year ago

While Local would make more sense the majority of games are actually using LocalLow on Windows.

  1. Roaming folder contains data that can move with the user server profile from computer to computer
  2. Local folder contains data that cannot move with a user profile.
  3. LocalLow folder same as Local but includes restricted low-level access.

On my system the balance between Roaming / Local / LocalLow is like 6 / 17 / 87 games.

It may make sense for the Godot Editor to place its own data into the Roaming folder but due to the asset lib and other gotchas it would make even more sense to restrict the access in LocalLow. Unreal Engine uses Local while Unity uses LocalLow. It makes mostly no sense for a Godot game project to place its data in the Roaming folder. It should be always Local or preferably LocalLow.

The LocalLow folder adds an extra level of security for programs that know they are vulnerable, e.g. due to multiplayer and web connect. So this way they can start themself in "low" access mode so that they can only write into those folders and not risk the rest of the hard drive.

Imo the correct solution would be a selection for those 3 on Windows export because they all serve different purposes. E.g. if you make an app with Godot you might want to use Roaming, while most games will use Local or LocalLow.

Calinou commented 1 year ago

Some games like Xonotic use the elusive Saved Games directory, which is part of every Windows installation since Windows 7 at least. This directory has the upside of not being an hidden directory, but it's still difficult to discover. It may be the least well-known standard Windows library folder.

There's also the informal standard Documents\My Games, but this one won't be internationalized as it's a hardcoded name.

smix8 commented 1 year ago

Yes the "Saved Games" directory gets visually localized. The folder dir is still "user/Saved Games". Exactly 3 games use it on my system so it is a minority programm. "My Games" is used by 2 so even less relevant.

Tbh as a Windows user I am conditioned to expect all my game relevant user data, including save games, in the same AppData folder, not split at random with x-folders. So everytime games try to be fancy and use "Saved Games" or "My Games" it just gets very annoying quickly.

patwork commented 1 year ago

There is a way to change "Saved Games" location. It's stored in the registry.

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"

https://www.elevenforum.com/t/move-or-restore-default-location-of-saved-games-folder-in-windows-11.8717/