Page 1 of 1

[PROGRAMMING]True Local Saves independent of Game portals.

PostPosted: Mon Jan 30, 2012 12:22 am
by dimumurray
KR has been getting a lot of flack lately over at Kongregate for lost saved games so I decided to look into options for solving this issue.

Traditionally devs rely on some cookie scheme to store saved games(SharedObjects for flash), sadly this scheme is prone to problems since the browser and other apps routinely delete cookies and other saved state. One work around is to have the game portal host saved games but not all hosts offer this service.

How about a true local save solution instead? As of version 10 and up flash allows users to load and save files locally to their machines by using the FileReference API. No more sandbox security issues to worry about; you only have to ensure that loads and saves are user-initiated via mouse clicks. I have done it myself and its fairly easily to take an object instance representing save state and write it to a ByteArray and then have FileReference::save() save it to the user's location of choice.

Of course the downside of this method is that the user has to manually initiate the save(i.e. press a button) but this method might help to alleviate some the gripes some players have with saving.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Mon Jan 30, 2012 12:36 am
by Kitler
isnt the other downside saveediting?

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Mon Jan 30, 2012 12:42 am
by dimumurray
Kitler wrote:isnt the other downside saveediting?

True. However writing to a byteArray will ensure that state data is not in human readable form, plus you can run a encryption and/or compression algorithm on the byteArray to mangle the info a bit more. Granted those measures won't stop a more ardent hacker, but it will suffice for the typical dude sniffing around in a save file.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Mon Jan 30, 2012 6:15 pm
by Vanzen
Thank you DD will look into it :)

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Mon Jan 30, 2012 7:01 pm
by dimumurray
Kitler wrote:isnt the other downside saveediting?


Did some digging and it turns out that flash cookies are prone to the same problem, maybe even more so given that tools exist to edit them. It appears the hacker community is quite familiar with the file format for flash cookies. I suppose one can get around that by coming up with a custom format for saves instead, again via ByteArray.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 12:06 am
by Giangreymon
WTF!!! U guys are UBER GEEK :ugeek:
:mrgreen:

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 2:06 am
by Epicazeroth
I made a game and I don't know what language.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 11:50 am
by suin
the browser and other apps routinely delete cookies and other saved state.

yeah, that's the biggest problem with the local saves for some users. Maybe the devs could add some user-initiated saving feature as a supplement as well as the automatic one (this one actually saves a lot of trouble), or reprogramming the saving system.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 10:23 pm
by Epicazeroth
Epicazeroth wrote:I made a game and I don't know what language.

Actually, it sucked, but it still was technically a game.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 10:43 pm
by kilele
dude you reply to your own posts? I'm really curious about your game, please share a download in the 'game talk' subforum

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Tue Jan 31, 2012 10:51 pm
by Epicazeroth
I have no idea how to download something, I made it at camp and it's half done and I forgot all the commands to complete it. If they're not called commands, that proves how little I know about programming. As I said, it was just a summer camp project. And I do not reply to my own posts, I forgot about editing until I posted.

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Wed Feb 01, 2012 3:54 am
by dimumurray
Found some sample code over at wonderfl. It covers all the basic concepts to pull off true local saves:

http://wonderfl.net/c/mdgh/read

Re: [PROGRAMMING]True Local Saves independent of Game portal

PostPosted: Wed Feb 01, 2012 2:36 pm
by suin
Found some sample code over at wonderfl. It covers all the basic concepts to pull off true local saves:

I usually get the local ones to make backups by searching "slot" in my PC in case of any unexpected. BTW, I was wondering if there would be some tools or not to facilitate the process or at least add some "download" button to transfer the online saves to the local ones.