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

Thanks for playing, and I'm glad you're enjoying it!

I have the infrastructure (mostly) in place to allow for unlocking baubles, and that is a planned feature. I'll utilize it more going forward, but with this being a WebGL build I've yet to find a reliable way to save any data on the user's machine. Right now, the game 'should' remember what decks you've unlocked and keep track of all your played daily games, but every machine I've tested it on forgets this stuff after a few hours. I'm probably going to end up making a desktop version, which I know will work and remember data, even through different versions.

Thanks again, and have a good one!

(+1)

Are you using persistent rather than session cookies to handle save data?

I started off using PlayerPrefs to save data, it was inconsistent.

I am currently using Application.persistentDataPath to create text files that store the data, along with JS_FileSystem_Sync(); , which is still inconsistent.

I'm not sure if either of these systems use cookies, I honestly don't know much about how they work. Could you point me to an article or video that might enlighten me?

(+1)

So this isn't my area of expertise, but I believe Application.persistentDataPath only persists for the lifetime of a browser instance for Web GL applications based on: https://www.reddit.com/r/Unity3D/comments/5nnj2z/webgl_saving_text_file_locally_... .  This is similar to how a session cookie-- that is, a cookie with no expiration date-- works.

Regarding tutorials: https://www.w3schools.com/js/js_cookies.asp looks pretty good, but basically you set cookies with assignments to document.cookie using javascript and read them back by setting a string to document.cookie and then scanning through it for your specific name.  There are other ways, and maybe there's something else that's the best practice for WebGL-- I'm not a WebGL programmer.  But if you *do* use cookies the thing I was trying to say was that if you don't explicitly set an expiration date (conventionally 1 full year past current time) the cookie is deleted when the browser instance ends, which can be counter-intuitive.

I will look closer into this, thank you for the resources! I would love for this to be easier, it's wild to me there's not a simple solution for this. Gotta figure out how to get c# to talk to JS to talk to the browser. It's a bit daunting, and totally new territory for me, so no promises, but I'm going to do my best to figure this out. I appreciate you!

Found a resource you might be interested in: https://3p0ch.newgrounds.com/news/post/1086279

(3 edits) (+1)

Testing this out today, thank you!

Edit: Got it working between versions. Still too early to tell if it will save between sessions, as I don't know exactly how long session cookies last by default. Testing it out on a test page so as to not screw with anything until I'm confident it is working fine

Edit2: Tested it out over a couple days, seems stable, seems to be working. The newest build has this system in place. Anyone reading this, please let me know if your data isn't saving between sessions