Live data from Hacker News

KSP2 is spamming the Windows Registry until the game stops working

forum.kerbalspaceprogram.com

81–90 of 306 posts

Re: KSP2 is spamming the Windows Registry until the game stops working

#81
post #76
post #4

One of the comments mentions this: "Alright, doing some investigating it seems that they are saving the Pqs preferences based off of the instance ID of the pqs object, which, according to unity's own documentation, changes between runs of the game, hence why its saving 10 trillion different copies of the same data" So, somebody didn't notice a "changes every game" instance ID was in the path and/or data. They thought…

Coming from a Linux background, what is the windows registry and why do things need to write to it? All I ever read about it seem to be horror stories. Can't you store stuff alongside the install? Or in some user data location?

> what is the windows registry and why do things need to write to it?

It's a centralized, high-performance small key value store that's the alternative to writing a million config files in random places.

It's arguably much better in my experience. E.g. one of the never-ending headaches I always have on Linux is updating config files when a package updates. There's no automatic file merge in general (hence .pacnew and such) so you gotta do it by hand (and not everything is available with the foo.d/ hack). The registry already operates at the value granularity so it bypasses this kind of issue.

And as a developer you don't have to worry about some things you might not think about, like the trade-off between corrupting your config files with in-place updates vs. having to create a new file and replace the old one after every config change.

Re: KSP2 is spamming the Windows Registry until the game stops working

#82
post #76
post #4

One of the comments mentions this: "Alright, doing some investigating it seems that they are saving the Pqs preferences based off of the instance ID of the pqs object, which, according to unity's own documentation, changes between runs of the game, hence why its saving 10 trillion different copies of the same data" So, somebody didn't notice a "changes every game" instance ID was in the path and/or data. They thought…

Coming from a Linux background, what is the windows registry and why do things need to write to it? All I ever read about it seem to be horror stories. Can't you store stuff alongside the install? Or in some user data location?

The windows registry is a hierarchal data storage system. Yes, basically a filesystem.

Re: KSP2 is spamming the Windows Registry until the game stops working

#83
post #76
post #4

One of the comments mentions this: "Alright, doing some investigating it seems that they are saving the Pqs preferences based off of the instance ID of the pqs object, which, according to unity's own documentation, changes between runs of the game, hence why its saving 10 trillion different copies of the same data" So, somebody didn't notice a "changes every game" instance ID was in the path and/or data. They thought…

Coming from a Linux background, what is the windows registry and why do things need to write to it? All I ever read about it seem to be horror stories. Can't you store stuff alongside the install? Or in some user data location?

It is some combination of /etc and /var. a hierarchical key-value data store shared by the whole system used for configuration management mostly.

Re: KSP2 is spamming the Windows Registry until the game stops working

#84
post #76
post #4

One of the comments mentions this: "Alright, doing some investigating it seems that they are saving the Pqs preferences based off of the instance ID of the pqs object, which, according to unity's own documentation, changes between runs of the game, hence why its saving 10 trillion different copies of the same data" So, somebody didn't notice a "changes every game" instance ID was in the path and/or data. They thought…

Coming from a Linux background, what is the windows registry and why do things need to write to it? All I ever read about it seem to be horror stories. Can't you store stuff alongside the install? Or in some user data location?

https://en.wikipedia.org/wiki/Windows_Registry#Rationale

Re: KSP2 is spamming the Windows Registry until the game stops working

#85
post #8

It feels like the Windows Registry is one of those well-intentioned ideas that ended up being a tremendous mess in actual implementation. "Let's use a central database to store things that the OS, drivers, and UI need to access" somehow became "half assed KV dumping ground for every process and their dog to litter with whatever while acting as a singular bottleneck". See also: https://news.ycombinator.com/item?id=322…

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\\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.

Re: KSP2 is spamming the Windows Registry until the game stops working

#86
post #8

It feels like the Windows Registry is one of those well-intentioned ideas that ended up being a tremendous mess in actual implementation. "Let's use a central database to store things that the OS, drivers, and UI need to access" somehow became "half assed KV dumping ground for every process and their dog to litter with whatever while acting as a singular bottleneck". See also: https://news.ycombinator.com/item?id=322…

They are global variables. Worth working very hard to block in any project. Separate microservices are the most effective way I saw so far to stop people in a large org from making shortcuts via global contexts. I feel bad for our frontend devs dealing with a tide of global constructs in our React codebase.

You still need to store variables somewhere.

The equivalent of "separate microservices" is making sure multiple programs don't share registry keys, and that's already the case 99% of the time for this kind of key.

Re: KSP2 is spamming the Windows Registry until the game stops working

#89
post #48

Earlier quoted context omitted.

Well, I still believe it's going to be good eventually. Like KSP1, for example, or No Man's Sky. There certainly have both the resources and a guaranteed player base to make that happen. That said, I cannot be sure of that, so I will not buy it until it is actually good.

> KSP1, for example, or No Man's Sky Those are two very different examples, though. NMS was improved heavily but in many ways never approached the features and qualities that people were expecting. KSP2 feels more like NMS than KSP1 in that regard - people have expectations. They've been sold a specific vision which doesn't look like the game. Further, unless it's great ... why not just keep playing KSP1 with extensi…

> NMS was improved heavily but in many ways never approached the features and qualities that people were expecting.

Asking who? From what I've seen, the typical sentiment is that they've gone far past the expectations they set.

For KSP2 I think the main expectations were eventual new content (starting with a good chunk less than KSP1 and adding more later) and better performance. And they sure haven't delivered performance.

Re: KSP2 is spamming the Windows Registry until the game stops working

#90
post #76
post #4

One of the comments mentions this: "Alright, doing some investigating it seems that they are saving the Pqs preferences based off of the instance ID of the pqs object, which, according to unity's own documentation, changes between runs of the game, hence why its saving 10 trillion different copies of the same data" So, somebody didn't notice a "changes every game" instance ID was in the path and/or data. They thought…

Coming from a Linux background, what is the windows registry and why do things need to write to it? All I ever read about it seem to be horror stories. Can't you store stuff alongside the install? Or in some user data location?

The database-backed configuration mechanism makes a ton of sense, and if you squint, the filesystem is really kind of a database anyway. With the registry, there’s a lot you get for free—you can set defaults system-wide, you don’t have to deal with parsing, you can get new values without re-parsing a file, etc.

A lot of the horror stories came from earlier versions of Windows which had problems with reliability.

If you spend time as a Windows sysadmin you can start to appreciate it, because it does make certain administration tasks easier. Like “I need to change 10 registry different keys on 50 different machines” is easier on Windows. On Linux, I’d do the same with, like, Ansible scripts which can be a lot more error-prone to write.

Post reply on HN