3 ms·
Most games that _do_ use the registry use it as a data store that may or may not be accessed by external applications. It provides a very reliable pathing (at l
by pathartl 3y ago
Most games that _do_ use the registry use it as a data store that may or may not be accessed by external applications. It provides a very reliable pathing (at least at the time of the game's release) to access typed data.
For instance, most EA games from the early 2000's standardized the store of the CD key in ~HKLM:\SOFTWARE\<Game Name>\ergc. This would let one install the game to any drive and still have access to the CD key.
Games also use the registry as a way to point to where the game is installed. In the worst case scenario, it's used as a dumping ground for the game's preferences/settings and save states. With the shift to 64 bit and the introduction of WoW64 and most recently the shift to VirtualStores, I would rather nobody ever stores anything in the registry.
I'm currently working on a compatibility shim geared towards games that will redirect winapi filesystem and registry calls to a custom location. Hopefully it'll result in being able to make more portable installs of games that may require access to the registry.
- heavenlyblue 3y agoHow is that different from accessing $HOME/.config? It does exist on Windows too, but I don't want to Google it. I believe in Windows there's even $SHARED/.config
- c0nsumer 3y agoUsing the registry is a pretty simple API call to say place X here, read X if it exists, etc. If you need to start manipulating configuration files, then you need to deal with all the complexities of that. The registry is great for exactly this sort of config info. And on Windows, HKLM (HKEY_LOCAL_MACHINE) is for system-wide stuff. If it were per-user config it'd go in HKCU (HKEY_CURRENT_USER).
- Narishma 3y agoI think it's %LOCALAPPDATA% and %APPDATA% respectively.
- kortex 3y agoThose sound like exactly the use cases the registry should be used for. However in practice all kinds of state ends up in there that does not need to be accessed by anything other than the game process.