Transitioning from Windows 32 - 64 bit release (with PlayerPrefs)

Hey everyone.

Have any of you managed to upgrade your game from a Windows 32 bit to 64 bit version?

I’ve been using Unity - Scripting API: PlayerPrefs to save basic values and I wanted to know if these values will persist when I transition to 64 bit. It looks like these values are saved in the registry, but I’m unsure what will happen if I replace my executable.

I’ve got my game published on Steam and several key settings are saved via PlayPrefs (the completion status for each level). So if they get reset it could really suck for players. When I did a local build and played it seemed to create nearly identical keys (but with a different combination of character at the end of the preference name). I’m unsure if this is a stand alone build issue and what might happen to players data if I release it.

Cheers

My formal, proper recommendation would be to release a 32 bit interim patch that changes how you store this data to save in %appdata% and then, a month later, release the 64 bit patch that instead loads from this file. PlayerPref’s ties to the registry can make it a bit of a mess when it comes to updates of this type.

edit: to expand my advice even further, I believe that even application settings should use this method instead of using PlayerPrefs

1 Like

Thanks. That’s probably a good idea, saving them somewhere else and then reading from them.

I think even making a settings.json file in the root directory of the game might be a good idea, that way the top level file is always distributed with the game and it’s easy to view / modify. I’m not overly worried about someone forcefully unlocking a scenario because only when the scenario is legitimately beaten does it unlock a steam achievement.

Cheers for your input!

I’d argue that, instead, the settings.json file should be generated in %appdata% on first launch, perhaps as a copy of a root file. AppData is literally meant for this sort of thing. Its entire purpose from its introduction in Vista was to provide a space for application settings data. If you want something for game saves that’s easier to access, you could always have your game create a directory in Documents, which is also a common practice.

Generally speaking, you don’t want your game mucking about in its own root directory.