Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Oh! This is super interesting. Reading through this code I think I could drop PlayerPrefs completely! Just plop the normal json save files I use for the Win build into something consistent like "/idbfs/witchingstone/"and it will Just Work?

(1 edit)

Sounds like it should work, and if you think you might change the structure of your save files in the future and would rather just have to change the normal save files (for a desktop/console export) and not worry about also changing how PlayerPrefs saves the data then that approach might be less work in the long run. Just be sure to either ensure backward compatibility, or change the idbfs subdirectory if you do make any changes that break backward compatibility and you actually want to lose the old data.

On the other hand, if you don't think you'll need to mess with the code for save file structures, it might be easier to just pop in the class to override PlayerPrefs for HTML5 exports and be done with it.

(2 edits)

Yeah, it’s much easier not doing any PlayerPrefs stuff at all!

I think I have something. It was a little bit more complicated but, after doing some voodoo mentioned in the comments, it seems to work! Survived me making a couple of new builds at least.

Of course the next public build will kill existing webgl saves, but it would have done that anyway... Sad times. Thanks for your help!