Live data from Hacker News

KSP2 is spamming the Windows Registry until the game stops working

forum.kerbalspaceprogram.com

151–160 of 306 posts

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

#151
post #76

Earlier quoted context omitted.

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…

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

nix solves this

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

#152

Earlier quoted context omitted.

I think the "central" part is where you lose me with this argument. What advantages does the registry have over application-specific KV stores... besides the potential to interfere with other applications and the OS itself?

Where do you store where the application-specific KV stores are located? Are you just going to hard-code it so the application cannot be moved or installed elsewhere or on external drives? Where does the OS store its own settings? There are a lot of problems with software "shotgunning" their junk across the system. This isn't exclusive to the Registry or even a specific OS unfortunately. Just go look at what configur…

macOS has a folder called Library where this stuff is supposed to go. It's not enforced by decree, with many apps doing their own horrible thing. Ultimately, its macOS' culture that mostly makes apps puts their settings and other resident details in Library.

I'm not knowledgeable enough to know why a culturally enforced folder is far worse than the database that Windows has. Care to enlighten me?

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

#153
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’s /etc but harder to browse and edit.

Or, from the contrary perspective: it’s the 500 places config lives on Linux, but in one place instead.

(Except it still has a deep hierarchical structure, so that second one is kiiiinda not entirely true, in that you can run into exactly the same issues as scattered config files on Linux)

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

#154
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?

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

The Windows Registry is the NT Kernel's system config/preference store. The closest Linux equivalent is dconf. Like dconf it is built to be a read-mostly/read-optimized database. It's not as strongly focused on a service-bus architecture as dconf. It tries to heavily optimize for an MRU on-disk order (somewhat like redis) and optimize for strong write consistency (unlike redis which is happy to do more in memory between flushes to disk). Any writes at all generally thrash the Registry "hive" database files some. Heavy amounts of writes will murder it. It was optimized for reading not writing.

The Registry was side-ported to Windows 95 from the NT Kernel, in part because COM (it became the central spot for registering COM components), and a lot of mistakes were made in the messaging about it. It was intended to be Kernel-focused and mostly never used by user-space applications. That unfortunately wasn't made clear enough, and needing to register COM components in it certainly muddied the message. So Windows apps have a long history of storing a lot of things to the registry, much of which they should probably use user config files for.

> Can't you store stuff alongside the install? Or in some user data location?

In Windows due to a complicated dance with anti-malware efforts and secure binary memory mapping it is generally frowned upon to store stuff alongside installs (in the %ProgramFiles% or %ProgramFiles(x86)% directories). Many programs (especially well written ones) don't even have write permissions at all to their install folder (similar to how many distros lock down /bin and sometimes /usr/bin and/or /usr/local/bin to superuser accounts only). For backwards compatibility reasons with applications dating all the way back to Windows 95 some app installer are allowed to still re-ACL their install directory to give back write permissions to the application. Also, in modern Windows (since Vista), depending on a number of factors Windows will actually lightly sandbox the app when that occurs and redirect ACL changes and writes to an "overlay" directory, allowing the app to believe that it still is writing to its own install directory but it is actually writing to a machine or user directory outside of %ProgramFiles%.

On the other hand there are plenty of user folders available for config storage: Generally the suggestion is %AppData% for most such files. (This is the "Roaming" app data that may be automatically copied to other machines for some users on some networks, mostly enterprise/corporate accounts/users.) Some apps may prefer %LocalAppData% which doesn't roam for larger config files or more machine-specific transient things (like window positions or caches). It's also common enough to see cross-platform apps use Unix-style dotfiles under %Home% and even sometimes XDG-style dotfiles under %Home%/.config/. That's not generally recommend and especially because of roaming behaviors the general preference is to use the appropriate %AppData% or %LocalAppData% and avoid cluttering %Home%. Though many Windows users don't even really use or see %Home% for a variety of interesting reasons, so its not entirely frowned upon as wrong. (Unlike storing config files under %Documents%, an ancient mistake of many Windows apps not as terrible as storing things in the Registry they shouldn't, but more visibly obnoxious to Windows users that want tidy Documents folders and feel that folder should be entirely user-controlled.)

Also, there is a machine-wide config location, somewhat akin to /etc, named %ProgramData%.

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

#155

Not surprised at all; KSP as a franchise is in the enshittification stage where they aim to invest the minimum amount of money and maximise returns. This is just simply inexcusable software engineering and quality control. Bit tangential but I'd like to remind everyone that this is the game where the lead designer (?) said that wobbly rockets and physics bugs are adding to the fun of the game, and they are implemente…

KSP2 isn't an enshittification play, imo. It's literally just bad project management. I'll list their sins from my armchair: - remaking a beloved, established game that has a prodigious base of features and extremely extensive modding support. you have a HUGE hill to climb just to get to your "MVP" - you have to supplant the existing game plus its modding community, and this is already a niche audience of ["people wh…

> KSP2 isn't an enshittification play, imo. It's literally just bad project management.

It is also MBA decisions (kicking the game out for full price as an early-access game that was nowhere near close to being ready for that).

The combination of PM and MBA decisions that have screwed it up are definitely enshittification-adjacent, although they may just lack enough competency.

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

#156

Adding 322 mb of data to the registry isn't going to be healthy for windows either. Registry hives expand but don't contract again. The registry is effectively held entirely in RAM. You are therefore effectively wasting 322 mb of RAM even when KSP isn't running.

Somewhere, there are Microsoft devs WTFing over crash reports indicating registry is over a gig.

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

#157
post #104

Earlier quoted context omitted.

> 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…

What's always annoyed me with many operating systems is this need to organize based on function instead of domain. If I install an application named "Bob" then I want ALL of Bob's configuration to live within Bob. I don't want it split between different registry keys or /usr/local, /etc/, /var, /lib, etc. I'm fine with there being conventions and categorizations, but I'd like to root node to be the application itself…

This exists for a while now, but didn't catch on:

https://gobolinux.org/at_a_glance.html

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

#158
post #30

Honestly when the brains come together on hackernews to reverse engineer and unfuck a high profile videogame I get unreasonably excited. The guy that fixed the GTAV loading times via identifying a broken JSON loop downloading cosmetics was astonishing to me

People doing work on their own free time to fix a corporation's mistakes for them gets you excited?

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

#159
post #134

Earlier quoted context omitted.

> 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…

The performance part is questionable, as is the discoverability: Programs write binary blobs to impossible-to-find keys and, as we see here, there's nothing preventing a severe loss of performance if the program writes too much to the registry. It can only be examined with specialized tools, and, due to the binary values written to it, it might not be meaningfully editable at all.

There's also no mechanism for the OS to offer the user the ability to purge registry entries when a program is uninstalled, so the registry just bloats further and further.
Post reply on HN